Kaydet (Commit) d38627b2 authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Ashod Nakashian

vcl: use svl signing and remove moved code

Change-Id: Id875a675d7ab649c9223ecca5de2da69ff4b8786
Reviewed-on: https://gerrit.libreoffice.org/39718Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarAshod Nakashian <ashnakash@gmail.com>
üst c7fe625c
...@@ -227,7 +227,7 @@ enum class XRefEntryType ...@@ -227,7 +227,7 @@ enum class XRefEntryType
FREE, FREE,
/// xref "n" or xref stream "1". /// xref "n" or xref stream "1".
NOT_COMPRESSED, NOT_COMPRESSED,
/// xref stream "2. /// xref stream "2".
COMPRESSED COMPRESSED
}; };
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <sal/log.hxx> #include <sal/log.hxx>
#include <sal/types.h> #include <sal/types.h>
#include <sax/tools/converter.hxx> #include <sax/tools/converter.hxx>
#include <svl/cryptosign.hxx>
#include <tools/zcodec.hxx> #include <tools/zcodec.hxx>
#include <unotools/calendarwrapper.hxx> #include <unotools/calendarwrapper.hxx>
#include <unotools/datetime.hxx> #include <unotools/datetime.hxx>
...@@ -837,14 +838,10 @@ bool PDFDocument::Sign(const uno::Reference<security::XCertificate>& xCertificat ...@@ -837,14 +838,10 @@ bool PDFDocument::Sign(const uno::Reference<security::XCertificate>& xCertificat
m_aEditBuffer.ReadBytes(aBuffer2.get(), nBufferSize2); m_aEditBuffer.ReadBytes(aBuffer2.get(), nBufferSize2);
OStringBuffer aCMSHexBuffer; OStringBuffer aCMSHexBuffer;
vcl::PDFWriter::PDFSignContext aSignContext(aCMSHexBuffer); svl::crypto::Signing aSigning(xCertificate);
aSignContext.m_pDerEncoded = aDerEncoded.getArray(); aSigning.AddDataRange(aBuffer1.get(), nBufferSize1);
aSignContext.m_nDerEncoded = aDerEncoded.getLength(); aSigning.AddDataRange(aBuffer2.get(), nBufferSize2);
aSignContext.m_pByteRange1 = aBuffer1.get(); if (!aSigning.Sign(aCMSHexBuffer))
aSignContext.m_nByteRange1 = nBufferSize1;
aSignContext.m_pByteRange2 = aBuffer2.get();
aSignContext.m_nByteRange2 = nBufferSize2;
if (!vcl::PDFWriter::Sign(aSignContext))
{ {
SAL_WARN("vcl.filter", "PDFDocument::Sign: PDFWriter::Sign() failed"); SAL_WARN("vcl.filter", "PDFDocument::Sign: PDFWriter::Sign() failed");
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment