java.lang.Object
com.ibm.crypto.hdwrCCA.provider.CrtToken
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGenerates and returns a JCE private key object that is constructed from this token's field values.byte
Returns the "Key format and security" field value, in the RSA private key section of this RSA external token.Returns the public key exponent, e, in the RSA public key section of this RSA external 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 parseinternalToken
- 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
Returns the public key exponent, e, in the RSA public key section of this RSA external token.- Returns:
- the public key exponent, e.
-
generatePrivateCrtkey
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 TokenProviderException
- if unable to construct a RSA key from this RSA external tokenException
-