summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2015-02-17 10:35:54 +0200
committerAndras Timar <andras.timar@collabora.com>2015-03-05 16:50:55 +0100
commit46868c9eebc5909f40f813414d74b9b5ea484a99 (patch)
tree190c3c88b3da79acc6483195064406e245969dd5
parentc9a6547e5daa9ac8b47eb955af5399653b6c84c0 (diff)
tdf#88431: Pass the selected Time Stamp Authority, if any, along to vcl
Work in progress. If a TSA is selected, pass it along to the signature generation in vcl. Change-Id: Ibe105b6d02ab9241b93dd66ab3cb1fa8c6d10093 (cherry picked from commit d83e6e9cdb727b3ca2938048e115ba38886d4c70)
-rw-r--r--filter/source/pdf/impdialog.cxx11
-rw-r--r--filter/source/pdf/impdialog.hxx1
-rw-r--r--filter/source/pdf/pdfexport.cxx3
-rw-r--r--filter/source/pdf/pdfexport.hxx1
-rw-r--r--include/vcl/pdfwriter.hxx1
5 files changed, 15 insertions, 2 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 7cffddd06350..63e446f36fa0 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -433,7 +433,8 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() );
- int nElementAdded = 11;
+ // OMG, this is horrible coding style...
+ int nElementAdded = 12;
aRet.realloc( aRet.getLength() + nElementAdded );
@@ -497,6 +498,10 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
aRet[ nLength - nElementAdded ].Value <<= maSignCertificate;
nElementAdded--;
+ aRet[ nLength - nElementAdded ].Name = "SignatureTSA";
+ aRet[ nLength - nElementAdded ].Value <<= msSignTSA;
+ nElementAdded--;
+
return aRet;
}
@@ -1598,7 +1603,9 @@ void ImpPDFTabSigningPage::GetFilterConfigItem( ImpPDFTabDialog* paParent )
paParent->msSignPassword = mpEdSignPassword->GetText();
paParent->msSignContact = mpEdSignContactInfo->GetText();
paParent->msSignReason = mpEdSignReason->GetText();
-
+ // Entry 0 is 'None'
+ if (mpLBSignTSA->GetSelectEntryPos() >= 1)
+ paParent->msSignTSA = mpLBSignTSA->GetSelectEntry();
}
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index c8a317b2b920..c6238ea3de02 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -153,6 +153,7 @@ protected:
OUString msSignContact;
OUString msSignReason;
com::sun::star::uno::Reference< com::sun::star::security::XCertificate > maSignCertificate;
+ OUString msSignTSA;
OUString maWatermarkText;
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 164eff9cd2de..ae396a4ac0ac 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -557,6 +557,8 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
rFilterData[ nData ].Value >>= msSignPassword;
else if ( rFilterData[ nData ].Name == "SignatureCertificate" )
rFilterData[ nData ].Value >>= maSignCertificate;
+ else if ( rFilterData[ nData ].Name == "SignatureTSA" )
+ rFilterData[ nData ].Value >>= msSignTSA;
}
aContext.URL = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI);
@@ -788,6 +790,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
aContext.SignReason = msSignReason;
aContext.SignPassword = msSignPassword;
aContext.SignCertificate = maSignCertificate;
+ aContext.SignTSA = msSignTSA;
// all context data set, time to create the printing device
boost::scoped_ptr<PDFWriter> pPDFWriter(new PDFWriter( aContext, xEnc ));
diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx
index 38a050d0d759..5123bdc6c897 100644
--- a/filter/source/pdf/pdfexport.hxx
+++ b/filter/source/pdf/pdfexport.hxx
@@ -108,6 +108,7 @@ private:
OUString msSignReason;
OUString msSignPassword;
Reference< security::XCertificate > maSignCertificate;
+ OUString msSignTSA;
void ImplWriteWatermark( ::vcl::PDFWriter& rWriter, const Size& rPageSize );
public:
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 9357c91aa4ff..4fc40b57f8d9 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -631,6 +631,7 @@ The following structure describes the permissions used in PDF security
// 0 here specifies a default handling
PDFWriter::ColorMode ColorMode;
com::sun::star::uno::Reference< com::sun::star::security::XCertificate> SignCertificate;
+ OUString SignTSA;
PDFWriterContext() :
RelFsys( false ), //i56629, i49415?, i64585?