public class DHParameterSpec
extends Object implements AlgorithmParameterSpec
| java.lang.Object | |
| javax.crypto.spec.DHParameterSpec | |
此类指定与Diffie-Hellman算法一起使用的参数集,如PKCS#3: Diffie-Hellman密钥协议标准中所述 。
中央机构生成参数并将它们提供给寻求生成密钥的两个实体。 参数是素数p ,基数g ,以及可选的私有值的位长度l 。
一个给定的中央机构可能会产生多于一个的参数实例,并且可能有多个中央机构。 事实上,每个人都可能是自己的中央权威,不同的实体具有不同的参数。
请注意,此类不会对指定的参数执行任何验证。 因此,即使它们为空,指定的值也会直接返回。
也可以看看:
Public constructors |
|
|---|---|
DHParameterSpec(BigInteger p, BigInteger g) 使用质数模 |
|
DHParameterSpec(BigInteger p, BigInteger g, int l) 使用质数模 |
|
公共方法(Public methods) |
|
|---|---|
BigInteger |
getG() 返回基本生成器 |
int |
getL() 返回随机指数(私有值)的大小(位数 |
BigInteger |
getP() 返回质数模 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
DHParameterSpec (BigInteger p, BigInteger g)
使用主模数 p和基本生成器 g为Diffie-Hellman构建参数集。
| 参数(Parameters) | |
|---|---|
p |
BigInteger: the prime modulus |
g |
BigInteger: the base generator |
DHParameterSpec (BigInteger p, BigInteger g, int l)
使用质数模 p ,基生成器 g和随机指数(私有值)的位数 l构造Diffie-Hellman的参数集。
| 参数(Parameters) | |
|---|---|
p |
BigInteger: the prime modulus |
g |
BigInteger: the base generator |
l |
int: the size in bits of the random exponent (private value) |
BigInteger getG ()
返回基本生成器 g 。
| 返回(Returns) | |
|---|---|
BigInteger |
the base generator g |
int getL ()
返回随机指数(私有值)的大小(位数 l )。
| 返回(Returns) | |
|---|---|
int |
the size in bits, l, of the random exponent (private value), or 0 if this size has not been set |