java.security.spec
Class EncodedKeySpec

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.security.spec.EncodedKeySpec
All Implemented Interfaces:
KeySpec sample code for java.security.spec.KeySpec definition code for java.security.spec.KeySpec
Direct Known Subclasses:
PKCS8EncodedKeySpec sample code for java.security.spec.PKCS8EncodedKeySpec definition code for java.security.spec.PKCS8EncodedKeySpec , X509EncodedKeySpec sample code for java.security.spec.X509EncodedKeySpec definition code for java.security.spec.X509EncodedKeySpec

public abstract class EncodedKeySpec
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements KeySpec sample code for java.security.spec.KeySpec definition code for java.security.spec.KeySpec

This class represents a public or private key in encoded format.

Since:
1.2
See Also:
Key sample code for java.security.Key definition code for java.security.Key , KeyFactory sample code for java.security.KeyFactory definition code for java.security.KeyFactory , KeySpec sample code for java.security.spec.KeySpec definition code for java.security.spec.KeySpec , X509EncodedKeySpec sample code for java.security.spec.X509EncodedKeySpec definition code for java.security.spec.X509EncodedKeySpec , PKCS8EncodedKeySpec sample code for java.security.spec.PKCS8EncodedKeySpec definition code for java.security.spec.PKCS8EncodedKeySpec

Constructor Summary
EncodedKeySpec sample code for java.security.spec.EncodedKeySpec.EncodedKeySpec(byte[]) definition code for java.security.spec.EncodedKeySpec.EncodedKeySpec(byte[]) (byte[] encodedKey)
          Creates a new EncodedKeySpec with the given encoded key.
 
Method Summary
 byte[] getEncoded sample code for java.security.spec.EncodedKeySpec.getEncoded() definition code for java.security.spec.EncodedKeySpec.getEncoded() ()
          Returns the encoded key.
abstract  String sample code for java.lang.String definition code for java.lang.String getFormat sample code for java.security.spec.EncodedKeySpec.getFormat() definition code for java.security.spec.EncodedKeySpec.getFormat() ()
          Returns the name of the encoding format associated with this key specification.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

EncodedKeySpec sample code for java.security.spec.EncodedKeySpec(byte[]) definition code for java.security.spec.EncodedKeySpec(byte[])

public EncodedKeySpec(byte[] encodedKey)
Creates a new EncodedKeySpec with the given encoded key.

Parameters:
encodedKey - the encoded key. The contents of the array are copied to protect against subsequent modification.
Method Detail

getEncoded sample code for java.security.spec.EncodedKeySpec.getEncoded() definition code for java.security.spec.EncodedKeySpec.getEncoded()

public byte[] getEncoded()
Returns the encoded key.

Returns:
the encoded key. Returns a new array each time this method is called.

getFormat sample code for java.security.spec.EncodedKeySpec.getFormat() definition code for java.security.spec.EncodedKeySpec.getFormat()

public abstract String sample code for java.lang.String definition code for java.lang.String  getFormat()
Returns the name of the encoding format associated with this key specification.

If the opaque representation of a key (see Key sample code for java.security.Key definition code for java.security.Key ) can be transformed (see KeyFactory sample code for java.security.KeyFactory definition code for java.security.KeyFactory ) into this key specification (or a subclass of it), getFormat called on the opaque key returns the same value as the getFormat method of this key specification.

Returns:
a string representation of the encoding format.