public final class

DHKeyFactory

extends KeyFactorySpi
java.lang.Object
   ↳ java.security.KeyFactorySpi
     ↳ com.sun.crypto.provider.DHKeyFactory

Class Overview

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

Summary

Public Constructors
DHKeyFactory()
Verify the SunJCE provider in the constructor.
Protected Methods
PrivateKey engineGeneratePrivate(KeySpec keySpec)
Generates a private key object from the provided key specification (key material).
PublicKey engineGeneratePublic(KeySpec keySpec)
Generates a public key object from the provided key specification (key material).
KeySpec engineGetKeySpec(Key key, Class keySpec)
Returns a specification (key material) of the given key object in the requested format.
Key engineTranslateKey(Key key)
Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.
[Expand]
Inherited Methods
From class java.security.KeyFactorySpi
From class java.lang.Object

Public Constructors

public DHKeyFactory ()

Verify the SunJCE provider in the constructor.

Throws
SecurityException if fails to verify its own integrity

Protected Methods

protected PrivateKey engineGeneratePrivate (KeySpec keySpec)

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

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

protected PublicKey engineGeneratePublic (KeySpec keySpec)

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

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

protected KeySpec engineGetKeySpec (Key key, Class keySpec)

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

Parameters
key the key
keySpec 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 Key engineTranslateKey (Key key)

Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key 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.