APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.crypto.provider

pack-priv abstract Class PBKDF2Core

extends SecretKeyFactorySpi
Class Inheritance
Known Direct Subclasses
com.sun.crypto.provider.PBKDF2Core.HmacSHA1, com.sun.crypto.provider.PBKDF2Core.HmacSHA224, com.sun.crypto.provider.PBKDF2Core.HmacSHA256, com.sun.crypto.provider.PBKDF2Core.HmacSHA384, com.sun.crypto.provider.PBKDF2Core.HmacSHA512, com.sun.crypto.provider.PBKDF2Core.HmacSHA512_224, com.sun.crypto.provider.PBKDF2Core.HmacSHA512_256
Imports
java.security.InvalidKeyException, java.security.spec.KeySpec, .InvalidKeySpecException, java.util.Arrays, javax.crypto.SecretKey, .SecretKeyFactorySpi, javax.crypto.spec.PBEKeySpec

This class implements a key factory for PBE keys derived using PBKDF2 with HmacSHA1, HmacSHA224, HmacSHA256, HmacSHA384, HmacSHA512, HmacSHA512/224, and HmacSHA512/256 pseudo random function (PRF) as defined in PKCS#5 v2.1.
Author
Valerie Peng

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class
public static class
public static class
public static class
public static class

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
PBKDF2Core(String prfAlgo)

Method Summary

Modifier and TypeMethod and Description
protected SecretKey

Returns:

the secret key
engineGenerateSecret
(KeySpec
the specification (key material) of the secret key
keySpec
)

Implements abstract javax.crypto.SecretKeyFactorySpi.engineGenerateSecret.

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

protected KeySpec

Returns:

the underlying key specification (key material) in the requested format
engineGetKeySpec
(SecretKey
the key
key
,
Class<?>
the requested format in which the key material shall be returned
keySpecCl
)

Implements abstract javax.crypto.SecretKeyFactorySpi.engineGetKeySpec.

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

protected SecretKey

Returns:

the translated key
engineTranslateKey
(SecretKey
the key whose provider is unknown or untrusted
key
)

Implements abstract javax.crypto.SecretKeyFactorySpi.engineTranslateKey.

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

Field Detail

prfAlgoback to summary
private final String prfAlgo

Constructor Detail

PBKDF2Coreback to summary
pack-priv PBKDF2Core(String prfAlgo)

Method Detail

engineGenerateSecretback to summary
protected SecretKey engineGenerateSecret(KeySpec keySpec) throws InvalidKeySpecException

Implements abstract javax.crypto.SecretKeyFactorySpi.engineGenerateSecret.

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

Parameters
keySpec:KeySpec

the specification (key material) of the secret key

Returns:SecretKey

the secret key

Exceptions
InvalidKeySpecException:
if the given key specification is inappropriate for this key factory to produce a public key.
engineGetKeySpecback to summary
protected KeySpec engineGetKeySpec(SecretKey key, Class<?> keySpecCl) throws InvalidKeySpecException

Implements abstract javax.crypto.SecretKeyFactorySpi.engineGetKeySpec.

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

Parameters
key:SecretKey

the key

keySpecCl:Class<?>

the requested format in which the key material shall be returned

Returns:KeySpec

the underlying key specification (key material) in the requested format

Exceptions
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).
engineTranslateKeyback to summary
protected SecretKey engineTranslateKey(SecretKey key) throws InvalidKeyException

Implements abstract javax.crypto.SecretKeyFactorySpi.engineTranslateKey.

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

Parameters
key:SecretKey

the key whose provider is unknown or untrusted

Returns:SecretKey

the translated key

Exceptions
InvalidKeyException:
if the given key cannot be processed by this key factory.
com.sun.crypto.provider back to summary

public final Class PBKDF2Core.HmacSHA1

extends PBKDF2Core
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBKDF2Core:
engineGenerateSecretengineGetKeySpecengineTranslateKey

Constructor Detail

HmacSHA1back to summary
public HmacSHA1()
com.sun.crypto.provider back to summary

public final Class PBKDF2Core.HmacSHA224

extends PBKDF2Core
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBKDF2Core:
engineGenerateSecretengineGetKeySpecengineTranslateKey

Constructor Detail

HmacSHA224back to summary
public HmacSHA224()
com.sun.crypto.provider back to summary

public final Class PBKDF2Core.HmacSHA256

extends PBKDF2Core
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBKDF2Core:
engineGenerateSecretengineGetKeySpecengineTranslateKey

Constructor Detail

HmacSHA256back to summary
public HmacSHA256()
com.sun.crypto.provider back to summary

public final Class PBKDF2Core.HmacSHA384

extends PBKDF2Core
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBKDF2Core:
engineGenerateSecretengineGetKeySpecengineTranslateKey

Constructor Detail

HmacSHA384back to summary
public HmacSHA384()
com.sun.crypto.provider back to summary

public final Class PBKDF2Core.HmacSHA512

extends PBKDF2Core
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBKDF2Core:
engineGenerateSecretengineGetKeySpecengineTranslateKey

Constructor Detail

HmacSHA512back to summary
public HmacSHA512()
com.sun.crypto.provider back to summary

public final Class PBKDF2Core.HmacSHA512_224

extends PBKDF2Core
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBKDF2Core:
engineGenerateSecretengineGetKeySpecengineTranslateKey

Constructor Detail

HmacSHA512_224back to summary
public HmacSHA512_224()
com.sun.crypto.provider back to summary

public final Class PBKDF2Core.HmacSHA512_256

extends PBKDF2Core
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBKDF2Core:
engineGenerateSecretengineGetKeySpecengineTranslateKey

Constructor Detail

HmacSHA512_256back to summary
public HmacSHA512_256()