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

Quick Search    Search Deep

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

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

public class SRPPublicKey
extends SRPKey
implements java.security.PublicKey

A representation of an SRP ephemeral public key.

Reference:

  1. SRP Protocol Design
    Thomas J. Wu.


Field Summary
private  java.math.BigInteger Y
          The public 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.PublicKey
serialVersionUID
 
Constructor Summary
(package private) SRPPublicKey(java.math.BigInteger[] params)
          Default constructor.
  SRPPublicKey(java.math.BigInteger N, java.math.BigInteger g, java.math.BigInteger Y)
          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 SRPPublicKeyand has the same SRP parameter values as this one.
 byte[] getEncoded(int format)
          Returns the encoded form of this public key according to the designated format.
 java.math.BigInteger getY()
          Returns the public exponent of the key as a java.math.BigInteger.
static SRPPublicKey valueOf(byte[] k)
          A class method that takes the output of the encodePublicKey() method of an SRP keypair codec object (an instance implementing gnu.java.security.key.IKeyPairCodec for SRP 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

Y

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

Constructor Detail

SRPPublicKey

public SRPPublicKey(java.math.BigInteger N,
                    java.math.BigInteger g,
                    java.math.BigInteger Y)

Public constructor for use from outside this package.


SRPPublicKey

SRPPublicKey(java.math.BigInteger[] params)

Default constructor. Assumes that N and g are already validated.

Method Detail

valueOf

public static SRPPublicKey valueOf(byte[] k)

A class method that takes the output of the encodePublicKey() method of an SRP keypair codec object (an instance implementing gnu.java.security.key.IKeyPairCodec for SRP keys, and re-constructs an instance of this object.


getY

public java.math.BigInteger getY()

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


getEncoded

public byte[] getEncoded(int format)

Returns the encoded form of this public 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 SRPPublicKeyand has the same SRP parameter values as this one.

Overrides:
equals in class SRPKey