Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.javax.crypto.key.srp6
Class SRPPrivateKey  view SRPPrivateKey download SRPPrivateKey.java

java.lang.Object
  extended bygnu.javax.crypto.key.srp6.SRPKey
      extended bygnu.javax.crypto.key.srp6.SRPPrivateKey
All Implemented Interfaces:
java.security.Key, java.security.PrivateKey, java.io.Serializable

public class SRPPrivateKey
extends SRPKey
implements java.security.PrivateKey

A representation of an SRP ephemeral private key.

Reference:

  1. SRP Protocol Design
    Thomas J. Wu.


Field Summary
private  java.math.BigInteger v
          The user's verifier (v) --for the server-- also computed at the client side as g.modPow(x, N), where x is the hashed output of the user name and password .
private  java.math.BigInteger X
          The private exponent for either the server or the client engaged in the SRP protocol exchange.
 
Fields inherited from class gnu.javax.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 java.math.BigInteger.
 java.math.BigInteger getX()
          Returns the private exponent of the key as a java.math.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 gnu.java.security.key.IKeyPairCodec for DSS keys, and re-constructs an instance of this object.
 
Methods inherited from class gnu.javax.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
 

Field Detail

X

private final java.math.BigInteger X
The private exponent for either the server or the client engaged in the SRP protocol exchange.


v

private final java.math.BigInteger v
The user's verifier (v) --for the server-- also computed at the client side as g.modPow(x, N), where x is the hashed output of the user name and password .

Constructor Detail

SRPPrivateKey

public SRPPrivateKey(java.math.BigInteger N,
                     java.math.BigInteger g,
                     java.math.BigInteger x)

Public constructor for use from outside this package.


SRPPrivateKey

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.


SRPPrivateKey

SRPPrivateKey(java.math.BigInteger[] params)

Default constructor. Assumes N and g are already validated.

Method Detail

valueOf

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 gnu.java.security.key.IKeyPairCodec for DSS keys, and re-constructs an instance of this object.


getX

public java.math.BigInteger getX()

Returns the private exponent of the key as a java.math.BigInteger.


getV

public java.math.BigInteger getV()

Returns the user's verifier as a java.math.BigInteger.


getEncoded

public byte[] getEncoded(int format)

Returns the encoded form of this private key according to the designated format.

Specified by:
getEncoded in class SRPKey

equals

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.

Overrides:
equals in class SRPKey