|
For the latest news and information visit The GNU Crypto project |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.crypto.key.srp6.SRPKey gnu.crypto.key.srp6.SRPPrivateKey
A representation of an SRP ephemeral private key.
Reference:
Field Summary |
Fields inherited from class gnu.crypto.key.srp6.SRPKey |
g, N |
Fields inherited from interface java.security.PrivateKey |
serialVersionUID |
Constructor Summary | |
(package private) |
SRPPrivateKey(java.math.BigInteger[] params)
Default constructor. |
|
SRPPrivateKey(java.math.BigInteger N,
java.math.BigInteger g,
java.math.BigInteger x)
Public constructor for use from outside this package. |
|
SRPPrivateKey(java.math.BigInteger N,
java.math.BigInteger g,
java.math.BigInteger x,
java.math.BigInteger v)
Public constructor for use from outside this package. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
Returns true if the designated object is an instance of
SRPPrivateKey and has the same SRP parameter values as this
one. |
byte[] |
getEncoded(int format)
Returns the encoded form of this private key according to the designated format. |
java.math.BigInteger |
getV()
Returns the user's verifier as a BigInteger . |
java.math.BigInteger |
getX()
Returns the private exponent of the key as a BigInteger . |
static SRPPrivateKey |
valueOf(byte[] k)
A class method that takes the output of the encodePrivateKey()
method of an SRP keypair codec object (an instance implementing
IKeyPairCodec for DSS keys, and re-constructs an instance of this
object. |
Methods inherited from class gnu.crypto.key.srp6.SRPKey |
getAlgorithm, getEncoded, getFormat, getG, getN |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.security.Key |
getAlgorithm, getEncoded, getFormat |
Constructor Detail |
public SRPPrivateKey(java.math.BigInteger N, java.math.BigInteger g, java.math.BigInteger x)
Public constructor for use from outside this package.
N
- the public shared modulus.g
- the generator.x
- the private exponent of the ephemeral key.public SRPPrivateKey(java.math.BigInteger N, java.math.BigInteger g, java.math.BigInteger x, java.math.BigInteger v)
Public constructor for use from outside this package.
N
- the public shared modulus.g
- the generator.x
- the private exponent of the ephemeral key.v
- the user's verifier value (for the server side only).SRPPrivateKey(java.math.BigInteger[] params)
Default constructor. Assumes N and g are already validated.
params
- an array of either 3 or 4 values representing N, g, and
either v and X for the server, or just X for the client. Those values
represent the following:
Method Detail |
public static SRPPrivateKey valueOf(byte[] k)
A class method that takes the output of the encodePrivateKey()
method of an SRP keypair codec object (an instance implementing
IKeyPairCodec
for DSS keys, and re-constructs an instance of this
object.
k
- the contents of a previously encoded instance of this object.
java.lang.ArrayIndexOutOfBoundsException
- if there is not enough bytes, in
k
, to represent a valid encoding of an instance of this object.
java.lang.IllegalArgumentException
- if the byte sequence does not represent a
valid encoding of an instance of this object.public java.math.BigInteger getX()
Returns the private exponent of the key as a BigInteger
.
BigInteger
.public java.math.BigInteger getV()
Returns the user's verifier as a BigInteger
.
BigInteger
if this is an SRP
private key of a Host, or null
if this is a private SRP key
for a User.public byte[] getEncoded(int format)
Returns the encoded form of this private key according to the designated format.
getEncoded
in class SRPKey
format
- the desired format identifier of the resulting encoding.
java.lang.IllegalArgumentException
- if the format is not supported.public boolean equals(java.lang.Object obj)
Returns true
if the designated object is an instance of
SRPPrivateKey
and has the same SRP parameter values as this
one.
equals
in class SRPKey
obj
- the other non-null SRP key to compare to.
true
if the designated object is of the same type and
value as this one.
|
For the latest news and information visit The GNU Crypto project |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |