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

public final Class DHKeyFactory

extends KeyFactorySpi
Class Inheritance
Imports
java.security.Key, .PublicKey, .PrivateKey, .KeyFactorySpi, .InvalidKeyException, java.security.spec.KeySpec, .InvalidKeySpecException, .X509EncodedKeySpec, .PKCS8EncodedKeySpec, java.util.Arrays, javax.crypto.spec.DHPublicKeySpec, .DHPrivateKeySpec, .DHParameterSpec

This class implements the Diffie-Hellman key factory of the Sun provider.
Author
Jan Luehe

Constructor Summary

AccessConstructor and Description
public
DHKeyFactory()

Empty constructor

Method Summary

Modifier and TypeMethod and Description
protected PrivateKey

Returns:

the private key
engineGeneratePrivate
(KeySpec
the specification (key material) of the private key
keySpec
)

Implements abstract java.security.KeyFactorySpi.engineGeneratePrivate.

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

protected PublicKey

Returns:

the public key
engineGeneratePublic
(KeySpec
the specification (key material) of the public key
keySpec
)

Implements abstract java.security.KeyFactorySpi.engineGeneratePublic.

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

protected <T extends KeySpec> T

Returns:

the underlying key specification (key material) in the requested format
engineGetKeySpec
(Key
the key
key
,
Class<T>
the requested format in which the key material shall be returned
keySpec
)

Implements abstract java.security.KeyFactorySpi.engineGetKeySpec.

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

protected Key

Returns:

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

Implements abstract java.security.KeyFactorySpi.engineTranslateKey.

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

Constructor Detail

DHKeyFactoryback to summary
public DHKeyFactory()

Empty constructor

Method Detail

engineGeneratePrivateback to summary
protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException

Implements abstract java.security.KeyFactorySpi.engineGeneratePrivate.

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

Parameters
keySpec:KeySpec

the specification (key material) of the private key

Returns:PrivateKey

the private key

Exceptions
InvalidKeySpecException:
if the given key specification is inappropriate for this key factory to produce a private key.
engineGeneratePublicback to summary
protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException

Implements abstract java.security.KeyFactorySpi.engineGeneratePublic.

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

Parameters
keySpec:KeySpec

the specification (key material) of the public key

Returns:PublicKey

the public key

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

Implements abstract java.security.KeyFactorySpi.engineGetKeySpec.

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

Parameters
key:Key

the key

keySpec:Class<T>

the requested format in which the key material shall be returned

Returns:T

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 Key engineTranslateKey(Key key) throws InvalidKeyException

Implements abstract java.security.KeyFactorySpi.engineTranslateKey.

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

Parameters
key:Key

the key whose provider is unknown or untrusted

Returns:Key

the translated key

Exceptions
InvalidKeyException:
if the given key cannot be processed by this key factory.