[]
        
(Showing Draft Content)

ISignatureSet

Interface ISignatureSet

All Superinterfaces:
Iterable<ISignature>

public interface ISignatureSet extends Iterable<ISignature>
A collection of ISignature objects that correspond to the digital signatures attached to a document.

An ISignatureSet provides access to the signatures in a workbook, including signature lines and non-visible signatures.


 ISignatureSet signatures = workbook.getSignatures();
 ISignature signature = signatures.addSignatureLine(worksheet, 100.0, 50.0);
 ISignature firstSignature = signatures.get(0);
 int count = signatures.getCount();
 
  • Method Details

    • getCanAddSignatureLine

      boolean getCanAddSignatureLine()
      Gets a Boolean value indicating whether you can add a signature line to a document. Read-only.

      This property returns false if the workbook is already signed.

      
       ISignatureSet signatures = workbook.getSignatures();
       boolean canAddSignatureLine = signatures.getCanAddSignatureLine();
       
      Returns:
      true if a signature line can be added to the document; otherwise, false.
    • getParent

      IWorkbook getParent()
      Returns the workbook that contains this ISignatureSet.
      
       ISignatureSet signatures = workbook.getSignatures();
       IWorkbook parent = signatures.getParent();
       ISignatureSet parentSignatures = parent.getSignatures();
       
      Returns:
      The workbook that contains this ISignatureSet.
    • addNonVisibleSignature

      ISignature addNonVisibleSignature()
      Creates a signature packet when digitally signing a document.

      Use this method to add a non-visible signature to the workbook's ISignatureSet. Unlike addSignatureLine(IWorksheet,double,double), the returned signature is not associated with a visible signature line in a worksheet. The signature will be discarded if you save the workbook without signing it.

      
       ISignature signature = workbook.getSignatures().addNonVisibleSignature();
       boolean isSignatureLine = signature.getIsSignatureLine();
       ISignatureSet signatures = signature.getParent();
       
      Returns:
      The created non-visible ISignature.
    • addSignatureLine

      ISignature addSignatureLine(IWorksheet worksheet, double left, double top, double width)
      Adds a signature line to a document where signatures are collected.

      Only the "Microsoft Office signature line" is supported. Other signature line providers, such as stamp signatures, are not supported. This overload adds the signature line shape to the specified worksheet with the specified width, and passes 100.5 as the height to addSignatureLine(IWorksheet,double,double,double,double).

      
       ISignature signature = workbook.getSignatures().addSignatureLine(worksheet, 100.0, 50.0, 200.0);
       ISignatureSetup setup = signature.getSetup();
       setup.setSuggestedSigner("Test User");
       
      Parameters:
      worksheet - The worksheet that the signature line shape will be added to. Must not be null.
      left - The left position of the signature line shape.
      top - The top position of the signature line shape.
      width - The width of the signature line shape.
      Returns:
      The created ISignature object.
      Throws:
      IllegalStateException - if the workbook is in digital signature only mode.
    • addSignatureLine

      ISignature addSignatureLine(IWorksheet worksheet, double left, double top)
      Adds a signature line to a document where signatures are collected.

      Only the "Microsoft Office signature line" is supported. Other signature line providers, such as stamp signatures, are not supported.

      This overload forwards to addSignatureLine(IWorksheet,double,double,double,double) with a width of 192 and a height of 100.5.

      
       ISignature signature = workbook.getSignatures().addSignatureLine(worksheet, 100.0, 50.0);
       ISignatureSetup setup = signature.getSetup();
       setup.setSuggestedSigner("John Williams");
       setup.setSigningInstructions("Please review and sign this worksheet.");
       
      Parameters:
      worksheet - The worksheet to which the signature line shape is added.
      left - The left position of the signature line shape.
      top - The top position of the signature line shape.
      Returns:
      The created ISignature object.
    • addSignatureLine

      ISignature addSignatureLine(IWorksheet worksheet, double left, double top, double width, double height)
      Adds a signature line to a worksheet where signatures are collected.

      Only the Microsoft Office signature line is supported. Other signature line providers, such as stamp signatures, are not supported.

      After the signature line is created, you can use ISignatureSetup to specify signer information and signing instructions.

      
       ISignature signature = workbook.getSignatures().addSignatureLine(worksheet, 100.0, 50.0, 192.0, 100.5);
       ISignatureSetup setup = signature.getSetup();
       setup.setSuggestedSigner("Shinzo Nagama");
       setup.setSigningInstructions("Please check the content before signing.");
       
      Parameters:
      worksheet - The worksheet to which the signature line shape is added.
      left - The distance, in points, from the left edge of the worksheet to the signature line shape.
      top - The distance, in points, from the top edge of the worksheet to the signature line shape.
      width - The width, in points, of the signature line shape.
      height - The height, in points, of the signature line shape.
      Returns:
      The created ISignature object.
    • getSkipCertificateValidationOnExporting

      boolean getSkipCertificateValidationOnExporting()
      Gets whether the validation of the attached digital certificate of the signed signature should be skipped when exporting signed signatures.

      The default value is true. If certificate validation is skipped, the certificate is treated as valid. This is the default behavior. Otherwise, the certificate is validated with an X.509 chain.

      
       ISignatureSet signatures = workbook.getSignatures();
       signatures.setSkipCertificateValidationOnExporting(false);
       boolean skipCertificateValidation = signatures.getSkipCertificateValidationOnExporting();
       
      Returns:
      true if certificate validation is skipped when exporting signed signatures; otherwise, false if the certificate is validated with an X.509 chain.
    • setSkipCertificateValidationOnExporting

      void setSkipCertificateValidationOnExporting(boolean value)
      Sets whether the validation of the attached digital certificate of the signed signature should be skipped when exporting signed signatures.

      The default value is true. If certificate validation is skipped, the certificate is treated as valid. This is the default behavior. Otherwise, the certificate is validated with an X.509 chain.

      
       ISignatureSet signatures = workbook.getSignatures();
       signatures.setSkipCertificateValidationOnExporting(false);
       
      Parameters:
      value - true if certificate validation is skipped when exporting signed signatures; otherwise, false if the certificate is validated with an X.509 chain.
    • getCount

      int getCount()
      Gets the number of signatures in the signature set.
      
       ISignatureSet signatures = workbook.getSignatures();
       signatures.addNonVisibleSignature();
       int count = signatures.getCount();
       
      Returns:
      The number of signatures.
    • get

      ISignature get(int index)
      Gets the signature at the specified index in the signature set.

      Use this method to retrieve a signature that was added to the workbook's signature set, including a signature line or a non-visible signature.

      
       ISignatureSet signatures = workbook.getSignatures();
       signatures.addSignatureLine(worksheet, 100.0, 50.0);
       ISignature signature = signatures.get(0);
       ISignatureSetup setup = signature.getSetup();
       
      Parameters:
      index - The index of the signature.
      Returns:
      The signature at the specified index.