Android
javax.crypto.spec
public class

javax.crypto.spec.SecretKeySpec

java.lang.Object
javax.crypto.spec.SecretKeySpec Serializable KeySpec SecretKey

Summary

Constants inherited from interface java.security.Key
Constants inherited from interface javax.crypto.SecretKey

Public Constructors

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

Public Methods

          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
Methods inherited from interface java.security.Key

Details

Public Constructors

public SecretKeySpec(byte[] key, String algorithm)

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

Public Methods

public boolean equals(Object obj)

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 (==).

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.

public String getAlgorithm()

Returns the name of the algorithm that this key will work with. If the algorithm is unknown, it returns null.

public byte[] getEncoded()

Returns the encoded form of the receiver.

public String getFormat()

Returns the name of the format used to encode the key, or null if it can not be encoded.

public int hashCode()

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.

Returns

  • int the receiver's hash.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56