Class JCECredentials

  • All Implemented Interfaces:
    Credentials

    public class JCECredentials
    extends java.lang.Object
    implements Credentials
    JCE Credentials with JDK1.5 HSM support.
    • Constructor Summary

      Constructors 
      Constructor Description
      JCECredentials​(PrivateKeyHolder keyHolder, byte[] derEncodedCert, byte[][] derEncodedCertChain)  
      JCECredentials​(PrivateKeyHolder keyHolder, java.security.cert.X509Certificate cert, java.security.cert.Certificate[] certChain)  
      JCECredentials​(java.security.PrivateKey privateKey, java.security.cert.X509Certificate cert, java.security.cert.Certificate[] certChain)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.security.cert.X509Certificate getCertificate()
      Gets the x509 certificate associated with this credential.
      java.security.cert.Certificate[] getCertificateChain()
      Gets the certificate chain associated with this credential.
      java.security.PrivateKey getPrivateKey()
      Gets the private key associate with this credential.
      java.security.Provider getProvider()
      Get a Security Provider for the private key
      java.lang.String getProviderName()
      Get the name of the key Provider
      boolean isHSM()  
      void setHSM​(boolean isHSM)  
      void setProviderName​(java.lang.String providerName)  
      • Methods inherited from class java.lang.Object

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

      • JCECredentials

        public JCECredentials​(java.security.PrivateKey privateKey,
                              java.security.cert.X509Certificate cert,
                              java.security.cert.Certificate[] certChain)
      • JCECredentials

        public JCECredentials​(PrivateKeyHolder keyHolder,
                              java.security.cert.X509Certificate cert,
                              java.security.cert.Certificate[] certChain)
                       throws java.security.NoSuchAlgorithmException,
                              java.security.spec.InvalidKeySpecException,
                              PDFInvalidParameterException
        Throws:
        java.security.NoSuchAlgorithmException
        java.security.spec.InvalidKeySpecException
        PDFInvalidParameterException
    • Method Detail

      • setProviderName

        public void setProviderName​(java.lang.String providerName)
      • setHSM

        public void setHSM​(boolean isHSM)
      • getPrivateKey

        public java.security.PrivateKey getPrivateKey()
        Gets the private key associate with this credential.
        Returns:
        PrivateKey
      • getProviderName

        public java.lang.String getProviderName()
        Get the name of the key Provider
        Returns:
        String
      • getProvider

        public java.security.Provider getProvider()
        Get a Security Provider for the private key
        Returns:
        java.security.Provider
      • getCertificate

        public java.security.cert.X509Certificate getCertificate()
        Gets the x509 certificate associated with this credential.
        Returns:
        X509Certificate
      • getCertificateChain

        public java.security.cert.Certificate[] getCertificateChain()
        Gets the certificate chain associated with this credential. This method is useful when client already have an ordered certificate chain.
        Returns:
        Certificate[]