com.ibm.crypto.hdwrCCA.provider
Class ECParameters
- java.lang.Object
-
- java.security.AlgorithmParametersSpi
-
- com.ibm.crypto.hdwrCCA.provider.ECParameters
-
public final class ECParameters extends java.security.AlgorithmParametersSpiThis 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 Summary
Constructors Constructor and Description ECParameters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description protected byte[]engineGetEncoded()Returns the parameters in their primary encoding format.protected byte[]engineGetEncoded(java.lang.String format)Returns the parameters in their primary encoding format.protected <T extends java.security.spec.AlgorithmParameterSpec>
TengineGetParameterSpec(java.lang.Class<T> paramSpec)Returns a transparent specification of this parameter object.protected voidengineInit(java.security.spec.AlgorithmParameterSpec paramSpec)Initializes this parameters object using the specified parameters.protected voidengineInit(byte[] params)Imports the specified parameters and decodes them according to the primary decoding format for parameters.protected voidengineInit(byte[] params, java.lang.String format)Imports the specified parameters and decodes them according to the primary decoding format for parameters.protected java.lang.StringengineToString()Returns a formatted string describing the parameters.
-
-
-
Method Detail
-
engineGetEncoded
protected byte[] engineGetEncoded() throws java.io.IOExceptionReturns 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:
engineGetEncodedin classjava.security.AlgorithmParametersSpi- Returns:
- the parameters in their primary encoding format
- Throws:
java.io.IOException- if there are any encoding errors
-
engineGetEncoded
protected byte[] engineGetEncoded(java.lang.String format) throws java.io.IOExceptionReturns the parameters in their primary encoding format. The specified encoding format is ignored. The primary encoding format for parameters is ASN.1.- Specified by:
engineGetEncodedin classjava.security.AlgorithmParametersSpi- Parameters:
format- the name of the encoding format. This parameter is ignored- Returns:
- the parameters in their primary ASN.1 encoding format
- Throws:
java.io.IOException- if there are any encoding errors
-
engineGetParameterSpec
protected <T extends java.security.spec.AlgorithmParameterSpec> T engineGetParameterSpec(java.lang.Class<T> paramSpec) throws java.security.spec.InvalidParameterSpecExceptionReturns a transparent specification of this parameter object.paramSpecidentifies the specification class in which the parameters should be returned.- Specified by:
engineGetParameterSpecin classjava.security.AlgorithmParametersSpi- Parameters:
paramSpec- the transparent specification class in which the parameters should be returned. This should be theECParameterSpecclass- Returns:
- the parameter specification
- Throws:
java.lang.NullPointerException- ifparamSpecis nulljava.security.spec.InvalidParameterSpecException- if the requested parameter specification is inappropriate for this parameter object
-
engineInit
protected void engineInit(java.security.spec.AlgorithmParameterSpec paramSpec) throws java.security.spec.InvalidParameterSpecExceptionInitializes this parameters object using the specified parameters.- Specified by:
engineInitin classjava.security.AlgorithmParametersSpi- Parameters:
paramSpec- the parameter specification- Throws:
java.security.spec.InvalidParameterSpecException- if the given parameter specification is inappropriate for the initialization of this parameter object
-
engineInit
protected void engineInit(byte[] params) throws java.io.IOExceptionImports 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:
engineInitin classjava.security.AlgorithmParametersSpi- Parameters:
params- the encoded parameters- Throws:
java.lang.NullPointerException- ifparamsis nulljava.io.IOException- if there are any decoding errors
-
engineInit
protected void engineInit(byte[] params, java.lang.String format) throws java.io.IOExceptionImports 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:
engineInitin classjava.security.AlgorithmParametersSpi- Parameters:
params- the encoded parametersformat- the name of the decoding format. This parameter is ignored- Throws:
java.io.IOException- if there are any decoding errors
-
engineToString
protected java.lang.String engineToString()
Returns a formatted string describing the parameters.- Specified by:
engineToStringin classjava.security.AlgorithmParametersSpi- Returns:
- formatted string
-
-