DigitalSignatureDetails
Inheritance: java.lang.Object
public class DigitalSignatureDetails
Contains details for signing a document with a digital signature.
Examples:
Shows how to sign OOXML document.
Document doc = new Document(getMyDir() + "Document.docx");
CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw");
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions();
SignOptions signOptions = new SignOptions();
signOptions.setComments("Some comments");
signOptions.setSignTime(new Date());
saveOptions.setDigitalSignatureDetails(new DigitalSignatureDetails(
certificateHolder,
signOptions));
doc.save(getArtifactsDir() + "OoxmlSaveOptions.DigitalSignature.docx", saveOptions);
Constructors
Constructor | Description |
---|---|
DigitalSignatureDetails(CertificateHolder certificateHolder, SignOptions signOptions) | Initializes a new instance of DigitalSignatureDetails class. |
Methods
Method | Description |
---|---|
getCertificateHolder() | Gets a getCertificateHolder() / setCertificateHolder(com.aspose.words.CertificateHolder) object that contains the certificate used to sign a document. |
getSignOptions() | Gets a getSignOptions() / setSignOptions(com.aspose.words.SignOptions) object used to sign a document. |
setCertificateHolder(CertificateHolder value) | Sets a getCertificateHolder() / setCertificateHolder(com.aspose.words.CertificateHolder) object that contains the certificate used to sign a document. |
setSignOptions(SignOptions value) | Sets a getSignOptions() / setSignOptions(com.aspose.words.SignOptions) object used to sign a document. |
DigitalSignatureDetails(CertificateHolder certificateHolder, SignOptions signOptions)
public DigitalSignatureDetails(CertificateHolder certificateHolder, SignOptions signOptions)
Initializes a new instance of DigitalSignatureDetails class.
Examples:
Shows how to sign OOXML document.
Document doc = new Document(getMyDir() + "Document.docx");
CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw");
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions();
SignOptions signOptions = new SignOptions();
signOptions.setComments("Some comments");
signOptions.setSignTime(new Date());
saveOptions.setDigitalSignatureDetails(new DigitalSignatureDetails(
certificateHolder,
signOptions));
doc.save(getArtifactsDir() + "OoxmlSaveOptions.DigitalSignature.docx", saveOptions);
Parameters:
Parameter | Type | Description |
---|---|---|
certificateHolder | CertificateHolder | A certificate holder which contains the certificate itself. |
signOptions | SignOptions | Signature options to use for signing a document. |
getCertificateHolder()
public CertificateHolder getCertificateHolder()
Gets a getCertificateHolder() / setCertificateHolder(com.aspose.words.CertificateHolder) object that contains the certificate used to sign a document.
Examples:
Shows how to sign OOXML document.
Document doc = new Document(getMyDir() + "Document.docx");
CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw");
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions();
SignOptions signOptions = new SignOptions();
signOptions.setComments("Some comments");
signOptions.setSignTime(new Date());
saveOptions.setDigitalSignatureDetails(new DigitalSignatureDetails(
certificateHolder,
signOptions));
doc.save(getArtifactsDir() + "OoxmlSaveOptions.DigitalSignature.docx", saveOptions);
Returns: CertificateHolder - A getCertificateHolder() / setCertificateHolder(com.aspose.words.CertificateHolder) object that contains the certificate used to sign a document.
getSignOptions()
public SignOptions getSignOptions()
Gets a getSignOptions() / setSignOptions(com.aspose.words.SignOptions) object used to sign a document.
Examples:
Shows how to sign OOXML document.
Document doc = new Document(getMyDir() + "Document.docx");
CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw");
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions();
SignOptions signOptions = new SignOptions();
signOptions.setComments("Some comments");
signOptions.setSignTime(new Date());
saveOptions.setDigitalSignatureDetails(new DigitalSignatureDetails(
certificateHolder,
signOptions));
doc.save(getArtifactsDir() + "OoxmlSaveOptions.DigitalSignature.docx", saveOptions);
Returns: SignOptions - A getSignOptions() / setSignOptions(com.aspose.words.SignOptions) object used to sign a document.
setCertificateHolder(CertificateHolder value)
public void setCertificateHolder(CertificateHolder value)
Sets a getCertificateHolder() / setCertificateHolder(com.aspose.words.CertificateHolder) object that contains the certificate used to sign a document.
Examples:
Shows how to sign OOXML document.
Document doc = new Document(getMyDir() + "Document.docx");
CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw");
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions();
SignOptions signOptions = new SignOptions();
signOptions.setComments("Some comments");
signOptions.setSignTime(new Date());
saveOptions.setDigitalSignatureDetails(new DigitalSignatureDetails(
certificateHolder,
signOptions));
doc.save(getArtifactsDir() + "OoxmlSaveOptions.DigitalSignature.docx", saveOptions);
Parameters:
Parameter | Type | Description |
---|---|---|
value | CertificateHolder | A getCertificateHolder() / setCertificateHolder(com.aspose.words.CertificateHolder) object that contains the certificate used to sign a document. |
setSignOptions(SignOptions value)
public void setSignOptions(SignOptions value)
Sets a getSignOptions() / setSignOptions(com.aspose.words.SignOptions) object used to sign a document.
Examples:
Shows how to sign OOXML document.
Document doc = new Document(getMyDir() + "Document.docx");
CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw");
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions();
SignOptions signOptions = new SignOptions();
signOptions.setComments("Some comments");
signOptions.setSignTime(new Date());
saveOptions.setDigitalSignatureDetails(new DigitalSignatureDetails(
certificateHolder,
signOptions));
doc.save(getArtifactsDir() + "OoxmlSaveOptions.DigitalSignature.docx", saveOptions);
Parameters:
Parameter | Type | Description |
---|---|---|
value | SignOptions | A getSignOptions() / setSignOptions(com.aspose.words.SignOptions) object used to sign a document. |