com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Class DigitalSignature

  • java.lang.Object
    • com.aspose.slides.DigitalSignature
    • Constructor Summary

      Constructors 
      Constructor and Description
      DigitalSignature(byte[] certData, java.lang.String password)
      Creates a new DigitalSignature object with the specified certificate.
      DigitalSignature(java.lang.String filePath, java.lang.String password)
      Creates a new DigitalSignature object with the specified certificate file path and password.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      byte[] getCertificate()
      Certificate object that was used to sign the document.
      java.lang.String getComments()
      The purpose of signature.
      java.util.Date getSignTime()
      The time when the document was signed.
      boolean isValid()
      If this digital signature is valid and the document has not been tampered with, this value will be true.
      void setComments(java.lang.String value)
      The purpose of signature.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DigitalSignature

        public DigitalSignature(byte[] certData,
                                java.lang.String password)

        Creates a new DigitalSignature object with the specified certificate.

        Parameters:
        certData - a byte array containing the certificate
        password - Password required to access certificate.
      • DigitalSignature

        public DigitalSignature(java.lang.String filePath,
                                java.lang.String password)

        Creates a new DigitalSignature object with the specified certificate file path and password.

        Parameters:
        filePath - Path to the file with certificate.
        password - Password required to access certificate.
    • Method Detail

      • getCertificate

        public final byte[] getCertificate()

        Certificate object that was used to sign the document. Read-only byte[].

        Specified by:
        getCertificate in interface IDigitalSignature
      • isValid

        public final boolean isValid()

        If this digital signature is valid and the document has not been tampered with, this value will be true. Read-only boolean.


         
         Presentation pres = new Presentation("SomePresentationSigned.pptx");
         try
         {
             for (IDigitalSignature signature : pres.getDigitalSignatures())
                 System.out.println("Signature check: " + (signature.isValid() ? "VALID" : "INVALID"));
         } finally {
             if (pres != null) pres.dispose();
         }
         
        Specified by:
        isValid in interface IDigitalSignature
      • getSignTime

        public final java.util.Date getSignTime()

        The time when the document was signed. Read-only Date.


         
         Presentation pres = new Presentation("SomePresentationSigned.pptx");
         try
         {
             for (IDigitalSignature signature : pres.getDigitalSignatures())
                 System.out.println("Signature check: " + (signature.isValid() ? "VALID" : "INVALID") + ", Signing time: " + signature.getSignTime());
         } finally {
             if (pres != null) pres.dispose();
         }
         
        Specified by:
        getSignTime in interface IDigitalSignature
      • getComments

        public final java.lang.String getComments()

        The purpose of signature. Read/write String.

        Specified by:
        getComments in interface IDigitalSignature
      • setComments

        public final void setComments(java.lang.String value)

        The purpose of signature. Read/write String.

        Specified by:
        setComments in interface IDigitalSignature