Build 1.0_r1(from source)

javax.crypto.spec
Class SecretKeySpec

java.lang.Object
  extended by javax.crypto.spec.SecretKeySpec
All Implemented Interfaces:
Serializable, Key, KeySpec, SecretKey

public class SecretKeySpec
extends Object
implements SecretKey, KeySpec, Serializable

See Also:
Serialized Form

Constructor Summary
SecretKeySpec(byte[] key, int offset, int len, String algorithm)
           
SecretKeySpec(byte[] key, String algorithm)
           
 
Method Summary
 boolean equals(Object obj)
          Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
 String getAlgorithm()
          Returns the name of the algorithm that this key will work with.
 byte[] getEncoded()
          Returns the encoded form of the receiver.
 String getFormat()
          Returns the name of the format used to encode the key, or null if it can not be encoded.
 int hashCode()
          Returns an integer hash code for the receiver.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecretKeySpec

public SecretKeySpec(byte[] key,
                     String algorithm)

SecretKeySpec

public SecretKeySpec(byte[] key,
                     int offset,
                     int len,
                     String algorithm)
Method Detail

getAlgorithm

public String getAlgorithm()
Description copied from interface: Key
Returns the name of the algorithm that this key will work with. If the algorithm is unknown, it returns null.

Specified by:
getAlgorithm in interface Key
Returns:
String the receiver's algorithm

getFormat

public String getFormat()
Description copied from interface: Key
Returns the name of the format used to encode the key, or null if it can not be encoded.

Specified by:
getFormat in interface Key
Returns:
String the receiver's encoding format

getEncoded

public byte[] getEncoded()
Description copied from interface: Key
Returns the encoded form of the receiver.

Specified by:
getEncoded in interface Key
Returns:
byte[] the encoded form of the receiver

hashCode

public int hashCode()
Description copied from class: Object
Returns an integer hash code for the receiver. Any two objects which answer true when passed to .equals must answer the same value for this method.

Overrides:
hashCode in class Object
Returns:
int the receiver's hash.
See Also:
Object.equals(java.lang.Object)

equals

public boolean equals(Object obj)
Description copied from class: Object
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. The implementation in Object returns true only if the argument is the exact same object as the receiver (==).

Overrides:
equals in class Object
Parameters:
obj - Object the object to compare with this object.
Returns:
boolean true if the object is the same as this object false if it is different from this object.
See Also:
Object.hashCode()

Build 1.0_r1(from source)

Please submit a feedback, bug or feature