java.security.spec
Class X509EncodedKeySpec

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.security.spec.EncodedKeySpec sample code for java.security.spec.EncodedKeySpec definition code for java.security.spec.EncodedKeySpec 
      extended by java.security.spec.X509EncodedKeySpec
All Implemented Interfaces:
KeySpec sample code for java.security.spec.KeySpec definition code for java.security.spec.KeySpec

public class X509EncodedKeySpec
extends EncodedKeySpec sample code for java.security.spec.EncodedKeySpec definition code for java.security.spec.EncodedKeySpec

This class represents the ASN.1 encoding of a public key, encoded according to the ASN.1 type SubjectPublicKeyInfo. The SubjectPublicKeyInfo syntax is defined in the X.509 standard as follows:

 SubjectPublicKeyInfo ::= SEQUENCE {
   algorithm AlgorithmIdentifier,
   subjectPublicKey BIT STRING }
 

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 , EncodedKeySpec sample code for java.security.spec.EncodedKeySpec definition code for java.security.spec.EncodedKeySpec , PKCS8EncodedKeySpec sample code for java.security.spec.PKCS8EncodedKeySpec definition code for java.security.spec.PKCS8EncodedKeySpec

Constructor Summary
X509EncodedKeySpec sample code for java.security.spec.X509EncodedKeySpec.X509EncodedKeySpec(byte[]) definition code for java.security.spec.X509EncodedKeySpec.X509EncodedKeySpec(byte[]) (byte[] encodedKey)
          Creates a new X509EncodedKeySpec with the given encoded key.
 
Method Summary
 byte[] getEncoded sample code for java.security.spec.X509EncodedKeySpec.getEncoded() definition code for java.security.spec.X509EncodedKeySpec.getEncoded() ()
          Returns the key bytes, encoded according to the X.509 standard.
 String sample code for java.lang.String definition code for java.lang.String getFormat sample code for java.security.spec.X509EncodedKeySpec.getFormat() definition code for java.security.spec.X509EncodedKeySpec.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

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

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

Parameters:
encodedKey - the key, which is assumed to be encoded according to the X.509 standard. The contents of the array are copied to protect against subsequent modification.
Method Detail

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

public byte[] getEncoded()
Returns the key bytes, encoded according to the X.509 standard.

Overrides:
getEncoded sample code for java.security.spec.EncodedKeySpec.getEncoded() definition code for java.security.spec.EncodedKeySpec.getEncoded() in class EncodedKeySpec sample code for java.security.spec.EncodedKeySpec definition code for java.security.spec.EncodedKeySpec
Returns:
the X.509 encoding of the key. Returns a new array each time this method is called.

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

public final 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.

Specified by:
getFormat sample code for java.security.spec.EncodedKeySpec.getFormat() definition code for java.security.spec.EncodedKeySpec.getFormat() in class EncodedKeySpec sample code for java.security.spec.EncodedKeySpec definition code for java.security.spec.EncodedKeySpec
Returns:
the string "X.509".