KeyBuilder (Java Card API, Connected Edition)
Date: 2009-12-11

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javacard.security
Class KeyBuilder

    java.lang.Object
      javacard.security.KeyBuilder

    @TransactionType(value=SUPPORTS)
    public class KeyBuilder

extends Object

The `KeyBuilder` class is a key object factory.

Since:
  Java Card 2.x, Java Card 3.0

Field Summary
`static short` | `LENGTH_AES_128` AES Key Length `LENGTH_AES_128` = 128.
`static short` | `LENGTH_AES_192` AES Key Length `LENGTH_AES_192` = 192.
`static short` | `LENGTH_AES_256` AES Key Length `LENGTH_AES_256` = 256.
`static short` | `LENGTH_DES` DES Key Length `LENGTH_DES` = 64.
`static short` | `LENGTH_DES3_2KEY` DES Key Length `LENGTH_DES3_2KEY` = 128.
`static short` | `LENGTH_DES3_3KEY` DES Key Length `LENGTH_DES3_3KEY` = 192.
`static short` | `LENGTH_DSA_1024` DSA Key Length `LENGTH_DSA_1024` = 1024.
`static short` | `LENGTH_DSA_512` DSA Key Length `LENGTH_DSA_512` = 512.
`static short` | `LENGTH_DSA_768` DSA Key Length `LENGTH_DSA_768` = 768.
`static short` | `LENGTH_EC_F2M_113` EC Key Length `LENGTH_EC_F2M_113` = 113.
`static short` | `LENGTH_EC_F2M_131` EC Key Length `LENGTH_EC_F2M_131` = 131.
`static short` | `LENGTH_EC_F2M_163` EC Key Length `LENGTH_EC_F2M_163` = 163.
`static short` | `LENGTH_EC_F2M_193` EC Key Length `LENGTH_EC_F2M_193` = 193.
`static short` | `LENGTH_EC_FP_112` EC Key Length `LENGTH_EC_FP_112` = 112.
`static short` | `LENGTH_EC_FP_128` EC Key Length `LENGTH_EC_FP_128` = 128.
`static short` | `LENGTH_EC_FP_160` EC Key Length `LENGTH_EC_FP_160` = 160.
`static short` | `LENGTH_EC_FP_192` EC Key Length `LENGTH_EC_FP_192` = 192.
`static short` | `LENGTH_EC_FP_224` EC Key Length `LENGTH_EC_FP_224` = 224.
`static short` | `LENGTH_EC_FP_256` EC Key Length `LENGTH_EC_FP_256` = 256.
`static short` | `LENGTH_EC_FP_384` EC Key Length `LENGTH_EC_FP_384` = 384.
`static short` | `LENGTH_HMAC_SHA_1_BLOCK_64` HMAC Key Length `LENGTH_HMAC_SHA_1_BLOCK_64` = 64.
`static short` | `LENGTH_HMAC_SHA_256_BLOCK_64` HMAC Key Length `LENGTH_HMAC_SHA_256_BLOCK_64` = 64.
`static short` | `LENGTH_HMAC_SHA_384_BLOCK_128` HMAC Key Length `LENGTH_HMAC_SHA_384_BLOCK_128` = 128.
`static short` | `LENGTH_HMAC_SHA_512_BLOCK_128` HMAC Key Length `LENGTH_HMAC_SHA_512_BLOCK_128` = 128.
`static short` | `LENGTH_KOREAN_SEED_128` Korean Seed Key Length `LENGTH_KOREAN_SEED_128` = 128.
`static short` | `LENGTH_RSA_1024` RSA Key Length `LENGTH_RSA_1024` = 1024.
`static short` | `LENGTH_RSA_1280` RSA Key Length `LENGTH_RSA_1280` = 1280.
`static short` | `LENGTH_RSA_1536` RSA Key Length `LENGTH_RSA_1536` = 1536.
`static short` | `LENGTH_RSA_1984` RSA Key Length `LENGTH_RSA_1984` = 1984.
`static short` | `LENGTH_RSA_2048` RSA Key Length `LENGTH_RSA_2048` = 2048.
`static short` | `LENGTH_RSA_4096` RSA Key Length `LENGTH_RSA_4096` = 4096.
`static short` | `LENGTH_RSA_512` RSA Key Length `LENGTH_RSA_512` = 512.
`static short` | `LENGTH_RSA_736` RSA Key Length `LENGTH_RSA_736` = 736.
`static short` | `LENGTH_RSA_768` RSA Key Length `LENGTH_RSA_768` = 768.
`static short` | `LENGTH_RSA_896` RSA Key Length `LENGTH_RSA_896` = 896.
`static String` | `SERVICE_NAME` This cryptographic service name, as used to lookup implemented algorithms.
`static byte` | `TYPE_AES` `Key` object which implements interface type `AESKey` with persistent key data.
`static byte` | `TYPE_AES_TRANSIENT_DESELECT` `Key` object which implements interface type `AESKey` with CLEAR_ON_DESELECT transient key data.
`static byte` | `TYPE_AES_TRANSIENT_RESET` `Key` object which implements interface type `AESKey` with CLEAR_ON_RESET transient key data.
`static byte` | `TYPE_DES` `Key` object which implements interface type `DESKey` with persistent key data.
`static byte` | `TYPE_DES_TRANSIENT_DESELECT` `Key` object which implements interface type `DESKey` with CLEAR_ON_DESELECT transient key data.
`static byte` | `TYPE_DES_TRANSIENT_RESET` `Key` object which implements interface type `DESKey` with CLEAR_ON_RESET transient key data.
`static byte` | `TYPE_DSA_PRIVATE` `Key` object which implements the interface type `DSAPrivateKey` for the DSA algorithm.
`static byte` | `TYPE_DSA_PRIVATE_TRANSIENT_DESELECT` `Key` object which implements the interface type `DSAPrivateKey` for the DSA algorithm, with CLEAR_ON_DESELECT transient key data.
`static byte` | `TYPE_DSA_PRIVATE_TRANSIENT_RESET` `Key` object which implements the interface type `DSAPrivateKey` for the DSA algorithm, with CLEAR_ON_RESET transient key data.
`static byte` | `TYPE_DSA_PUBLIC` `Key` object which implements the interface type `DSAPublicKey` for the DSA algorithm.
`static byte` | `TYPE_EC_F2M_PRIVATE` Key object which implements the interface type `ECPrivateKey` for EC operations over fields of characteristic 2 with polynomial basis.
`static byte` | `TYPE_EC_F2M_PRIVATE_TRANSIENT_DESELECT` Key object which implements the interface type `ECPrivateKey` for EC operations over fields of characteristic 2 with polynomial basis, with CLEAR_ON_DESELECT transient key data.
`static byte` | `TYPE_EC_F2M_PRIVATE_TRANSIENT_RESET` Key object which implements the interface type `ECPrivateKey` for EC operations over fields of characteristic 2 with polynomial basis, with CLEAR_ON_RESET transient key data.
`static byte` | `TYPE_EC_F2M_PUBLIC` Key object which implements the interface type `ECPublicKey` for EC operations over fields of characteristic 2 with polynomial basis.
`static byte` | `TYPE_EC_FP_PRIVATE` Key object which implements the interface type `ECPrivateKey` for EC operations over large prime fields.
`static byte` | `TYPE_EC_FP_PRIVATE_TRANSIENT_DESELECT` Key object which implements the interface type `ECPrivateKey` for EC operations over large prime fields, with CLEAR_ON_DESELECT transient key data.
`static byte` | `TYPE_EC_FP_PRIVATE_TRANSIENT_RESET` Key object which implements the interface type `ECPrivateKey` for EC operations over large prime fields, with CLEAR_ON_RESET transient key data.
`static byte` | `TYPE_EC_FP_PUBLIC` Key object which implements the interface type `ECPublicKey` for EC operations over large prime fields.
`static byte` | `TYPE_HMAC` `Key` object which implements interface type `HMACKey` with persistent key data.
`static byte` | `TYPE_HMAC_TRANSIENT_DESELECT` `Key` object which implements interface type `HMACKey` with CLEAR_ON_DESELECT transient key data.
`static byte` | `TYPE_HMAC_TRANSIENT_RESET` `Key` object which implements interface type `HMACKey` with CLEAR_ON_RESET transient key data.
`static byte` | `TYPE_KOREAN_SEED` `Key` object which implements interface type `KoreanSEEDKey` with persistent key data.
`static byte` | `TYPE_KOREAN_SEED_TRANSIENT_DESELECT` `Key` object which implements interface type `KoreanSEEDKey` with CLEAR_ON_DESELECT transient key data.
`static byte` | `TYPE_KOREAN_SEED_TRANSIENT_RESET` `Key` object which implements interface type `KoreanSEEDKey` with CLEAR_ON_RESET transient key data.
`static byte` | `TYPE_RSA_CRT_PRIVATE` `Key` object which implements interface type `RSAPrivateCrtKey` which uses Chinese Remainder Theorem.
`static byte` | `TYPE_RSA_CRT_PRIVATE_TRANSIENT_DESELECT` `Key` object which implements interface type `RSAPrivateCrtKey` which uses Chinese Remainder Theorem, with CLEAR_ON_DESELECT transient key data.
`static byte` | `TYPE_RSA_CRT_PRIVATE_TRANSIENT_RESET` `Key` object which implements interface type `RSAPrivateCrtKey` which uses Chinese Remainder Theorem, with CLEAR_ON_RESET transient key data.
`static byte` | `TYPE_RSA_PRIVATE` `Key` object which implements interface type `RSAPrivateKey` which uses modulus/exponent form.
`static byte` | `TYPE_RSA_PRIVATE_TRANSIENT_DESELECT` `Key` object which implements interface type `RSAPrivateKey` which uses modulus/exponent form, with CLEAR_ON_DESELECT transient key data.
`static byte` | `TYPE_RSA_PRIVATE_TRANSIENT_RESET` `Key` object which implements interface type `RSAPrivateKey` which uses modulus/exponent form, with CLEAR_ON_RESET transient key data.
`static byte` | `TYPE_RSA_PUBLIC` `Key` object which implements interface type `RSAPublicKey`.

Method Summary
`static Key` | `buildKey(byte keyType, short keyLength, boolean keyEncryption)` Creates uninitialized cryptographic keys for signature and cipher algorithms.
`static Key` | `buildKey(String keyType, short keyLength, boolean keyEncryption)` Creates uninitialized cryptographic keys for signature and cipher algorithms.
`static Key` | `buildKey(String keyType, String provider, short keyLength, boolean keyEncryption)` Creates uninitialized cryptographic keys for signature and cipher algorithms.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SERVICE_NAME

    public static final String SERVICE_NAME

  This cryptographic service name, as used to lookup implemented algorithms.

  Since:
    Java Card 3.0
  See Also:
    Constant Field Values

### TYPE_DES_TRANSIENT_RESET

    public static final byte TYPE_DES_TRANSIENT_RESET

  `Key` object which implements interface type `DESKey` with CLEAR_ON_RESET transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"DES_TRANSIENT_RESET"`

  See Also:
    Constant Field Values

### TYPE_DES_TRANSIENT_DESELECT

    public static final byte TYPE_DES_TRANSIENT_DESELECT

  `Key` object which implements interface type `DESKey` with CLEAR_ON_DESELECT transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on, card reset and applet deselection.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"DES_TRANSIENT_RESET"`

  See Also:
    Constant Field Values

### TYPE_DES

    public static final byte TYPE_DES

  `Key` object which implements interface type `DESKey` with persistent key data.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"DES"`

  See Also:
    Constant Field Values

### TYPE_RSA_PUBLIC

    public static final byte TYPE_RSA_PUBLIC

  `Key` object which implements interface type `RSAPublicKey`.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"RSA_PUBLIC"`

  See Also:
    Constant Field Values

### TYPE_RSA_PRIVATE

    public static final byte TYPE_RSA_PRIVATE

  `Key` object which implements interface type `RSAPrivateKey` which uses modulus/exponent form.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"RSA_PRIVATE"`

  See Also:
    Constant Field Values

### TYPE_RSA_CRT_PRIVATE

    public static final byte TYPE_RSA_CRT_PRIVATE

  `Key` object which implements interface type `RSAPrivateCrtKey` which uses Chinese Remainder Theorem.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"RSA_CRT_PRIVATE"`

  See Also:
    Constant Field Values

### TYPE_DSA_PUBLIC

    public static final byte TYPE_DSA_PUBLIC

  `Key` object which implements the interface type `DSAPublicKey` for the DSA algorithm.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"DSA_PUBLIC"`

  See Also:
    Constant Field Values

### TYPE_DSA_PRIVATE

    public static final byte TYPE_DSA_PRIVATE

  `Key` object which implements the interface type `DSAPrivateKey` for the DSA algorithm.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"DSA_PRIVATE"`

  See Also:
    Constant Field Values

### TYPE_EC_F2M_PUBLIC

    public static final byte TYPE_EC_F2M_PUBLIC

  Key object which implements the interface type `ECPublicKey` for EC operations over fields of characteristic 2 with polynomial basis.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"EC_F2M_PUBLIC"`

  See Also:
    Constant Field Values

### TYPE_EC_F2M_PRIVATE

    public static final byte TYPE_EC_F2M_PRIVATE

  Key object which implements the interface type `ECPrivateKey` for EC operations over fields of characteristic 2 with polynomial basis.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"EC_F2M_PRIVATE"`

  See Also:
    Constant Field Values

### TYPE_EC_FP_PUBLIC

    public static final byte TYPE_EC_FP_PUBLIC

  Key object which implements the interface type `ECPublicKey` for EC operations over large prime fields.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"EC_FP_PUBLIC"`

  See Also:
    Constant Field Values

### TYPE_EC_FP_PRIVATE

    public static final byte TYPE_EC_FP_PRIVATE

  Key object which implements the interface type `ECPrivateKey` for EC operations over large prime fields.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"EC_FP_PRIVATE"`

  See Also:
    Constant Field Values

### TYPE_AES_TRANSIENT_RESET

    public static final byte TYPE_AES_TRANSIENT_RESET

  `Key` object which implements interface type `AESKey` with CLEAR_ON_RESET transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"AES_TRANSIENT_RESET"`

  See Also:
    Constant Field Values

### TYPE_AES_TRANSIENT_DESELECT

    public static final byte TYPE_AES_TRANSIENT_DESELECT

  `Key` object which implements interface type `AESKey` with CLEAR_ON_DESELECT transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on, card reset and applet deselection.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"AES_TRANSIENT_DESELECT"`

  See Also:
    Constant Field Values

### TYPE_AES

    public static final byte TYPE_AES

  `Key` object which implements interface type `AESKey` with persistent key data.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"AES"`

  See Also:
    Constant Field Values

### TYPE_KOREAN_SEED_TRANSIENT_RESET

    public static final byte TYPE_KOREAN_SEED_TRANSIENT_RESET

  `Key` object which implements interface type `KoreanSEEDKey` with CLEAR_ON_RESET transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"KOREAN_SEED_TRANSIENT_RESET"`

  See Also:
    Constant Field Values

### TYPE_KOREAN_SEED_TRANSIENT_DESELECT

    public static final byte TYPE_KOREAN_SEED_TRANSIENT_DESELECT

  `Key` object which implements interface type `KoreanSEEDKey` with CLEAR_ON_DESELECT transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"KOREAN_SEED_TRANSIENT_DESELECT"`

  See Also:
    Constant Field Values

### TYPE_KOREAN_SEED

    public static final byte TYPE_KOREAN_SEED

  `Key` object which implements interface type `KoreanSEEDKey` with persistent key data.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"KOREAN_SEED"`

  See Also:
    Constant Field Values

### TYPE_HMAC_TRANSIENT_RESET

    public static final byte TYPE_HMAC_TRANSIENT_RESET

  `Key` object which implements interface type `HMACKey` with CLEAR_ON_RESET transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset. Note, there is no length constant associated with HMAC, since the specification states that the key can have any length.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"HMAC_TRANSIENT_RESET"`

  See Also:
    Constant Field Values

### TYPE_HMAC_TRANSIENT_DESELECT

    public static final byte TYPE_HMAC_TRANSIENT_DESELECT

  `Key` object which implements interface type `HMACKey` with CLEAR_ON_DESELECT transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"HMAC_TRANSIENT_DESELECT"`

  See Also:
    Constant Field Values

### TYPE_HMAC

    public static final byte TYPE_HMAC

  `Key` object which implements interface type `HMACKey` with persistent key data.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"HMAC"`

  See Also:
    Constant Field Values

### TYPE_RSA_PRIVATE_TRANSIENT_RESET

    public static final byte TYPE_RSA_PRIVATE_TRANSIENT_RESET

  `Key` object which implements interface type `RSAPrivateKey` which uses modulus/exponent form, with CLEAR_ON_RESET transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"RSA_PRIVATE_TRANSIENT_RESET"`

  See Also:
    Constant Field Values

### TYPE_RSA_PRIVATE_TRANSIENT_DESELECT

    public static final byte TYPE_RSA_PRIVATE_TRANSIENT_DESELECT

  `Key` object which implements interface type `RSAPrivateKey` which uses modulus/exponent form, with CLEAR_ON_DESELECT transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"RSA_PRIVATE_TRANSIENT_DESELECT"`

  See Also:
    Constant Field Values

### TYPE_RSA_CRT_PRIVATE_TRANSIENT_RESET

    public static final byte TYPE_RSA_CRT_PRIVATE_TRANSIENT_RESET

  `Key` object which implements interface type `RSAPrivateCrtKey` which uses Chinese Remainder Theorem, with CLEAR_ON_RESET transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"RSA_CRT_PRIVATE_TRANSIENT_RESET"`

  See Also:
    Constant Field Values

### TYPE_RSA_CRT_PRIVATE_TRANSIENT_DESELECT

    public static final byte TYPE_RSA_CRT_PRIVATE_TRANSIENT_DESELECT

  `Key` object which implements interface type `RSAPrivateCrtKey` which uses Chinese Remainder Theorem, with CLEAR_ON_DESELECT transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"RSA_CRT_PRIVATE_TRANSIENT_DESELECT"`

  See Also:
    Constant Field Values

### TYPE_DSA_PRIVATE_TRANSIENT_RESET

    public static final byte TYPE_DSA_PRIVATE_TRANSIENT_RESET

  `Key` object which implements the interface type `DSAPrivateKey` for the DSA algorithm, with CLEAR_ON_RESET transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"DSA_PRIVATE_TRANSIENT_RESET"`

  See Also:
    Constant Field Values

### TYPE_DSA_PRIVATE_TRANSIENT_DESELECT

    public static final byte TYPE_DSA_PRIVATE_TRANSIENT_DESELECT

  `Key` object which implements the interface type `DSAPrivateKey` for the DSA algorithm, with CLEAR_ON_DESELECT transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"DSA_PRIVATE_TRANSIENT_DESELECT"`

  See Also:
    Constant Field Values

### TYPE_EC_F2M_PRIVATE_TRANSIENT_RESET

    public static final byte TYPE_EC_F2M_PRIVATE_TRANSIENT_RESET

  Key object which implements the interface type `ECPrivateKey` for EC operations over fields of characteristic 2 with polynomial basis, with CLEAR_ON_RESET transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"EC_F2M_PRIVATE_TRANSIENT_RESET"`

  See Also:
    Constant Field Values

### TYPE_EC_F2M_PRIVATE_TRANSIENT_DESELECT

    public static final byte TYPE_EC_F2M_PRIVATE_TRANSIENT_DESELECT

  Key object which implements the interface type `ECPrivateKey` for EC operations over fields of characteristic 2 with polynomial basis, with CLEAR_ON_DESELECT transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"EC_F2M_PRIVATE_TRANSIENT_DESELECT"`

  See Also:
    Constant Field Values

### TYPE_EC_FP_PRIVATE_TRANSIENT_RESET

    public static final byte TYPE_EC_FP_PRIVATE_TRANSIENT_RESET

  Key object which implements the interface type `ECPrivateKey` for EC operations over large prime fields, with CLEAR_ON_RESET transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"EC_FP_PRIVATE_TRANSIENT_RESET"`

  See Also:
    Constant Field Values

### TYPE_EC_FP_PRIVATE_TRANSIENT_DESELECT

    public static final byte TYPE_EC_FP_PRIVATE_TRANSIENT_DESELECT

  Key object which implements the interface type `ECPrivateKey` for EC operations over large prime fields, with CLEAR_ON_DESELECT transient key data.

  This `Key` object implicitly performs a `clearKey()` on power on or card reset.

  The `String` name equivalent to this key type to use as parameter to the `buildKey(String keyType, ...)` method is `"EC_FP_PRIVATE_TRANSIENT_DESELECT"`

  See Also:
    Constant Field Values

### LENGTH_DES

    public static final short LENGTH_DES

  DES Key Length `LENGTH_DES` = 64.

  See Also:
    Constant Field Values

### LENGTH_DES3_2KEY

    public static final short LENGTH_DES3_2KEY

  DES Key Length `LENGTH_DES3_2KEY` = 128.

  See Also:
    Constant Field Values

### LENGTH_DES3_3KEY

    public static final short LENGTH_DES3_3KEY

  DES Key Length `LENGTH_DES3_3KEY` = 192.

  See Also:
    Constant Field Values

### LENGTH_RSA_512

    public static final short LENGTH_RSA_512

  RSA Key Length `LENGTH_RSA_512` = 512.

  See Also:
    Constant Field Values

### LENGTH_RSA_736

    public static final short LENGTH_RSA_736

  RSA Key Length `LENGTH_RSA_736` = 736.

  See Also:
    Constant Field Values

### LENGTH_RSA_768

    public static final short LENGTH_RSA_768

  RSA Key Length `LENGTH_RSA_768` = 768.

  See Also:
    Constant Field Values

### LENGTH_RSA_896

    public static final short LENGTH_RSA_896

  RSA Key Length `LENGTH_RSA_896` = 896.

  See Also:
    Constant Field Values

### LENGTH_RSA_1024

    public static final short LENGTH_RSA_1024

  RSA Key Length `LENGTH_RSA_1024` = 1024.

  See Also:
    Constant Field Values

### LENGTH_RSA_1280

    public static final short LENGTH_RSA_1280

  RSA Key Length `LENGTH_RSA_1280` = 1280.

  See Also:
    Constant Field Values

### LENGTH_RSA_1536

    public static final short LENGTH_RSA_1536

  RSA Key Length `LENGTH_RSA_1536` = 1536.

  See Also:
    Constant Field Values

### LENGTH_RSA_1984

    public static final short LENGTH_RSA_1984

  RSA Key Length `LENGTH_RSA_1984` = 1984.

  See Also:
    Constant Field Values

### LENGTH_RSA_2048

    public static final short LENGTH_RSA_2048

  RSA Key Length `LENGTH_RSA_2048` = 2048.

  See Also:
    Constant Field Values

### LENGTH_RSA_4096

    public static final short LENGTH_RSA_4096

  RSA Key Length `LENGTH_RSA_4096` = 4096.

  See Also:
    Constant Field Values

### LENGTH_DSA_512

    public static final short LENGTH_DSA_512

  DSA Key Length `LENGTH_DSA_512` = 512.

  See Also:
    Constant Field Values

### LENGTH_DSA_768

    public static final short LENGTH_DSA_768

  DSA Key Length `LENGTH_DSA_768` = 768.

  See Also:
    Constant Field Values

### LENGTH_DSA_1024

    public static final short LENGTH_DSA_1024

  DSA Key Length `LENGTH_DSA_1024` = 1024.

  See Also:
    Constant Field Values

### LENGTH_EC_FP_112

    public static final short LENGTH_EC_FP_112

  EC Key Length `LENGTH_EC_FP_112` = 112.

  See Also:
    Constant Field Values

### LENGTH_EC_F2M_113

    public static final short LENGTH_EC_F2M_113

  EC Key Length `LENGTH_EC_F2M_113` = 113.

  See Also:
    Constant Field Values

### LENGTH_EC_FP_128

    public static final short LENGTH_EC_FP_128

  EC Key Length `LENGTH_EC_FP_128` = 128.

  See Also:
    Constant Field Values

### LENGTH_EC_F2M_131

    public static final short LENGTH_EC_F2M_131

  EC Key Length `LENGTH_EC_F2M_131` = 131.

  See Also:
    Constant Field Values

### LENGTH_EC_FP_160

    public static final short LENGTH_EC_FP_160

  EC Key Length `LENGTH_EC_FP_160` = 160.

  See Also:
    Constant Field Values

### LENGTH_EC_F2M_163

    public static final short LENGTH_EC_F2M_163

  EC Key Length `LENGTH_EC_F2M_163` = 163.

  See Also:
    Constant Field Values

### LENGTH_EC_FP_192

    public static final short LENGTH_EC_FP_192

  EC Key Length `LENGTH_EC_FP_192` = 192.

  See Also:
    Constant Field Values

### LENGTH_EC_F2M_193

    public static final short LENGTH_EC_F2M_193

  EC Key Length `LENGTH_EC_F2M_193` = 193.

  See Also:
    Constant Field Values

### LENGTH_EC_FP_224

    public static final short LENGTH_EC_FP_224

  EC Key Length `LENGTH_EC_FP_224` = 224.

  See Also:
    Constant Field Values

### LENGTH_EC_FP_256

    public static final short LENGTH_EC_FP_256

  EC Key Length `LENGTH_EC_FP_256` = 256.

  See Also:
    Constant Field Values

### LENGTH_EC_FP_384

    public static final short LENGTH_EC_FP_384

  EC Key Length `LENGTH_EC_FP_384` = 384.

  See Also:
    Constant Field Values

### LENGTH_AES_128

    public static final short LENGTH_AES_128

  AES Key Length `LENGTH_AES_128` = 128.

  See Also:
    Constant Field Values

### LENGTH_AES_192

    public static final short LENGTH_AES_192

  AES Key Length `LENGTH_AES_192` = 192.

  See Also:
    Constant Field Values

### LENGTH_AES_256

    public static final short LENGTH_AES_256

  AES Key Length `LENGTH_AES_256` = 256.

  See Also:
    Constant Field Values

### LENGTH_KOREAN_SEED_128

    public static final short LENGTH_KOREAN_SEED_128

  Korean Seed Key Length `LENGTH_KOREAN_SEED_128` = 128.

  See Also:
    Constant Field Values

### LENGTH_HMAC_SHA_1_BLOCK_64

    public static final short LENGTH_HMAC_SHA_1_BLOCK_64

  HMAC Key Length `LENGTH_HMAC_SHA_1_BLOCK_64` = 64.

  See Also:
    Constant Field Values

### LENGTH_HMAC_SHA_256_BLOCK_64

    public static final short LENGTH_HMAC_SHA_256_BLOCK_64

  HMAC Key Length `LENGTH_HMAC_SHA_256_BLOCK_64` = 64.

  See Also:
    Constant Field Values

### LENGTH_HMAC_SHA_384_BLOCK_128

    public static final short LENGTH_HMAC_SHA_384_BLOCK_128

  HMAC Key Length `LENGTH_HMAC_SHA_384_BLOCK_128` = 128.

  See Also:
    Constant Field Values

### LENGTH_HMAC_SHA_512_BLOCK_128

    public static final short LENGTH_HMAC_SHA_512_BLOCK_128

  HMAC Key Length `LENGTH_HMAC_SHA_512_BLOCK_128` = 128.

  See Also:
    Constant Field Values

Method Detail

### buildKey

    public static Key buildKey(byte keyType,
                               short keyLength,
                               boolean keyEncryption)
                        throws CryptoException

  Creates uninitialized cryptographic keys for signature and cipher algorithms. Only instances created by this method may be the key objects used to initialize instances of `Signature`, `Cipher` and `KeyPair`. Note that the object returned must be cast to their appropriate key type interface.

  A call to this method is equivalent to a call to `buildKey(java.lang.String, short, boolean)` with the `keyType` parameter set to the equivalent `String` algorithm name - as listed in the `ALG_*` constants above.

  This method returns an instance of the specified key type supported by the most preferred provider of this cryptographic service. Note that the list of installed providers may be retrieved via the `CryptoServices.getProviders()` method.

  Note:

  - If called from a web application with a key type of `CLEAR_ON_DESELECT` transient type data, this method throws a CryptoException execption with reason code `CryptoException.NO_SUCH_ALGORITHM`

  Parameters:
    `keyType` - the type of key to be generated. Valid codes listed in `TYPE_*` constants. See `TYPE_DES_TRANSIENT_RESET`.
    `keyLength` - the key size in bits. The valid key bit lengths are key type dependent. Some common key lengths are listed above above in the `LENGTH_*` constants. See `LENGTH_DES`.
    `keyEncryption` - if `true` this boolean requests a key implementation which implements the `javacardx.crypto.KeyEncryption` interface. The key implementation returned may implement the `javacardx.crypto.KeyEncryption` interface even when this parameter is `false`.
  Returns:
    the key object instance of the requested key type, length and encrypted access
  Throws:
    `CryptoException` - with the following reason codes:
    - `CryptoException.NO_SUCH_ALGORITHM` if the requested algorithm associated with the specified type, size of key and key encryption interface is not supported, for the caller application type.
    `SecurityException` - if creating an instance of this cryptographic service is not granted.

### buildKey

    public static Key buildKey(String keyType,
                               short keyLength,
                               boolean keyEncryption)
                        throws CryptoException

  Creates uninitialized cryptographic keys for signature and cipher algorithms. Only instances created by this method may be the key objects used to initialize instances of `Signature`, `Cipher` and `KeyPair`. Note that the object returned must be cast to their appropriate key type interface.

  This method returns an instance of the specified key type supported by the most preferred provider of this cryptographic service. Note that the list of installed providers may be retrieved via the `CryptoServices.getProviders()` method.

  Note:

  - If called from a web application with a key type of `CLEAR_ON_DESELECT` transient type data, this method throws a CryptoException execption with reason code CryptoException.NO_SUCH_ALGORITHM

  Parameters:
    `keyType` - the type of key to be generated. Valid names listed in `TYPE_*` constants. See `TYPE_DES_TRANSIENT_RESET`.
    `keyLength` - the key size in bits. The valid key bit lengths are key type dependent. Some common key lengths are listed above above in the `LENGTH_*` constants. See `LENGTH_DES`.
    `keyEncryption` - if `true` this boolean requests a key implementation which implements the `javacardx.crypto.KeyEncryption` interface. The key implementation returned may implement the `javacardx.crypto.KeyEncryption` interface even when this parameter is `false`.
  Returns:
    the key object instance of the requested key type, length and encrypted access
  Throws:
    `CryptoException` - with the following reason codes:
    - `CryptoException.NO_SUCH_ALGORITHM` if the requested algorithm associated with the specified type, size of key and key encryption interface is not supported, for the caller application type.
    `NullPointerException` - if `keyType` is null.
    `SecurityException` - if creating an instance of this cryptographic service is not granted.
  Since:
    Java Card 3.0

### buildKey

    public static Key buildKey(String keyType,
                               String provider,
                               short keyLength,
                               boolean keyEncryption)
                        throws CryptoException

  Creates uninitialized cryptographic keys for signature and cipher algorithms. Only instances created by this method may be the key objects used to initialize instances of `Signature`, `Cipher` and `KeyPair`. Note that the object returned must be cast to their appropriate key type interface.

  Note:

  - If called from a web application with a key type of `CLEAR_ON_DESELECT` transient type data, this method throws a CryptoException execption with reason code CryptoException.NO_SUCH_ALGORITHM

  Parameters:
    `keyType` - the type of key to be generated. Valid names listed in `TYPE_*` constants. See `TYPE_DES_TRANSIENT_RESET`.
    `provider` - the desired key algorithm provider.
    `keyLength` - the key size in bits. The valid key bit lengths are key type dependent. Some common key lengths are listed above above in the `LENGTH_*` constants. See `LENGTH_DES`.
    `keyEncryption` - if `true` this boolean requests a key implementation which implements the `javacardx.crypto.KeyEncryption` interface. The key implementation returned may implement the `javacardx.crypto.KeyEncryption` interface even when this parameter is `false`.
  Returns:
    the key object instance of the requested key type, length and encrypted access
  Throws:
    `CryptoException` - with the following reason codes:
    - `CryptoException.NO_SUCH_ALGORITHM` if the requested algorithm associated with the specified type, size of key and key encryption interface is not supported.
    `NullPointerException` - if `keyType` or `provider` is null.
    `SecurityException` - if creating an instance of this cryptographic service is not granted.
  Since:
    Java Card 3.0

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.