public final class SPKMKeyDeriver
extends java.lang.Object
It specifies the the derivation algorithm for a k-bit subkey as follows:
rightmost_k_bits(OWF(context_key || x || n || s || context_key))
where
Several APIs are provided that allow the key derivation to be carried out
using various message digest algorithm implementations as the OWF. The "x"
value corresponds to the subKeyType API parameter, which
indicates the the subkey algorithm type. For this parameter, the pre-defined
values SUB_KEY_ALGORITHM_CONFIDENTIALITY and
SUB_KEY_ALGORITHM_KEYED_INTEGRITY can be used. The "n" value
corresponds to the algorithmNumber API parameter, which
represents the number of the algorithm in the appropriate agreed list for the
context. For this parameter, use an integer (not a byte representing an ASCII
encoded character, this conversion will be done internally). The "s" value is
set and handled internally; it does not correspond to any API parameter.
| Modifier and Type | Field and Description |
|---|---|
static byte |
SUB_KEY_ALGORITHM_CONFIDENTIALITY
Indicates that the subkey is for a confidentiality algorithm; to be used
as a value for the 'x' algorithm parameter (the
subKeyType
parameter in the key derivation APIs). |
static byte |
SUB_KEY_ALGORITHM_KEYED_INTEGRITY
Indicates that the subkey is for a keyed integrity algorithm; to be used
as a value for the 'x' algorithm parameter (the
subKeyType
parameter in the key derivation APIs). |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
derive(byte[] contextKey,
byte subKeyType,
int algorithmNumber,
int subKeyLength,
java.security.MessageDigest messageDigest)
Derives a subkey according to the SPKM subkey derivation algorithm, using
the indicated message digest algorithm implementation as the OWF.
|
static byte[] |
derive(byte[] contextKey,
byte subKeyType,
int algorithmNumber,
int subKeyLength,
java.lang.String messageDigestAlgorithmName)
Derives a subkey according to the SPKM subkey derivation algorithm, using
the indicated message digest algorithm as the OWF.
|
static byte[] |
deriveUsingMD5(byte[] contextKey,
byte subKeyType,
int algorithmNumber,
int subKeyLength)
Derives a subkey according to the SPKM subkey derivation algorithm, using
the MD5 message digest algorithm implementation from the 'Entrust' JCA
cryptographic service provider as the OWF.
|
static byte[] |
deriveUsingSHA1(byte[] contextKey,
byte subKeyType,
int algorithmNumber,
int subKeyLength)
Derives a subkey according to the SPKM subkey derivation algorithm, using
the SHA-1 message digest algorithm implementation from the 'Entrust' JCA
cryptographic service provider as the OWF.
|
public static final byte SUB_KEY_ALGORITHM_CONFIDENTIALITY
subKeyType
parameter in the key derivation APIs).public static final byte SUB_KEY_ALGORITHM_KEYED_INTEGRITY
subKeyType
parameter in the key derivation APIs).public static byte[] derive(byte[] contextKey,
byte subKeyType,
int algorithmNumber,
int subKeyLength,
java.security.MessageDigest messageDigest)
contextKey - [FIPS 140-2 data input] [FIPS 140-2 CSP] the context keysubKeyType - [FIPS 140-2 data input] indicates the algorithm the subkey is
intended for ( SUB_KEY_ALGORITHM_CONFIDENTIALITY
indicates a confidentiality algorithm,
SUB_KEY_ALGORITHM_KEYED_INTEGRITY indicates a keyed
integrity algorithm)algorithmNumber - [FIPS 140-2 data input] an integer representing the number of
the algorithm in the appropriate agreed list for the context
(0, 1, 2, ...)subKeyLength - [FIPS 140-2 data input] the length of the subkey to be derived
in bytesmessageDigest - [FIPS 140-2 control input] the message digest algorithm
implementation to be used as the OWF during the key derivationFips140ErrorStateException - [FIPS 140-2 status output] thrown if the Toolkit is not
allowed to perform cryptographic operationspublic static byte[] derive(byte[] contextKey,
byte subKeyType,
int algorithmNumber,
int subKeyLength,
java.lang.String messageDigestAlgorithmName)
The message digest algorithm implementation is retrieved from the 'Entrust' JCA cryptographic service provider.
contextKey - [FIPS 140-2 data input] [FIPS 140-2 CSP] the context keysubKeyType - [FIPS 140-2 data input] indicates the algorithm the subkey is
intended for ( SUB_KEY_ALGORITHM_CONFIDENTIALITY
indicates a confidentiality algorithm,
SUB_KEY_ALGORITHM_KEYED_INTEGRITY indicates a keyed
integrity algorithm)algorithmNumber - [FIPS 140-2 data input] an integer representing the number of
the algorithm in the appropriate agreed list for the context
(0, 1, 2, ...)subKeyLength - [FIPS 140-2 data input] the length of the subkey to be derived
in bytesmessageDigestAlgorithmName - [FIPS 140-2 control input] the name of the message digest
algorithm to be used as the OWF function during the key
derivationjava.lang.SecurityException - [FIPS 140-2 status output] if the 'Entrust' JCA cryptographic
service provider is not installed or does not support the
requested algorithmFips140ErrorStateException - [FIPS 140-2 status output] thrown if the Toolkit is not
allowed to perform cryptographic operationspublic static byte[] deriveUsingSHA1(byte[] contextKey,
byte subKeyType,
int algorithmNumber,
int subKeyLength)
contextKey - [FIPS 140-2 data input] [FIPS 140-2 CSP] the context keysubKeyType - [FIPS 140-2 data input] indicates the algorithm the subkey is
intended for ( SUB_KEY_ALGORITHM_CONFIDENTIALITY
indicates a confidentiality algorithm,
SUB_KEY_ALGORITHM_KEYED_INTEGRITY indicates a keyed
integrity algorithm)algorithmNumber - [FIPS 140-2 data input] an integer representing the number of
the algorithm in the appropriate agreed list for the context
(0, 1, 2, ...)subKeyLength - [FIPS 140-2 data input] the length of the subkey to be derived
in bytesjava.lang.SecurityException - [FIPS 140-2 status output] if the 'Entrust' JCA cryptographic
service provider is not installedFips140ErrorStateException - [FIPS 140-2 status output] thrown if the Toolkit is not
allowed to perform cryptographic operationspublic static byte[] deriveUsingMD5(byte[] contextKey,
byte subKeyType,
int algorithmNumber,
int subKeyLength)
contextKey - [FIPS 140-2 data input] [FIPS 140-2 CSP] the context keysubKeyType - [FIPS 140-2 data input] indicates the algorithm the subkey is
intended for ( SUB_KEY_ALGORITHM_CONFIDENTIALITY
indicates a confidentiality algorithm,
SUB_KEY_ALGORITHM_KEYED_INTEGRITY indicates a keyed
integrity algorithm)algorithmNumber - [FIPS 140-2 data input] an integer representing the number of
the algorithm in the appropriate agreed list for the context
(0, 1, 2, ...)subKeyLength - [FIPS 140-2 data input] the length of the subkey to be derived
in bytesjava.lang.SecurityException - [FIPS 140-2 status output] if the 'Entrust' JCA cryptographic
service provider is not installedFips140ErrorStateException - [FIPS 140-2 status output] thrown if the Toolkit is not
allowed to perform cryptographic operations