com.aspose.words

Class CertificateHolder

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

Represents a holder of X509Certificate2 instance.

CertificateHolder can be created by static factory methods only. It contains an instance of X509Certificate2 which is used to introduce private, public keys and certificate chains into the system. This class is applied in DigitalSignatureUtil and PdfDigitalSignatureDetails instead of obsolete methods with X509Certificate2 as parameters.

Property Getters/Setters Summary
System.Security.Cryptography.X509Certificates.X509Certificate2getCertificate()
Returns the instance of X509Certificate2Wrapper that holds X509Certificate2 which holds private, public keys and certificate chain.
 
Method Summary
static CertificateHoldercreate(byte[] certBytes, java.lang.String password)
Creates CertificateHolder object using byte array of PKCS12 store and its password.
static CertificateHoldercreate(java.lang.String fileName, java.lang.String password)
Creates CertificateHolder object using path to PKCS12 store and its password.
static CertificateHoldercreate(java.lang.String fileName, java.lang.String password, java.lang.String alias)
Creates CertificateHolder object using path to PKCS12 store, its password and the alias by using which private key and certificate will be found.
 

    • Property Getters/Setters Detail

      • getCertificate

        public System.Security.Cryptography.X509Certificates.X509Certificate2 getCertificate()
        
        Returns the instance of X509Certificate2Wrapper that holds X509Certificate2 which holds private, public keys and certificate chain.
        Returns:
        com.aspose.words.X509Certificate2Wrapper instance
    • Method Detail

      • create

        public static CertificateHolder create(byte[] certBytes, java.lang.String password)
                                            throws java.lang.Exception
        Creates CertificateHolder object using byte array of PKCS12 store and its password.
        Parameters:
        certBytes - A byte array that contains data from an X.509 certificate.
        password - The password required to access the X.509 certificate data.
        Returns:
        An instance of CertificateHolder
      • create

        public static CertificateHolder create(java.lang.String fileName, java.lang.String password)
                                            throws java.lang.Exception
        Creates CertificateHolder object using path to PKCS12 store and its password.
        Parameters:
        fileName - The name of a certificate file.
        password - The password required to access the X.509 certificate data.
        Returns:
        An instance of CertificateHolder
      • create

        public static CertificateHolder create(java.lang.String fileName, java.lang.String password, java.lang.String alias)
                                            throws java.lang.Exception
        Creates CertificateHolder object using path to PKCS12 store, its password and the alias by using which private key and certificate will be found.
        Parameters:
        fileName - The name of a certificate file.
        password - The password required to access the X.509 certificate data.
        alias - The associated alias for a certificate and its private key
        Returns:
        An instance of CertificateHolder