public abstract class SecretKeyFactorySpi extends Object
SecretKeyFactory
类。在这个类中的所有的抽象方法必须实现由每个密码服务提供商,谁希望提供一个特定的算法的密钥工厂的实施。
供应商应记录其密钥工厂所支持的所有关键技术指标。例如,DES密钥厂以“sunjce提供者”支持DESKeySpec
作为一个透明的DES密钥表示,供应商提供的密钥对DES密钥支持DESedeKeySpec
工厂作为一个透明的DES密钥表示。
SecretKey
,
DESKeySpec
,
DESedeKeySpec
Constructor and Description |
---|
SecretKeyFactorySpi() |
Modifier and Type | Method and Description |
---|---|
protected abstract SecretKey |
engineGenerateSecret(KeySpec keySpec)
从提供的关键指标产生
SecretKey 对象(关键材料)。
|
protected abstract KeySpec |
engineGetKeySpec(SecretKey key, 类<?> keySpec)
返回指定的关键对象的规范(关键材料)的要求的格式。
|
protected abstract SecretKey |
engineTranslateKey(SecretKey key)
翻译的重点对象,其供应商可能是未知的或潜在的不受信任的,在相应的关键对象这秘密工厂。
|
protected abstract SecretKey engineGenerateSecret(KeySpec keySpec) throws InvalidKeySpecException
SecretKey
对象(关键材料)。
keySpec
-规范(主要材料)的密钥
InvalidKeySpecException
-如果给定的主要指标是不适合这个密钥的工厂生产一个密钥。
protected abstract KeySpec engineGetKeySpec(SecretKey key, 类<?> keySpec) throws InvalidKeySpecException
key
的关键
keySpec
-请求的格式中的关键材料应退还
InvalidKeySpecException
如果请求的主要指标是不适合给定的键(例如,与
key
和
keySpec
相关的算法不匹配,或
key
参考加密硬件设备而
keySpec
是一个基于软件的关键)的规范重点,或给定的键无法处理(例如,给定的关键一个算法的密钥厂或不支持的格式)。
protected abstract SecretKey engineTranslateKey(SecretKey key) throws InvalidKeyException
key
-关键的供应商是未知或不可信
InvalidKeyException
如果给定键不能用这个密钥的工厂加工。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.