SRPKey (GNU cryptographic primitives and tools)
Keywords: gnu.crypto.key.srp6.SRPKey,SRPKey class

Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
| 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

## gnu.crypto.key.srp6
Class SRPKey

    java.lang.Object
      |
      +--gnu.crypto.key.srp6.SRPKey

All Implemented Interfaces:
  java.security.Key, java.io.Serializable

Direct Known Subclasses:
  SRPPrivateKey, SRPPublicKey

public abstract class SRPKey
extends java.lang.Object
implements java.security.Key, java.io.Serializable

An abstract representation of a base SRP ephemeral key.

This object encapsulates the two numbers:

- N: A large safe prime (N = 2q+1, where q is prime).
- g: A generator modulo N.

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

Reference:

1. SRP Protocol Design
   Thomas J. Wu.

See Also:
  Serialized Form

Field Summary
`protected java.math.BigInteger` | `g` The generator.
`protected java.math.BigInteger` | `N` The public, Germaine prime, shared modulus.

Fields inherited from interface java.security.Key
`serialVersionUID`

Constructor Summary
`protected` | `SRPKey(java.math.BigInteger N, java.math.BigInteger g)`

Method Summary
`boolean` | `equals(java.lang.Object obj)` Returns `true` if the designated object is an instance of `SRPKey` and has the same SRP parameter values as this one.
`java.lang.String` | `getAlgorithm()` Returns the standard algorithm name for this key.
`byte[]` | `getEncoded()` Deprecated. see getEncoded(int).
`abstract byte[]` | `getEncoded(int format)`
`java.lang.String` | `getFormat()` Returns `null` since this implementation does not encode SRP keys.
`java.math.BigInteger` | `getG()` Returns the generator.
`java.math.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 java.math.BigInteger N

  The public, Germaine prime, shared modulus.

### g

    protected final java.math.BigInteger g

  The generator.

Constructor Detail

### SRPKey

    protected SRPKey(java.math.BigInteger N,
                     java.math.BigInteger g)

Method Detail

### getAlgorithm

    public java.lang.String getAlgorithm()

  Returns the standard algorithm name for this key.

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

### getEncoded

    public byte[] getEncoded()

  Deprecated. see getEncoded(int).

  Specified by:
    `getEncoded` in interface `java.security.Key`

### getFormat

    public java.lang.String getFormat()

  Returns `null` since this implementation does not encode SRP keys.

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

### getN

    public java.math.BigInteger getN()

  Returns the public shared modulus.

  Returns:
    `N`.

### getG

    public java.math.BigInteger getG()

  Returns the generator.

  Returns:
    `g`.

### equals

    public boolean equals(java.lang.Object obj)

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

  Overrides:
    `equals` in class `java.lang.Object`
  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)

Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
| 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

Copyright © 2001, 2002, 2003, 2004 Free Software Foundation, Inc.