Class CrtToken

java.lang.Object
com.ibm.crypto.hdwrCCA.provider.CrtToken

public class CrtToken extends Object
This class maps an external RSA Private Key Token containing a Token Header, a RSA Private Key Section, and a RSA Public Key Section. Refer to the section on RSA Key Token Formats in the Cryptographic Services ICSF System Programmer's Guide for more information on formatting of the token.
  • Constructor Details

    • CrtToken

      public CrtToken(byte[] externalToken, byte[] internalToken)
      Constructor. Parse all fields of the RSA Private External Key Token.
      Parameters:
      externalToken - the RSA private external key token to parse
      internalToken - the internal token, not parsed and not required or supported
  • Method Details

    • getKeyFormatSecurityFromToken

      public byte getKeyFormatSecurityFromToken()
      Returns the "Key format and security" field value, in the RSA private key section of this RSA external token. Field offset within section is 28. 1 byte long.
      Returns:
      the "Key format and security" field value.
    • getPublicExponentFromToken

      public BigInteger getPublicExponentFromToken()
      Returns the public key exponent, e, in the RSA public key section of this RSA external token.
      Returns:
      the public key exponent, e.
    • generatePrivateCrtkey

      public PrivateKey generatePrivateCrtkey() throws Exception
      Generates and returns a JCE private key object that is constructed from this token's field values.
      Returns:
      the generated JCE RSAPrivateCrtKey object, or null if the private key is encrypted.
      Throws:
      IOException - if this is not a RSA Private External Key Token
      ProviderException - if unable to construct a RSA key from this RSA external token
      Exception