java.security
Class KeyRep

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.security.KeyRep
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class KeyRep
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Serializable sample code for java.io.Serializable definition code for java.io.Serializable

Standardized representation for serialized Key objects.

Note that a serialized Key may contain sensitive information which should not be exposed in untrusted environments. See the Security Appendix of the Serialization Specification for more information.

Since:
1.5
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 , SecretKeySpec, 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 , Serialized Form

Nested Class Summary
static class KeyRep.Type sample code for java.security.KeyRep.Type definition code for java.security.KeyRep.Type
          Key type.
 
Constructor Summary
KeyRep sample code for java.security.KeyRep.KeyRep(java.security.KeyRep.Type, java.lang.String, java.lang.String, byte[]) definition code for java.security.KeyRep.KeyRep(java.security.KeyRep.Type, java.lang.String, java.lang.String, byte[]) (KeyRep.Type sample code for java.security.KeyRep.Type definition code for java.security.KeyRep.Type  type, String sample code for java.lang.String definition code for java.lang.String  algorithm, String sample code for java.lang.String definition code for java.lang.String  format, byte[] encoded)
          Construct the alternate Key class.
 
Method Summary
protected  Object sample code for java.lang.Object definition code for java.lang.Object readResolve sample code for java.security.KeyRep.readResolve() definition code for java.security.KeyRep.readResolve() ()
          Resolve the Key object.
 
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

KeyRep sample code for java.security.KeyRep(java.security.KeyRep.Type, java.lang.String, java.lang.String, byte[]) definition code for java.security.KeyRep(java.security.KeyRep.Type, java.lang.String, java.lang.String, byte[])

public KeyRep(KeyRep.Type sample code for java.security.KeyRep.Type definition code for java.security.KeyRep.Type  type,
              String sample code for java.lang.String definition code for java.lang.String  algorithm,
              String sample code for java.lang.String definition code for java.lang.String  format,
              byte[] encoded)
Construct the alternate Key class.

Parameters:
type - either one of Type.SECRET, Type.PUBLIC, or Type.PRIVATE
algorithm - the algorithm returned from Key.getAlgorithm()
format - the encoding format returned from Key.getFormat()
encoded - the encoded bytes returned from Key.getEncoded()
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if type is null, if algorithm is null, if format is null, or if encoded is null
Method Detail

readResolve sample code for java.security.KeyRep.readResolve() definition code for java.security.KeyRep.readResolve()

protected Object sample code for java.lang.Object definition code for java.lang.Object  readResolve()
                      throws ObjectStreamException sample code for java.io.ObjectStreamException definition code for java.io.ObjectStreamException 
Resolve the Key object.

This method supports three Type/format combinations:

Returns:
the resolved Key object
Throws:
NotSerializableException sample code for java.io.NotSerializableException definition code for java.io.NotSerializableException - if the Type/format combination is unrecognized, if the algorithm, key format, or encoded key bytes are unrecognized/invalid, of if the resolution of the key fails for any reason
ObjectStreamException sample code for java.io.ObjectStreamException definition code for java.io.ObjectStreamException