diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-11-17 12:40:06 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-11-17 15:54:06 +0100 |
commit | 972c1e9e7239ef84611b01dad5b112af8f353d3c (patch) | |
tree | 6c14d93b01a0071d29da179dc0706ebe36fca876 /xmlsecurity/inc | |
parent | 07d4f5d9e3b40025aaee12bb309317b2d267fbdc (diff) |
xmlsecurity PDF sign: handle AdES when writing SubFilter
Page 21 of "PAdES baseline signatures" specification from
<http://www.etsi.org/deliver/etsi_en/319100_319199/31914201/01.01.01_60/en_31914201v010101p.pdf>
says:
"The Signature Dictionary shall contain a value of ETSI.CAdES.detached
for the key SubFilter."
So in case the UI has the adescompliant checkbox enabled, write that
value instead of the Adobe default.
Change-Id: I69e606a32fb09bebd5e9b25b32150d1b8672f544
Diffstat (limited to 'xmlsecurity/inc')
-rw-r--r-- | xmlsecurity/inc/documentsignaturemanager.hxx | 2 | ||||
-rw-r--r-- | xmlsecurity/inc/pdfio/pdfdocument.hxx | 4 | ||||
-rw-r--r-- | xmlsecurity/inc/pdfsignaturehelper.hxx | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/xmlsecurity/inc/documentsignaturemanager.hxx b/xmlsecurity/inc/documentsignaturemanager.hxx index 08bdcf62e116..fe9f9a405d38 100644 --- a/xmlsecurity/inc/documentsignaturemanager.hxx +++ b/xmlsecurity/inc/documentsignaturemanager.hxx @@ -59,7 +59,7 @@ public: bool isXML(const OUString& rURI); SignatureStreamHelper ImplOpenSignatureStream(sal_Int32 eStreamMode, bool bTempStream); /// Add a new signature, using xCert as a signing certificate, and rDescription as description. - bool add(const css::uno::Reference<css::security::XCertificate>& xCert, const OUString& rDescription, sal_Int32& nSecurityId, bool bXAdESCompliantIfODF); + bool add(const css::uno::Reference<css::security::XCertificate>& xCert, const OUString& rDescription, sal_Int32& nSecurityId, bool bAdESCompliant); /// Remove signature at nPosition. void remove(sal_uInt16 nPosition); /// Read signatures from either a temp stream or the real storage. diff --git a/xmlsecurity/inc/pdfio/pdfdocument.hxx b/xmlsecurity/inc/pdfio/pdfdocument.hxx index c282ea694532..31a0546deb38 100644 --- a/xmlsecurity/inc/pdfio/pdfdocument.hxx +++ b/xmlsecurity/inc/pdfio/pdfdocument.hxx @@ -117,7 +117,7 @@ class XMLSECURITY_DLLPUBLIC PDFDocument /// Suggest a minimal, yet free signature ID to use for the next signature. sal_uInt32 GetNextSignature(); /// Write the signature object as part of signing. - sal_Int32 WriteSignatureObject(const OUString& rDescription, sal_uInt64& rLastByteRangeOffset, sal_Int64& rSignatureContentOffset); + sal_Int32 WriteSignatureObject(const OUString& rDescription, bool bAdES, sal_uInt64& rLastByteRangeOffset, sal_Int64& rSignatureContentOffset); /// Write the appearance object as part of signing. sal_Int32 WriteAppearanceObject(); /// Write the annot object as part of signing. @@ -162,7 +162,7 @@ public: /// Read elements from the start of the stream till its end. bool Read(SvStream& rStream); /// Sign the read document with xCertificate in the edit buffer. - bool Sign(const css::uno::Reference<css::security::XCertificate>& xCertificate, const OUString& rDescription); + bool Sign(const css::uno::Reference<css::security::XCertificate>& xCertificate, const OUString& rDescription, bool bAdES); /// Serializes the contents of the edit buffer. bool Write(SvStream& rStream); /// Get a list of signatures embedded into this document. diff --git a/xmlsecurity/inc/pdfsignaturehelper.hxx b/xmlsecurity/inc/pdfsignaturehelper.hxx index 55d8567cf8e9..7efdbfba421f 100644 --- a/xmlsecurity/inc/pdfsignaturehelper.hxx +++ b/xmlsecurity/inc/pdfsignaturehelper.hxx @@ -43,7 +43,7 @@ public: /// Comment / reason to be used next time signing is performed. void SetDescription(const OUString& rDescription); /// Append a new signature at the end of xInputStream. - bool Sign(const css::uno::Reference<css::io::XInputStream>& xInputStream); + bool Sign(const css::uno::Reference<css::io::XInputStream>& xInputStream, bool bAdES); /// Remove the signature at nPosition (and all dependent signatures) from xInputStream. static bool RemoveSignature(const css::uno::Reference<css::io::XInputStream>& xInputStream, sal_uInt16 nPosition); }; |