com.aspose.words

Class SignatureLine

  • java.lang.Object
    • com.aspose.words.SignatureLine
public class SignatureLine 
extends java.lang.Object

Provides access to signature line properties.

Property Getters/Setters Summary
booleangetAllowComments()
void
setAllowComments(booleanvalue)
           Gets or sets a value indicating that the signer can add comments in the Sign dialog. Default value for this property is false.
booleangetDefaultInstructions()
void
           Gets or sets a value indicating that default instructions is shown in the Sign dialog. Default value for this property is true.
java.lang.StringgetEmail()
void
setEmail(java.lang.Stringvalue)
           Gets or sets suggested signer's e-mail address. Default value for this property is empty string.
java.util.UUIDgetId()
void
setId(java.util.UUIDvalue)
           Gets or sets identifier for this signature line.

This identifier can be associated with a digital signature, when signing document using DigitalSignatureUtil. This value must be unique and by default it is randomly generated new Guid.

java.lang.StringgetInstructions()
void
setInstructions(java.lang.Stringvalue)
           Gets or sets instructions to the signer that are displayed on signing the signature line. This property is ignored if DefaultInstructions is set. Default value for this property is empty string.
booleanisSigned()
Indicates that signature line is signed by digital signature.
booleanisValid()
Indicates that signature line is signed by digital signature and this digital signature is valid.
java.util.UUIDgetProviderId()
void
setProviderId(java.util.UUIDvalue)
           Gets or sets signature provider identifier for this signature line. Default value is "{00000000-0000-0000-0000-000000000000}".
booleangetShowDate()
void
setShowDate(booleanvalue)
           Gets or sets a value indicating that sign date is shown in the signature line. Default value for this property is true.
java.lang.StringgetSigner()
void
setSigner(java.lang.Stringvalue)
           Gets or sets suggested signer of the signature line. Default value for this property is empty string.
java.lang.StringgetSignerTitle()
void
setSignerTitle(java.lang.Stringvalue)
           Gets or sets suggested signer's title (for example, Manager). Default value for this property is empty string.
 

    • Property Getters/Setters Detail

      • getAllowComments/setAllowComments

        public boolean getAllowComments() / public void setAllowComments(boolean value)
        
        Gets or sets a value indicating that the signer can add comments in the Sign dialog. Default value for this property is false.
      • getDefaultInstructions/setDefaultInstructions

        public boolean getDefaultInstructions() / public void setDefaultInstructions(boolean value)
        
        Gets or sets a value indicating that default instructions is shown in the Sign dialog. Default value for this property is true.
      • getEmail/setEmail

        public java.lang.String getEmail() / public void setEmail(java.lang.String value)
        
        Gets or sets suggested signer's e-mail address. Default value for this property is empty string.
      • getId/setId

        public java.util.UUID getId() / public void setId(java.util.UUID value)
        
        Gets or sets identifier for this signature line.

        This identifier can be associated with a digital signature, when signing document using DigitalSignatureUtil. This value must be unique and by default it is randomly generated new Guid.

      • getInstructions/setInstructions

        public java.lang.String getInstructions() / public void setInstructions(java.lang.String value)
        
        Gets or sets instructions to the signer that are displayed on signing the signature line. This property is ignored if DefaultInstructions is set. Default value for this property is empty string.
      • isSigned

        public boolean isSigned()
        
        Indicates that signature line is signed by digital signature.
      • isValid

        public boolean isValid()
        
        Indicates that signature line is signed by digital signature and this digital signature is valid.
      • getProviderId/setProviderId

        public java.util.UUID getProviderId() / public void setProviderId(java.util.UUID value)
        
        Gets or sets signature provider identifier for this signature line. Default value is "{00000000-0000-0000-0000-000000000000}".

        The cryptographic service provider (CSP) is an independent software module that actually performs cryptography algorithms for authentication, encoding, and encryption. MS Office reserves the value of {00000000-0000-0000-0000-000000000000} for its default signature provider.

        The GUID of the additionally installed provider should be obtained from the documentation shipped with the provider.

        In addition, all the installed cryptographic providers are enumerated in windows registry. It can be found in the following path: HKLM\SOFTWARE\Microsoft\Cryptography\Defaults\Provider. There is a key name "CP Service UUID" which corresponds to a GUID of signature provider.

        Example:

        Shows how to sign document with personal certificate and specific signatire line.
        Document doc = new Document();
        DocumentBuilder builder = new DocumentBuilder(doc);
        
        SignatureLineOptions signatureLineOptions = new SignatureLineOptions();
        signatureLineOptions.setSigner("vderyushev");
        signatureLineOptions.setSignerTitle("QA");
        signatureLineOptions.setEmail("vderyushev@aspose.com");
        signatureLineOptions.setShowDate(true);
        signatureLineOptions.setDefaultInstructions(false);
        signatureLineOptions.setInstructions("You need more info about signature line");
        signatureLineOptions.setAllowComments(true);
        
        SignatureLine signatureLine = builder.insertSignatureLine(signatureLineOptions).getSignatureLine();
        signatureLine.setProviderId(UUID.fromString("CF5A7BB4-8F3C-4756-9DF6-BEF7F13259A2"));
        
        doc.save(getMyDir() + "\\Artifacts\\DocumentBuilder.SignatureLineProviderId In.docx");
        
        SignOptions signOptions = new SignOptions();
        signOptions.setSignatureLineId(signatureLine.getId());
        signOptions.setProviderId(signatureLine.getProviderId());
        signOptions.setComments("Document was signed by vderyushev");
        signOptions.setSignTime(new Date());
        
        CertificateHolder certHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw");
        
        DigitalSignatureUtil.sign(getMyDir() + "\\Artifacts\\DocumentBuilder.SignatureLineProviderId In.docx", getMyDir() + "\\Artifacts\\DocumentBuilder.SignatureLineProviderId Out.docx", certHolder, signOptions);
      • getShowDate/setShowDate

        public boolean getShowDate() / public void setShowDate(boolean value)
        
        Gets or sets a value indicating that sign date is shown in the signature line. Default value for this property is true.
      • getSigner/setSigner

        public java.lang.String getSigner() / public void setSigner(java.lang.String value)
        
        Gets or sets suggested signer of the signature line. Default value for this property is empty string.
      • getSignerTitle/setSignerTitle

        public java.lang.String getSignerTitle() / public void setSignerTitle(java.lang.String value)
        
        Gets or sets suggested signer's title (for example, Manager). Default value for this property is empty string.