summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorGökçen Eraslan <gokcen.eraslan@gmail.com>2012-07-07 23:10:30 +0300
committerGökçen Eraslan <gokcen.eraslan@gmail.com>2012-07-07 23:10:30 +0300
commit5f995a0d8ffea95bf6eecf5215da8178159be0ca (patch)
treea0f5cf465a3ecdb8151b25f1008e6d8dbc68897f /vcl
parentbb1ba4f3b784b1ad8776319d6336dba97e484d59 (diff)
Add password edit and pass XCertificate to PDFWriter code in VCL.
Now, we have the password of private key and the certificate to sign. Ready to use NSS and create necessary PKCS7 object using these. Change-Id: Id69487e92283059fcd558d33cf6a6128df0f50d9
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/vcl/pdfwriter.hxx6
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx2
2 files changed, 7 insertions, 1 deletions
diff --git a/vcl/inc/vcl/pdfwriter.hxx b/vcl/inc/vcl/pdfwriter.hxx
index 535c2b39034c..0e93cdd9c6a1 100644
--- a/vcl/inc/vcl/pdfwriter.hxx
+++ b/vcl/inc/vcl/pdfwriter.hxx
@@ -41,6 +41,7 @@
#include "com/sun/star/io/XOutputStream.hpp"
#include "com/sun/star/beans/XMaterialHolder.hpp"
+#include "com/sun/star/security/XCertificate.hpp"
#include "com/sun/star/lang/Locale.hpp"
#include <boost/scoped_ptr.hpp>
@@ -631,8 +632,10 @@ The following structure describes the permissions used in PDF security
bool SignPDF;
rtl::OUString SignLocation;
+ rtl::OUString SignPassword;
rtl::OUString SignReason;
rtl::OUString SignContact;
+ com::sun::star::uno::Reference< com::sun::star::security::XCertificate> SignCertificate;
com::sun::star::lang::Locale DocumentLocale; // defines the document default language
sal_uInt32 DPIx, DPIy; // how to handle MapMode( MAP_PIXEL )
@@ -668,7 +671,8 @@ The following structure describes the permissions used in PDF security
SignPDF( false ),
DPIx( 0 ),
DPIy( 0 ),
- ColorMode( PDFWriter::DrawColor )
+ ColorMode( PDFWriter::DrawColor ),
+ SignCertificate( 0 )
{}
};
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 64382716ab0a..16f2a0de08dd 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6175,6 +6175,8 @@ bool PDFWriterImpl::finalizeSignature()
}
// 3- create the PKCS#7 object using NSS
+ // use m_aContext.SignCertificate and m_aContext.SignPassword as certificate and private key password
+ // SignCertificate->getEncoded is DER encoded certificate
// 4- overwrite the PKCS7 content to the m_nSignatureContentOffset
CHECK_RETURN( (osl_File_E_None == osl_setFilePos( m_aFile, osl_Pos_Absolut, m_nSignatureContentOffset ) ) );