java.lang.Object
java.security.AlgorithmParametersSpi
com.ibm.crypto.hdwrCCA.provider.ECParameters
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]
Returns the parameters in their primary encoding format.protected byte[]
engineGetEncoded
(String format) Returns the parameters in their primary encoding format.protected <T extends AlgorithmParameterSpec>
TengineGetParameterSpec
(Class<T> paramSpec) Returns a transparent specification of this parameter object.protected void
engineInit
(byte[] params) Imports the specified parameters and decodes them according to the primary decoding format for parameters.protected void
engineInit
(byte[] params, String format) Imports the specified parameters and decodes them according to the primary decoding format for parameters.protected void
engineInit
(AlgorithmParameterSpec paramSpec) Initializes this parameters object using the specified parameters.protected String
Returns a formatted string describing the parameters.
-
Constructor Details
-
ECParameters
public ECParameters()Constructor
-
-
Method Details
-
engineGetEncoded
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 classAlgorithmParametersSpi
- Returns:
- the parameters in their primary encoding format
- Throws:
IOException
- if there are any encoding errors
-
engineGetEncoded
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 classAlgorithmParametersSpi
- 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 classAlgorithmParametersSpi
- Parameters:
paramSpec
- the transparent specification class in which the parameters should be returned. This should be theECParameterSpec
class- Returns:
- the parameter specification
- Throws:
NullPointerException
- ifparamSpec
is nullInvalidParameterSpecException
- if the requested parameter specification is inappropriate for this parameter object
-
engineInit
Initializes this parameters object using the specified parameters.- Specified by:
engineInit
in classAlgorithmParametersSpi
- Parameters:
paramSpec
- the parameter specification- Throws:
InvalidParameterSpecException
- if the given parameter specification is inappropriate for the initialization of this parameter object
-
engineInit
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 classAlgorithmParametersSpi
- Parameters:
params
- the encoded parameters- Throws:
NullPointerException
- ifparams
is nullIOException
- if there are any decoding errors
-
engineInit
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 classAlgorithmParametersSpi
- Parameters:
params
- the encoded parametersformat
- the name of the decoding format. This parameter is ignored- Throws:
IOException
- if there are any decoding errors
-
engineToString
Returns a formatted string describing the parameters.- Specified by:
engineToString
in classAlgorithmParametersSpi
- Returns:
- formatted string
-