com.ibm.jc
Class OPKey

java.lang.Object
  extended bycom.ibm.jc.OPKey

public class OPKey
extends java.lang.Object

An Global (Open) Platform key. A key is identified by a key set version number and its key identifier (or index) in that particular key set.


Field Summary
static int DES
          Key type: DES (ECB/CBC) (0x80) (GP 2.1.1)
static int DES_CBC
          Key type: DES CBC (0x82) (VOP 2.0.1')
static int DES_ECB
          Key type: DES ECB (0x81) (VOP 2.0.1')
static int DSA_PRIV
          Key type: DSA private key (0xB2)
static int DSA_PUB
          Key type: DSA public key (0xB1)
static int ENC_GP
          key encoding: GP 2.1.1
static int ENC_VOP
          key encoding: VOP 2.0.1'
static int RSA_CRT
          Key type: RSA CRT key (0xA3)
static int RSA_PRIV
          Key type: RSA private key (0xA2)
static int RSA_PUB
          Key type: RSA public key (0xA1)
 
Constructor Summary
OPKey(int keySet, int keyId, int keyType, byte[] material)
          Create a key object.
OPKey(OPKey key)
          Create a key object.
 
Method Summary
 int getByteLength()
          The key length in bytes.
 int getKeyId()
          The key identifier.
 int getKeySet()
          The key set version.
 int getKeyType()
           
 int getKeyType(int enc)
           
 byte[] getMaterial()
          The key material.
 boolean isDESKey()
          Reports whether this key is a DES key or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DES

public static final int DES
Key type: DES (ECB/CBC) (0x80) (GP 2.1.1)

See Also:
Constant Field Values

DES_ECB

public static final int DES_ECB
Key type: DES ECB (0x81) (VOP 2.0.1')

See Also:
Constant Field Values

DES_CBC

public static final int DES_CBC
Key type: DES CBC (0x82) (VOP 2.0.1')

See Also:
Constant Field Values

RSA_PUB

public static final int RSA_PUB
Key type: RSA public key (0xA1)

See Also:
Constant Field Values

RSA_PRIV

public static final int RSA_PRIV
Key type: RSA private key (0xA2)

See Also:
Constant Field Values

RSA_CRT

public static final int RSA_CRT
Key type: RSA CRT key (0xA3)

See Also:
Constant Field Values

DSA_PUB

public static final int DSA_PUB
Key type: DSA public key (0xB1)

See Also:
Constant Field Values

DSA_PRIV

public static final int DSA_PRIV
Key type: DSA private key (0xB2)

See Also:
Constant Field Values

ENC_VOP

public static final int ENC_VOP
key encoding: VOP 2.0.1'

See Also:
Constant Field Values

ENC_GP

public static final int ENC_GP
key encoding: GP 2.1.1

See Also:
Constant Field Values
Constructor Detail

OPKey

public OPKey(OPKey key)
Create a key object.

Parameters:
key - OPKey object.

OPKey

public OPKey(int keySet,
             int keyId,
             int keyType,
             byte[] material)
Create a key object.

Parameters:
keySet - the key set number. This number must in the range [0..255].
keyId - the key identifier. This number must be in the range [1..255].
keyType - the type of the key. Legal values must be in the range [0..255].
material - the key material. The key material is shared and is not copied. It should not be modified later on.
Method Detail

getKeyType

public int getKeyType()

getKeyType

public int getKeyType(int enc)

getMaterial

public byte[] getMaterial()
The key material.

Returns:
the key material. The returned array is shared with this instance.

getByteLength

public int getByteLength()
The key length in bytes.

Returns:
the key length in bytes (e.g. 128 for a 1024 bit RSA key)

getKeySet

public int getKeySet()
The key set version.

Returns:
the key set version. This value is in the range [1..255]

getKeyId

public int getKeyId()
The key identifier.

Returns:
the key identifier (or index). This value should be in the range [1..255].

isDESKey

public boolean isDESKey()
Reports whether this key is a DES key or not.

Returns:
true if this key is a DES key, false otherwise


Copyright (c) 2004, 2006 International Business Machines Corporation. All Rights Reserved.