SecretKeySpec

public class SecretKeySpec extends Object
implements KeySpec SecretKey

This class specifies a secret key in a provider-independent fashion.

It can be used to construct a SecretKey from a byte array, without having to go through a (provider-based) SecretKeyFactory.

This class is only useful for raw secret keys that can be represented as a byte array and have no key parameters associated with them, e.g., DES or Triple DES keys.

Inherited Constant Summary

Public Constructor Summary

SecretKeySpec(byte[] key, String algorithm)
Constructs a secret key from the given byte array.
SecretKeySpec(byte[] key, int offset, int len, String algorithm)
Constructs a secret key from the given byte array, using the first len bytes of key, starting at offset inclusive.

Public Method Summary

boolean
equals(Object obj)
Tests for equality between the specified object and this object.
String
getAlgorithm()
Returns the name of the algorithm associated with this secret key.