java.security.spec

Class EncodedKeySpec

public abstract class EncodedKeySpec extends Object implements KeySpec

Encoded Key Specification class which is used to store byte encoded keys.

Since: JDK 1.2

Constructor Summary
EncodedKeySpec(byte[] encodedKey)
Constructs a new EncodedKeySpec with the specified encoded key.
Method Summary
byte[]getEncoded()
Gets the encoded key in byte format.
abstract StringgetFormat()
Returns the name of the key format used.

Constructor Detail

EncodedKeySpec

public EncodedKeySpec(byte[] encodedKey)
Constructs a new EncodedKeySpec with the specified encoded key.

Parameters: encodedKey A key to store

Method Detail

getEncoded

public byte[] getEncoded()
Gets the encoded key in byte format.

UNKNOWN: the encoded key

getFormat

public abstract String getFormat()
Returns the name of the key format used. This name is the format such as "PKCS#8" or "X.509" which if it matches a Key class name of the same type can be transformed using the apporiate KeyFactory.

Returns: a string representing the name