Class PrivateKeyHolderFactory


  • public class PrivateKeyHolderFactory
    extends java.lang.Object
    PrivateKeyHolderFactory creates a PrivateKey that can be used to create the appropriate Gibson Credentials. PrivateKeys can be constructed from a set of bytes representing the key and the key wrapping format, or can be an HSM private key that contains a JSAFE Session Spec and a JSAFEPrivate key, or a JCE private key. *
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      PrivateKeyHolder createPrivateKey​(byte[] derEncodedPrivateKey, java.lang.String algorithm)
      Creates a PrivateKeyHolder containing bytes representing the DER encoded PKCS8 unencrypted private key and the key wrapping format.
      PrivateKeyHolder createPrivateKey​(java.security.PrivateKey privateKey, java.lang.String providerName)
      Creates a PrivateKeyHolder that contains a JCE PrivateKey and a provider name.
      static PrivateKeyHolderFactory newInstance()
      Creates a new instance of the PrivateKeyHolderFactory.
      • Methods inherited from class java.lang.Object

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

      • newInstance

        public static PrivateKeyHolderFactory newInstance()
        Creates a new instance of the PrivateKeyHolderFactory.
      • createPrivateKey

        public PrivateKeyHolder createPrivateKey​(byte[] derEncodedPrivateKey,
                                                 java.lang.String algorithm)
        Creates a PrivateKeyHolder containing bytes representing the DER encoded PKCS8 unencrypted private key and the key wrapping format.
        Parameters:
        derEncodedPrivateKey -
        algorithm - - representing the wrapping format of the key - RSA/DSA
        Returns:
        PrivateKeyHolder
      • createPrivateKey

        public PrivateKeyHolder createPrivateKey​(java.security.PrivateKey privateKey,
                                                 java.lang.String providerName)
        Creates a PrivateKeyHolder that contains a JCE PrivateKey and a provider name.
        Parameters:
        privateKey -
        providerName - (Optional) Pass in if HSM provider or a specific provider has the private key
        Returns:
        PrivateKeyHolder