public final class

DESKeyFactory

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

Class Overview

This class implements the DES key factory of the Sun provider.

Summary

Public Constructors
DESKeyFactory()
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 keySpec)
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 DESKeyFactory ()

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 keySpec)

Returns a specification (key material) of the given key 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 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.