APIdia Launch Partner
Top Description Fields Constructors Methods
javax.crypto.spec

public Class DHPublicKeySpec

extends Object
implements KeySpec
Class Inheritance
All Implemented Interfaces
java.security.spec.KeySpec
Imports
java.math.BigInteger

This class specifies a Diffie-Hellman public key with its associated parameters.

Note that this class does not perform any validation on specified parameters. Thus, the specified values are returned directly even if they are null.

Author
Jan Luehe
Since
1.4
See Also
DHPrivateKeySpec

Field Summary

Modifier and TypeField and Description
private final BigInteger
g

private final BigInteger
p

private final BigInteger
y

Constructor Summary

AccessConstructor and Description
public
DHPublicKeySpec(BigInteger
public value y
y
,
BigInteger
prime modulus p
p
,
BigInteger
base generator g
g
)

Constructor that takes a public value y, a prime modulus p, and a base generator g.

Method Summary

Modifier and TypeMethod and Description
public BigInteger

Returns:

the base generator g
getG
()

Returns the base generator g.

public BigInteger

Returns:

the prime modulus p
getP
()

Returns the prime modulus p.

public BigInteger

Returns:

the public value y
getY
()

Returns the public value y.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

gback to summary
private final BigInteger g
pback to summary
private final BigInteger p
yback to summary
private final BigInteger y

Constructor Detail

DHPublicKeySpecback to summary
public DHPublicKeySpec(BigInteger y, BigInteger p, BigInteger g)

Constructor that takes a public value y, a prime modulus p, and a base generator g.

Parameters
y:BigInteger

public value y

p:BigInteger

prime modulus p

g:BigInteger

base generator g

Method Detail

getGback to summary
public BigInteger getG()

Returns the base generator g.

Returns:BigInteger

the base generator g

getPback to summary
public BigInteger getP()

Returns the prime modulus p.

Returns:BigInteger

the prime modulus p

getYback to summary
public BigInteger getY()

Returns the public value y.

Returns:BigInteger

the public value y