APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.util

public final Class ECParameters

extends AlgorithmParametersSpi
Class Inheritance
Imports
java.io.IOException, java.security.*, java.security.spec.*

This class implements encoding and decoding of Elliptic Curve parameters as specified in RFC 3279. However, only named curves are currently supported. ASN.1 from RFC 3279 follows. Note that X9.62 (2005) has added some additional options.
   EcpkParameters ::= CHOICE {
     ecParameters  ECParameters,
     namedCurve    OBJECT IDENTIFIER,
     implicitlyCA  NULL }

   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
Author
Andreas Sterbenz
Since
1.6

Field Summary

Modifier and TypeField and Description
private NamedCurve

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected byte[]
engineGetEncoded()

Implements abstract java.security.AlgorithmParametersSpi.engineGetEncoded.

Returns the parameters in their primary encoding format.

protected byte[]
engineGetEncoded(String encodingMethod)

Implements abstract java.security.AlgorithmParametersSpi.engineGetEncoded.

Returns the parameters encoded in the specified format.

protected <T extends AlgorithmParameterSpec> T
engineGetParameterSpec(Class<T> spec)

Implements abstract java.security.AlgorithmParametersSpi.engineGetParameterSpec.

Returns a (transparent) specification of this parameters object.

protected void
engineInit(AlgorithmParameterSpec paramSpec)

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Initializes this parameters object using the parameters specified in paramSpec.

protected void
engineInit(byte[] params)

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Imports the specified parameters and decodes them according to the primary decoding format for parameters.

protected void
engineInit(byte[] params, String decodingMethod)

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Imports the parameters from params and decodes them according to the specified decoding format.

protected String
engineToString()

Implements abstract java.security.AlgorithmParametersSpi.engineToString.

Returns a formatted string describing the parameters.

public static AlgorithmParameters

Field Detail

namedCurveback to summary
private NamedCurve namedCurve

Constructor Detail

ECParametersback to summary
public ECParameters()

Method Detail

engineGetEncodedback to summary
protected byte[] engineGetEncoded() throws IOException

Implements abstract java.security.AlgorithmParametersSpi.engineGetEncoded.

Doc from java.security.AlgorithmParametersSpi.engineGetEncoded.

Returns the parameters in their primary encoding format. The primary encoding format for parameters is ASN.1, if an ASN.1 specification for this type of parameters exists.

Exceptions
IOException:
on encoding errors.
engineGetEncodedback to summary
protected byte[] engineGetEncoded(String encodingMethod) throws IOException

Implements abstract java.security.AlgorithmParametersSpi.engineGetEncoded.

Doc from java.security.AlgorithmParametersSpi.engineGetEncoded.

Returns the parameters encoded in the specified format. If format is null, the primary encoding format for parameters is used. The primary encoding format is ASN.1, if an ASN.1 specification for these parameters exists.

Exceptions
IOException:
on encoding errors.
engineGetParameterSpecback to summary
protected <T extends AlgorithmParameterSpec> T engineGetParameterSpec(Class<T> spec) throws InvalidParameterSpecException

Implements abstract java.security.AlgorithmParametersSpi.engineGetParameterSpec.

Doc from java.security.AlgorithmParametersSpi.engineGetParameterSpec.

Returns a (transparent) specification of this parameters object. paramSpec identifies the specification class in which the parameters should be returned. It could, for example, be DSAParameterSpec.class, to indicate that the parameters should be returned in an instance of the DSAParameterSpec class.

Exceptions
InvalidParameterSpecException:
if the requested parameter specification is inappropriate for this parameter object.
engineInitback to summary
protected void engineInit(AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Doc from java.security.AlgorithmParametersSpi.engineInit.

Initializes this parameters object using the parameters specified in paramSpec.

Exceptions
InvalidParameterSpecException:
if the given parameter specification is inappropriate for the initialization of this parameter object.
engineInitback to summary
protected void engineInit(byte[] params) throws IOException

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Doc from java.security.AlgorithmParametersSpi.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, if an ASN.1 specification for this type of parameters exists.

Exceptions
IOException:
on decoding errors
engineInitback to summary
protected void engineInit(byte[] params, String decodingMethod) throws IOException

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Doc from java.security.AlgorithmParametersSpi.engineInit.

Imports the parameters from params and decodes them according to the specified decoding format. If format is null, the primary decoding format for parameters is used. The primary decoding format is ASN.1, if an ASN.1 specification for these parameters exists.

Exceptions
IOException:
on decoding errors
engineToStringback to summary
protected String engineToString()

Implements abstract java.security.AlgorithmParametersSpi.engineToString.

Doc from java.security.AlgorithmParametersSpi.engineToString.

Returns a formatted string describing the parameters.

getAlgorithmParametersback to summary
public static AlgorithmParameters getAlgorithmParameters(ECParameterSpec spec) throws InvalidKeyException