LibreOffice Module xmlsecurity (master) 1
|
Handles signatures of a PDF file. More...
#include <pdfsignaturehelper.hxx>
Public Member Functions | |
PDFSignatureHelper () | |
bool | ReadAndVerifySignature (const css::uno::Reference< css::io::XInputStream > &xInputStream) |
bool | ReadAndVerifySignatureSvStream (SvStream &rStream) |
css::uno::Sequence< css::security::DocumentSignatureInformation > | GetDocumentSignatureInformations (const css::uno::Reference< css::xml::crypto::XSecurityEnvironment > &xSecEnv) const |
SignatureInformations const & | GetSignatureInformations () const |
sal_Int32 | GetNewSecurityId () const |
Return the ID of the next created signature. More... | |
void | SetX509Certificate (const css::uno::Reference< css::security::XCertificate > &xCertificate) |
Certificate to be used next time signing is performed. More... | |
void | SetDescription (const OUString &rDescription) |
Comment / reason to be used next time signing is performed. More... | |
bool | Sign (const css::uno::Reference< css::frame::XModel > &xModel, const css::uno::Reference< css::io::XInputStream > &xInputStream, bool bAdES) |
Append a new signature at the end of xInputStream. More... | |
Static Public Member Functions | |
static bool | RemoveSignature (const css::uno::Reference< css::io::XInputStream > &xInputStream, sal_uInt16 nPosition) |
Remove the signature at nPosition (and all dependent signatures) from xInputStream. More... | |
Private Attributes | |
SignatureInformations | m_aSignatureInfos |
css::uno::Reference< css::security::XCertificate > | m_xCertificate |
OUString | m_aDescription |
Handles signatures of a PDF file.
Definition at line 43 of file pdfsignaturehelper.hxx.
|
default |
uno::Sequence< security::DocumentSignatureInformation > PDFSignatureHelper::GetDocumentSignatureInformations | ( | const css::uno::Reference< css::xml::crypto::XSecurityEnvironment > & | xSecEnv | ) | const |
sal_Int32 PDFSignatureHelper::GetNewSecurityId | ( | ) | const |
Return the ID of the next created signature.
Definition at line 537 of file pdfsignaturehelper.cxx.
References m_aSignatureInfos.
Referenced by DocumentSignatureManager::add().
SignatureInformations const & PDFSignatureHelper::GetSignatureInformations | ( | ) | const |
Definition at line 491 of file pdfsignaturehelper.cxx.
References m_aSignatureInfos.
Referenced by DocumentSignatureManager::read().
bool PDFSignatureHelper::ReadAndVerifySignature | ( | const css::uno::Reference< css::io::XInputStream > & | xInputStream | ) |
Definition at line 411 of file pdfsignaturehelper.cxx.
References utl::UcbStreamHelper::CreateStream(), ReadAndVerifySignatureSvStream(), and SAL_WARN.
bool PDFSignatureHelper::ReadAndVerifySignatureSvStream | ( | SvStream & | rStream | ) |
Definition at line 424 of file pdfsignaturehelper.cxx.
References vcl::pdf::PDFiumLibrary::get(), SvMemoryStream::GetData(), SvMemoryStream::GetSize(), i, m_aSignatureInfos, nPos, SAL_WARN, SvStream::Seek(), Signature, SvStream::Tell(), and SvStream::WriteStream().
Referenced by ReadAndVerifySignature().
|
static |
Remove the signature at nPosition (and all dependent signatures) from xInputStream.
Definition at line 591 of file pdfsignaturehelper.cxx.
References aDocument, utl::UcbStreamHelper::CreateStream(), SAL_WARN, and xStream.
Referenced by DocumentSignatureManager::remove().
void PDFSignatureHelper::SetDescription | ( | const OUString & | rDescription | ) |
Comment / reason to be used next time signing is performed.
Definition at line 545 of file pdfsignaturehelper.cxx.
References m_aDescription.
Referenced by DocumentSignatureManager::add().
void PDFSignatureHelper::SetX509Certificate | ( | const css::uno::Reference< css::security::XCertificate > & | xCertificate | ) |
Certificate to be used next time signing is performed.
Definition at line 539 of file pdfsignaturehelper.cxx.
References m_xCertificate.
Referenced by DocumentSignatureManager::add().
bool PDFSignatureHelper::Sign | ( | const css::uno::Reference< css::frame::XModel > & | xModel, |
const css::uno::Reference< css::io::XInputStream > & | xInputStream, | ||
bool | bAdES | ||
) |
Append a new signature at the end of xInputStream.
Definition at line 550 of file pdfsignaturehelper.cxx.
References aDocument, utl::UcbStreamHelper::CreateStream(), m_aDescription, m_xCertificate, SAL_WARN, xModel, and xStream.
|
private |
Definition at line 48 of file pdfsignaturehelper.hxx.
Referenced by SetDescription(), and Sign().
|
private |
Definition at line 45 of file pdfsignaturehelper.hxx.
Referenced by GetDocumentSignatureInformations(), GetNewSecurityId(), GetSignatureInformations(), and ReadAndVerifySignatureSvStream().
|
private |
Definition at line 47 of file pdfsignaturehelper.hxx.
Referenced by SetX509Certificate(), and Sign().