public final class

PBKDF2HmacSHA1Factory

extends SecretKeyFactorySpi
java.lang.Object
   ↳ javax.crypto.SecretKeyFactorySpi
     ↳ com.sun.crypto.provider.PBKDF2HmacSHA1Factory

Class Overview

This class implements a key factory for PBE keys derived using PBKDF2 with HmacSHA1 psuedo random function(PRF) as defined in PKCS#5 v2.0.

Summary

Public Constructors
PBKDF2HmacSHA1Factory()
Verify the SunJCE provider in the constructor.
Protected Methods
SecretKey engineGenerateSecret(KeySpec keySpec)
Generates a SecretKey object from the provided key specification (key material).
KeySpec engineGetKeySpec(SecretKey key, Class keySpecCl)
Returns a specification (key material) of the given key in the requested format.
SecretKey engineTranslateKey(SecretKey key)
Translates a SecretKey object, whose provider may be unknown or potentially untrusted, into a corresponding SecretKey object of this key factory.
[Expand]
Inherited Methods
From class javax.crypto.SecretKeyFactorySpi
From class java.lang.Object

Public Constructors

public PBKDF2HmacSHA1Factory ()

Verify the SunJCE provider in the constructor.

Throws
SecurityException if fails to verify its own integrity

Protected Methods

protected SecretKey engineGenerateSecret (KeySpec keySpec)

Generates a SecretKey object from the provided key specification (key material).

Parameters
keySpec the specification (key material) of the secret key
Returns
  • the secret key
Throws
InvalidKeySpecException if the given key specification is inappropriate for this key factory to produce a public key.

protected KeySpec engineGetKeySpec (SecretKey key, Class keySpecCl)

Returns a specification (key material) of the given key in the requested format.

Parameters
key the key
keySpecCl the requested format in which the key material shall be returned
Returns
  • the underlying key specification (key material) in the requested format
Throws
InvalidKeySpecException if the requested key specification is inappropriate for the given key, or the given key cannot be processed (e.g., the given key has an unrecognized algorithm or format).

protected SecretKey engineTranslateKey (SecretKey key)

Translates a SecretKey object, whose provider may be unknown or potentially untrusted, into a corresponding SecretKey object of this key factory.

Parameters
key the key whose provider is unknown or untrusted
Returns
  • the translated key
Throws
InvalidKeyException if the given key cannot be processed by this key factory.