Most visited

Recently visited

Added in API level 1

SecretKeyFactorySpi

public abstract class SecretKeyFactorySpi
extends Object

java.lang.Object
   ↳ javax.crypto.SecretKeyFactorySpi


该类为SecretKeyFactory类定义了 ( SPI )。 该类中的所有抽象方法都必须由每个希望为特定算法提供秘密密钥工厂实现的加密服务提供者来实现。

提供商应记录其密钥工厂支持的所有关键规范。 例如,由“SunJCE”提供商提供的DES密钥工厂支持DESKeySpec作为DES密钥的透明表示,并且该提供商的Triple DES密钥的密钥工厂支持将DESedeKeySpec作为Triple DES密钥的透明表示。

也可以看看:

Summary

Public constructors

SecretKeyFactorySpi()

Protected methods

abstract SecretKey engineGenerateSecret(KeySpec keySpec)

根据提供的密钥规范(密钥材料)生成一个 SecretKey对象。

abstract KeySpec engineGetKeySpec(SecretKey key, Class keySpec)

以请求的格式返回给定键对象的规范(键材料)。

abstract SecretKey engineTranslateKey(SecretKey key)

将提供者可能未知或可能不可信的密钥对象转换为此密钥工厂的相应密钥对象。

Inherited methods

From class java.lang.Object

Public constructors

SecretKeyFactorySpi

Added in API level 1
SecretKeyFactorySpi ()

Protected methods

engineGenerateSecret

Added in API level 1
SecretKey engineGenerateSecret (KeySpec keySpec)

从提供的密钥规范(密钥材料)中生成一个 SecretKey对象。

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

engineGetKeySpec

Added in API level 1
KeySpec engineGetKeySpec (SecretKey key, 
                Class keySpec)

以请求的格式返回给定键对象的规范(键材料)。

Parameters
key SecretKey: the key
keySpec Class: the requested format in which the key material shall be returned
Returns
KeySpec the underlying key specification (key material) in the requested format
Throws
InvalidKeySpecException if the requested key specification is inappropriate for the given key (e.g., the algorithms associated with key and keySpec do not match, or key references a key on a cryptographic hardware device whereas keySpec is the specification of a software-based key), or the given key cannot be dealt with (e.g., the given key has an algorithm or format not supported by this secret-key factory).

engineTranslateKey

Added in API level 1
SecretKey engineTranslateKey (SecretKey key)

将提供者可能未知或可能不可信的密钥对象转换为此密钥工厂的相应密钥对象。

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

Hooray!