For the latest news and information visit
The GNU Crypto project

gnu.crypto.key.srp6
Class SRPKey

java.lang.Object
  extended bygnu.crypto.key.srp6.SRPKey
All Implemented Interfaces:
Key, Serializable
Direct Known Subclasses:
SRPPrivateKey, SRPPublicKey

public abstract class SRPKey
extends Object
implements Key, Serializable

An abstract representation of a base SRP ephemeral key.

This object encapsulates the two numbers:

Note that in SRP, all arithmetic is done modulo N.

Reference:

  1. SRP Protocol Design
    Thomas J. Wu.

Version:
$Revision: 1.2 $
See Also:
Serialized Form

Field Summary
protected  BigInteger g
          The generator.
protected  BigInteger N
          The public, Germaine prime, shared modulus.
 
Fields inherited from interface java.security.Key
serialVersionUID
 
Constructor Summary
protected SRPKey(BigInteger N, BigInteger g)
           
 
Method Summary
 boolean equals(Object obj)
          Returns true if the designated object is an instance of SRPKey and has the same SRP parameter values as this one.
 String getAlgorithm()
          Returns the standard algorithm name for this key.
 byte[] getEncoded()
          Deprecated. see getEncoded(int).
abstract  byte[] getEncoded(int format)
           
 String getFormat()
          Returns null since this implementation does not encode SRP keys.
 BigInteger getG()
          Returns the generator.
 BigInteger getN()
          Returns the public shared modulus.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

N

protected final BigInteger N
The public, Germaine prime, shared modulus.


g

protected final BigInteger g
The generator.

Constructor Detail

SRPKey

protected SRPKey(BigInteger N,
                 BigInteger g)
Method Detail

getAlgorithm

public String getAlgorithm()

Returns the standard algorithm name for this key.

Specified by:
getAlgorithm in interface Key
Returns:
the standard algorithm name for this key.

getEncoded

public byte[] getEncoded()
Deprecated. see getEncoded(int).

Specified by:
getEncoded in interface Key

getFormat

public String getFormat()

Returns null since this implementation does not encode SRP keys.

Specified by:
getFormat in interface Key
Returns:
null since this implementation does not encode SRP keys.

getN

public BigInteger getN()

Returns the public shared modulus.

Returns:
N.

getG

public BigInteger getG()

Returns the generator.

Returns:
g.

equals

public boolean equals(Object obj)

Returns true if the designated object is an instance of SRPKey and has the same SRP parameter values as this one.

Parameters:
obj - the other non-null SRP key to compare to.
Returns:
true if the designated object is of the same type and value as this one.

getEncoded

public abstract byte[] getEncoded(int format)

For the latest news and information visit
The GNU Crypto project

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.