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

ConstructorDescription
DigitalSignatureDetails(CertificateHolder certificateHolder, SignOptions signOptions)Initializes a new instance of DigitalSignatureDetails class.

Methods

MethodDescription
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:

ParameterTypeDescription
certificateHolderCertificateHolderA certificate holder which contains the certificate itself.
signOptionsSignOptionsSignature 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:

ParameterTypeDescription
valueCertificateHolderA 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:

ParameterTypeDescription
valueSignOptionsA getSignOptions() / setSignOptions(com.aspose.words.SignOptions) object used to sign a document.