IAIK ECC
version 2.18

iaik.security.ecc.ecdsa
Class ECDSAParameter

java.lang.Object
  extended byiaik.security.ecc.ecdsa.ECDSAParameter
All Implemented Interfaces:
ECDSAParams

public class ECDSAParameter
extends java.lang.Object
implements ECDSAParams

Specifies the domain parameter for the ecc algorithms. This class doesn't perform a parameter validation. Subclasses may add this feature.

The domain parameters are:

  • the base point G, which is a generator of the subgroup
  • the order of the subgroup r
  • if known, the co-factor k which is #E / r. (#E defines the number of points on the elliptic curve) Use the provided parameter factories in this package to get an instance of this class.


    Field Summary
    protected  java.math.BigInteger c_
              the output c of the SHA-1 based algorithm
    protected static boolean DEFAULT_OID_ENCODING
              Indicates if the domain parameters should be referenced by their oids (whenever possible) or explicitely specified.
    static iaik.asn1.INTEGER ECDSA_PARAMETER_VERSION
              The version field in the ECDSA ASN.1 structure
    protected  ECPoint g_
              the base point
    protected  java.math.BigInteger k_
              the cofactor = #E / r
    protected  java.lang.String oid_
              The Object Identifier for these domain parameters or null if not defined.
    protected  java.math.BigInteger r_
              the order of the base point g_
    protected  java.math.BigInteger s_
              the 160-bit input seed s to the SHA-1 based algorithm
     
    Constructor Summary
    protected ECDSAParameter()
              Subclasses use this constructor
      ECDSAParameter(ECCParameterSpec parameter)
              Creates an ECDSA parameter set from the given ECC parameters.
      ECDSAParameter(ECCParameterSpec parameter, int coordinates)
              Creates an ECDSA parameter set from the given ECC parameters.
     
    Method Summary
     boolean equals(java.lang.Object other)
              Compares 2 Parameters.
     java.math.BigInteger getC()
               
    static boolean getDefaultOIDEncoding()
              This method returns the default encoding policy (ECDSA domain parameters may be specified either explicitely or just as oid).
     ECPoint getG()
              The generator of the subgroub of order r.
     java.math.BigInteger getK()
               
     java.lang.String getOID()
               
     java.math.BigInteger getR()
               
     java.math.BigInteger getS()
               
     int hashCode()
              Returns the hash code of this ECDSAParameters.
    static void setDefaultOIDEncoding(boolean useOID)
              Sets the default parameter encoding.
     iaik.asn1.ASN1Object toASN1Object()
              If the default encoding is set to oid encoding this method just returns the ObjectID otherwise the following ASN.1 structure: ECParameters ::= SEQUENCE { -- Elliptic curve parameters version ECPVer, fieldID FieldID, curve Curve, base ECPoint, -- Base point G order INTEGER, -- Order n of the base point cofactor INTEGER OPTIONAL, -- The integer h = #E(Fq)/n }
     java.lang.String toString()
               
     
    Methods inherited from class java.lang.Object
    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
     

    Field Detail

    ECDSA_PARAMETER_VERSION

    public static final iaik.asn1.INTEGER ECDSA_PARAMETER_VERSION
    The version field in the ECDSA ASN.1 structure

    See Also:
    toASN1Object()

    DEFAULT_OID_ENCODING

    protected static boolean DEFAULT_OID_ENCODING
    Indicates if the domain parameters should be referenced by their oids (whenever possible) or explicitely specified. The default settings use reference by oid.


    c_

    protected java.math.BigInteger c_
    the output c of the SHA-1 based algorithm


    g_

    protected ECPoint g_
    the base point


    k_

    protected java.math.BigInteger k_
    the cofactor = #E / r


    oid_

    protected java.lang.String oid_
    The Object Identifier for these domain parameters or null if not defined.


    r_

    protected java.math.BigInteger r_
    the order of the base point g_


    s_

    protected java.math.BigInteger s_
    the 160-bit input seed s to the SHA-1 based algorithm

    Constructor Detail

    ECDSAParameter

    public ECDSAParameter(ECCParameterSpec parameter)
                   throws ECCException
    Creates an ECDSA parameter set from the given ECC parameters. The default coordinates will be used.

    Parameters:
    parameter - the given parameters (must be a valid set of parameters !!)
    Throws:
    ECCException - if the ec group instantiation failed.

    ECDSAParameter

    public ECDSAParameter(ECCParameterSpec parameter,
                          int coordinates)
                   throws ECCException
    Creates an ECDSA parameter set from the given ECC parameters.

    Parameters:
    parameter - the given parameters (must be a valid set of parameters !!)
    coordinates - decides, which type of coordinates to use. One of the constants defined in this class.
    Throws:
    ECCException - if the ec group instantiation failed.

    ECDSAParameter

    protected ECDSAParameter()
    Subclasses use this constructor

    Method Detail

    getDefaultOIDEncoding

    public static boolean getDefaultOIDEncoding()
    This method returns the default encoding policy (ECDSA domain parameters may be specified either explicitely or just as oid). The start-up setting is rferencing parameters by their oid.

    Returns:
    true if the parameters are referenced by oid (whenever possible)

    setDefaultOIDEncoding

    public static void setDefaultOIDEncoding(boolean useOID)
    Sets the default parameter encoding.

    Parameters:
    useOID - if true (default) the domain parameters are referenced by their oid (if possible)

    equals

    public boolean equals(java.lang.Object other)
    Compares 2 Parameters.

    Parameters:
    other - the other parameter, must be an instance of this class otherwise false will be returned.
    Returns:
    true if the base points G and both orders r are equal.

    getC

    public java.math.BigInteger getC()
    Specified by:
    getC in interface ECDSAParams
    Returns:
    the output c of the SHA-1 based algorithm or null if unkonown

    getG

    public ECPoint getG()
    Description copied from interface: ECDSAParams
    The generator of the subgroub of order r.

    Specified by:
    getG in interface ECDSAParams
    Returns:
    the base point G of order r.
    See Also:
    ECDSAParams.getR()

    getK

    public java.math.BigInteger getK()
    Specified by:
    getK in interface ECDSAParams
    Returns:
    the cofactor k = #E / r or null if not known.

    getOID

    public java.lang.String getOID()
    Specified by:
    getOID in interface ECDSAParams
    Returns:
    the oid of this parameter set or null if unknown

    getR

    public java.math.BigInteger getR()
    Specified by:
    getR in interface ECDSAParams
    Returns:
    the order r of the base point G.

    getS

    public java.math.BigInteger getS()
    Specified by:
    getS in interface ECDSAParams
    Returns:
    the 160-bit input seed s to the SHA-1 based algorithm or null if unknown

    hashCode

    public int hashCode()
    Returns the hash code of this ECDSAParameters.

    Returns:
    the hash code of this ECDSAParameters.

    toASN1Object

    public iaik.asn1.ASN1Object toASN1Object()
    If the default encoding is set to oid encoding this method just returns the ObjectID otherwise the following ASN.1 structure:
     ECParameters  ::= SEQUENCE {            -- Elliptic curve parameters
      version   ECPVer,
      fieldID   FieldID,
      curve     Curve,
      base      ECPoint,                   -- Base point G
      order     INTEGER,                   -- Order n of the base point
      cofactor  INTEGER  OPTIONAL,         -- The integer h = #E(Fq)/n
     }
     


    toString

    public java.lang.String toString()
    Returns:
    a human readable string containing the base point, the order r, and the elliptic curve.

    IAIK ECC
    version 2.18

    IAIK-ECC 2.18, (c) 2002 IAIK, (c) 2003 SIC