Provides methods for signing document.
Since digital signature works with file content rather than Document Object Model these methods are put into a separate class.
Supported formats are Doc and Docx.
Shows how to load signatures from a digitally signed document.
Shows how to remove digital signatures from a digitally signed document.
#include <Aspose.Words.Cpp/DigitalSignatures/DigitalSignatureUtil.h>
Public Member Functions | |
DigitalSignatureUtil ()=delete | |
Static Public Member Functions | |
static SharedPtr< DigitalSignatureCollection > | LoadSignatures (const SharedPtr< Stream > &stream) |
Loads digital signatures from document using stream. More... | |
static SharedPtr< DigitalSignatureCollection > | LoadSignatures (const String &fileName) |
Loads digital signatures from document. More... | |
template<typename CharType , typename Traits > | |
static SharedPtr< DigitalSignatureCollection > | LoadSignatures (std::basic_istream< CharType, Traits > &stream) |
static void | RemoveAllSignatures (const SharedPtr< Stream > &srcStream, const SharedPtr< Stream > &dstStream) |
Removes all digital signatures from document in source stream and writes unsigned document to destination stream. Output will be written to the start of stream and stream size will be updated with content length. More... | |
static void | RemoveAllSignatures (const String &srcFileName, const String &dstFileName) |
Removes all digital signatures from source file and writes unsigned file to destination file. More... | |
template<typename CharType , typename Traits > | |
static void | RemoveAllSignatures (std::basic_istream< CharType, Traits > &srcStream, std::basic_ostream< CharType, Traits > &dstStream) |
static void | Sign (const SharedPtr< Stream > &srcStream, const SharedPtr< Stream > &dstStream, const SharedPtr< CertificateHolder > &certHolder) |
Signs source document using given CertificateHolder with digital signature and writes signed document to destination stream. Document should be either Doc or Docx.Output will be written to the start of stream and stream size will be updated with content length. More... | |
static void | Sign (const SharedPtr< Stream > &srcStream, const SharedPtr< Stream > &dstStream, const SharedPtr< CertificateHolder > &certHolder, const SharedPtr< SignOptions > &signOptions) |
Signs source document using given CertificateHolder and SignOptions with digital signature and writes signed document to destination stream. Document should be either Doc or Docx.Output will be written to the start of stream and stream size will be updated with content length. More... | |
static void | Sign (const String &srcFileName, const String &dstFileName, const SharedPtr< CertificateHolder > &certHolder) |
Signs source document using given CertificateHolder with digital signature and writes signed document to destination file. Document should be either Doc or Docx. More... | |
static void | Sign (const String &srcFileName, const String &dstFileName, const SharedPtr< CertificateHolder > &certHolder, const SharedPtr< SignOptions > &signOptions) |
Signs source document using given CertificateHolder and SignOptions with digital signature and writes signed document to destination file. Document should be either Doc or Docx. More... | |
template<typename CharType , typename Traits > | |
static void | Sign (std::basic_istream< CharType, Traits > &srcStream, std::basic_ostream< CharType, Traits > &dstStream, SharedPtr< CertificateHolder > certHolder) |
template<typename CharType , typename Traits > | |
static void | Sign (std::basic_istream< CharType, Traits > &srcStream, std::basic_ostream< CharType, Traits > &dstStream, SharedPtr< CertificateHolder > certHolder, SharedPtr< SignOptions > signOptions) |
|
delete |
|
static |
Loads digital signatures from document using stream.
stream | Stream with the document. |
Shows how to load signatures from a digitally signed document.
|
static |
Loads digital signatures from document.
fileName | Path to the document. |
Shows how to load signatures from a digitally signed document.
Shows how to remove digital signatures from a digitally signed document.
|
inlinestatic |
|
static |
Removes all digital signatures from document in source stream and writes unsigned document to destination stream. Output will be written to the start of stream and stream size will be updated with content length.
Shows how to remove digital signatures from a digitally signed document.
|
static |
Removes all digital signatures from source file and writes unsigned file to destination file.
Shows how to remove digital signatures from a digitally signed document.
|
inlinestatic |
|
static |
Signs source document using given CertificateHolder with digital signature and writes signed document to destination stream. Document should be either Doc or Docx.Output will be written to the start of stream and stream size will be updated with content length.
srcStream | The stream which contains the document to sign. |
dstStream | The stream that signed document will be written to. |
certHolder | CertificateHolder object with certificate that used to sign file. The certificate in holder MUST contain private keys. |
Shows how to sign documents with X.509 certificates.
|
static |
Signs source document using given CertificateHolder and SignOptions with digital signature and writes signed document to destination stream. Document should be either Doc or Docx.Output will be written to the start of stream and stream size will be updated with content length.
srcStream | The stream which contains the document to sign. |
dstStream | The stream that signed document will be written to. |
certHolder | CertificateHolder object with certificate that used to sign file. The certificate in holder MUST contain private keys. |
signOptions | SignOptions object with various signing options. |
Shows how to digitally sign documents.
|
static |
Signs source document using given CertificateHolder with digital signature and writes signed document to destination file. Document should be either Doc or Docx.
srcFileName | The file name of the document to sign. |
dstFileName | The file name of the signed document output. |
certHolder | CertificateHolder object with certificate that used to sign file. The certificate in holder MUST contain private keys. |
Shows how to sign documents with X.509 certificates.
|
static |
Signs source document using given CertificateHolder and SignOptions with digital signature and writes signed document to destination file. Document should be either Doc or Docx.
srcFileName | The file name of the document to sign. |
dstFileName | The file name of the signed document output. |
certHolder | CertificateHolder object with certificate that used to sign file. The certificate in holder MUST contain private keys. |
signOptions | SignOptions object with various signing options. |
Shows how to add a signature line to a document, and then sign it using a digital certificate.
|
inlinestatic |
|
inlinestatic |