|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--javax.crypto.SecretKeyFactory
Key factory for secret keys.
Attention: This is not a SUN implementation!
This class has been developed by IAIK according to the documentation publically available.
For SUNīs documentation of this class see
http://java.sun.com/security/JCE1.2/spec/apidoc/index.html
This class represents a factory for secret keys, as used by symmetric ciphers. Keys may appear in two representations within the Java Security environment:
java.security.Key
DESKeySpec
SecretKey factories are used for converting keys from one representation into the other.
To convert, for instance, DES key material (e.g. des_key_spec instantiated
from DESKeySpec) from transparent to opaque representation, use the
SecretKeyFactory for DES keys (if supported by the actual provider):
SecretKeyFactory des_key_fac = SecretKeyFactory.getInstance("DES");
SecretKey des_key = des_key_fac.generateSecret(des_key_spec);
SecretKey,
DESKeySpec,
DESedeKeySpec,
PBEKeySpec| Constructor Summary | |
protected |
SecretKeyFactory(SecretKeyFactorySpi keyFacSpi,
Provider provider,
java.lang.String algorithm)
Creates a SecretKeyFactory object. |
| Method Summary | |
SecretKey |
generateSecret(KeySpec keySpec)
Converts the given key specification (key material) into a SecretKey object. |
java.lang.String |
getAlgorithm()
Returns the standard name of the key algorithm. |
static SecretKeyFactory |
getInstance(java.lang.String algorithm)
Returns the default provider SecretKeyFactory object for the specified symmetric algorithm. |
static SecretKeyFactory |
getInstance(java.lang.String algorithm,
java.lang.String provider)
Returns a SecretKeyFactory object for the specified symmetric algorithm, implemented by the given provider. |
KeySpec |
getKeySpec(SecretKey key,
java.lang.Class keySpec)
Converts the given secret key into the requested key specification (key material). |
Provider |
getProvider()
Returns the provider used for creating this SecretKeyFactory object. |
SecretKey |
translateKey(SecretKey key)
Translates a key object of some unknown or untrusted provider into a secret key object of this key factory. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
protected SecretKeyFactory(SecretKeyFactorySpi keyFacSpi,
Provider provider,
java.lang.String algorithm)
getInstance factory methods for obtaining a SecretKeyFactory object.keyFacSpi - the SPI SecretKeyFactory implementation of the actual providerprovider - the provider| Method Detail |
public static final SecretKeyFactory getInstance(java.lang.String algorithm)
throws NoSuchAlgorithmException
algorithm - the standard name of the symmetric algorithm, e.g. "DES
public static final SecretKeyFactory getInstance(java.lang.String algorithm,
java.lang.String provider)
throws NoSuchAlgorithmException,
NoSuchProviderException
algorithm - the standard name of the symmetric algorithm, e.g. "DESprovider - the name of the requested provider.public final Provider getProvider()
public final java.lang.String getAlgorithm()
public final SecretKey generateSecret(KeySpec keySpec)
throws InvalidKeySpecException
keySpec - the specification (key material) to be converted into SecretKey representation.
public final KeySpec getKeySpec(SecretKey key,
java.lang.Class keySpec)
throws InvalidKeySpecException
key - the secret key to be converted.keySpec - the key specification type into which the secret key shall be converted
public SecretKey translateKey(SecretKey key)
throws InvalidKeyException
key - the key of some unknown or untrusted provider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||