public abstract class KeyGeneratorSpi
extends Object
| java.lang.Object | |
| javax.crypto.KeyGeneratorSpi | |
该类定义了KeyGenerator类的 ( SPI )。 该类中的所有抽象方法都必须由每个希望为特定算法提供密钥生成器实现的加密服务提供者来实现。
也可以看看:
Public constructors |
|
|---|---|
KeyGeneratorSpi() |
|
Protected methods |
|
|---|---|
abstract SecretKey |
engineGenerateKey() 生成一个密钥。 |
abstract void |
engineInit(AlgorithmParameterSpec params, SecureRandom random) 使用指定的参数集和用户提供的随机源初始化密钥生成器。 |
abstract void |
engineInit(SecureRandom random) 初始化密钥生成器。 |
abstract void |
engineInit(int keysize, SecureRandom random) 使用给定的随机源,初始化此密钥生成器的某个密钥大小。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
SecretKey engineGenerateKey ()
生成一个密钥。
| 返回(Returns) | |
|---|---|
SecretKey |
the new key |
void engineInit (AlgorithmParameterSpec params, SecureRandom random)
使用指定的参数集和用户提供的随机源初始化密钥生成器。
| 参数(Parameters) | |
|---|---|
params |
AlgorithmParameterSpec: the key generation parameters |
random |
SecureRandom: the source of randomness for this key generator |
| 抛出异常(Throws) | |
|---|---|
InvalidAlgorithmParameterException |
if params is inappropriate for this key generator |
void engineInit (SecureRandom random)
初始化密钥生成器。
| 参数(Parameters) | |
|---|---|
random |
SecureRandom: the source of randomness for this generator |
void engineInit (int keysize,
SecureRandom random)
使用给定的随机源,初始化此密钥生成器的某个密钥大小。
| 参数(Parameters) | |
|---|---|
keysize |
int: the keysize. This is an algorithm-specific metric, specified in number of bits. |
random |
SecureRandom: the source of randomness for this key generator |
| 抛出异常(Throws) | |
|---|---|
InvalidParameterException |
if the keysize is wrong or not supported. |