Class ECParameters

java.lang.Object
java.security.AlgorithmParametersSpi
com.ibm.crypto.hdwrCCA.provider.ECParameters

public final class ECParameters extends AlgorithmParametersSpi
This class is used as an opaque representation of Elliptic Curve parameters and implements encoding and decoding of Elliptic Curve parameters as specified in RFC 3279. ASN.1 definition from RFC 3279. Note that X9.62 (2005) has added some additional options.

   
   EcpkParameters ::= CHOICE {
     ecParameters ECParameters,
     namedCurve   OBJECT IDENTIFIER,
     implicitlyCA NULL
   }

   ECParameters ::= SEQUENCE {
     version  ECPVer,          -- version number of the Elliptic Curve
                               -- domain parameters. Is always 1
     fieldID  FieldID,         -- identifies the finite field over
                               -- which the Elliptic Curve is defined
     curve    Curve,           -- coefficients a and b of the
                               -- Elliptic Curve
     base     ECPoint,         -- specifies the base point G
                               -- on the Elliptic Curve
     order    INTEGER,         -- the order n of the base point
     cofactor INTEGER OPTIONAL -- the integer h = #E(Fq)/n
   }

   ECPVer ::= INTEGER {ecpVer1(1)}

   FieldID ::= SEQUENCE {
     fieldType  OBJECT IDENTIFIER,
     parameters ANY DEFINED BY fieldType
   }

   Curve ::= SEQUENCE {
     a         FieldElement,
     b         FieldElement,
     seed      BIT STRING OPTIONAL
   }

   FieldElement ::= OCTET STRING

   ECPoint ::= OCTET STRING    -- Elliptic Curve point
 
 
  • Constructor Details

    • ECParameters

      public ECParameters()
      Constructor
  • Method Details

    • engineGetEncoded

      protected byte[] engineGetEncoded() throws IOException
      Returns the parameters in their primary encoding format. The primary encoding format for parameters is ASN.1.
      
       ECParameters ::= SEQUENCE {
         version   ECPVer,          -- version is always 1
         fieldID   FieldID,         -- identifies the finite field over
                                    -- which the curve is defined
         curve     Curve,           -- coefficients a and b of the
                                    -- elliptic curve
         base      ECPoint,         -- specifies the base point P
                                    -- on the elliptic curve
         order     INTEGER,         -- the order n of the base point
         cofactor  INTEGER OPTIONAL -- The integer h = #E(Fq)/n
       }
      
       ECPVer ::= INTEGER {ecpVer1(1)}
      
       Curve ::= SEQUENCE {
         a         FieldElement,
         b         FieldElement,
         seed      BIT STRING OPTIONAL
       }
      
       FieldElement ::= OCTET STRING
      
       ECPoint ::= OCTET STRING
       
      Specified by:
      engineGetEncoded in class AlgorithmParametersSpi
      Returns:
      the parameters in their primary encoding format
      Throws:
      IOException - if there are any encoding errors
    • engineGetEncoded

      protected byte[] engineGetEncoded(String format) throws IOException
      Returns the parameters in their primary encoding format. The specified encoding format is ignored. The primary encoding format for parameters is ASN.1.
      Specified by:
      engineGetEncoded in class AlgorithmParametersSpi
      Parameters:
      format - the name of the encoding format. This parameter is ignored
      Returns:
      the parameters in their primary ASN.1 encoding format
      Throws:
      IOException - if there are any encoding errors
    • engineGetParameterSpec

      protected <T extends AlgorithmParameterSpec> T engineGetParameterSpec(Class<T> paramSpec) throws InvalidParameterSpecException
      Returns a transparent specification of this parameter object. paramSpec identifies the specification class in which the parameters should be returned.
      Specified by:
      engineGetParameterSpec in class AlgorithmParametersSpi
      Parameters:
      paramSpec - the transparent specification class in which the parameters should be returned. This should be the ECParameterSpec class
      Returns:
      the parameter specification
      Throws:
      NullPointerException - if paramSpec is null
      InvalidParameterSpecException - if the requested parameter specification is inappropriate for this parameter object
    • engineInit

      protected void engineInit(AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException
      Initializes this parameters object using the specified parameters.
      Specified by:
      engineInit in class AlgorithmParametersSpi
      Parameters:
      paramSpec - the parameter specification
      Throws:
      InvalidParameterSpecException - if the given parameter specification is inappropriate for the initialization of this parameter object
    • engineInit

      protected void engineInit(byte[] params) throws IOException
      Imports the specified parameters and decodes them according to the primary decoding format for parameters. The primary decoding format for parameters is ASN.1.
      
       ECParameters ::= SEQUENCE {
         version   ECPVer,          -- version is always 1
         fieldID   FieldID,         -- identifies the finite field over
                                    -- which the curve is defined
         curve     Curve,           -- coefficients a and b of the
                                    -- elliptic curve
         base      ECPoint,         -- specifies the base point P
                                    -- on the elliptic curve
         order     INTEGER,         -- the order n of the base point
         cofactor  INTEGER OPTIONAL -- The integer h = #E(Fq)/n
       }
      
       ECPVer ::= INTEGER {ecpVer1(1)}
      
       Curve ::= SEQUENCE {
         a         FieldElement,
         b         FieldElement,
         seed      BIT STRING OPTIONAL
       }
      
       FieldElement ::= OCTET STRING
      
       ECPoint ::= OCTET STRING
       
      Specified by:
      engineInit in class AlgorithmParametersSpi
      Parameters:
      params - the encoded parameters
      Throws:
      NullPointerException - if params is null
      IOException - if there are any decoding errors
    • engineInit

      protected void engineInit(byte[] params, String format) throws IOException
      Imports the specified parameters and decodes them according to the primary decoding format for parameters. The specified decoding format is ignored. The primary decoding format is ASN.1.
      Specified by:
      engineInit in class AlgorithmParametersSpi
      Parameters:
      params - the encoded parameters
      format - the name of the decoding format. This parameter is ignored
      Throws:
      IOException - if there are any decoding errors
    • engineToString

      protected String engineToString()
      Returns a formatted string describing the parameters.
      Specified by:
      engineToString in class AlgorithmParametersSpi
      Returns:
      formatted string