Top Description Inners Constructors Methods
org.bouncycastle.jce

public Class ECKeyUtil

extends Object
Class Inheritance
Imports
java.io.UnsupportedEncodingException, java.security.KeyFactory, .NoSuchAlgorithmException, .NoSuchProviderException, .PrivateKey, .Provider, .PublicKey, .Security, java.security.spec.PKCS8EncodedKeySpec, .X509EncodedKeySpec, org.bouncycastle.asn1.ASN1ObjectIdentifier, .ASN1Primitive, org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .SubjectPublicKeyInfo, org.bouncycastle.asn1.x9.X962Parameters, .X9ECParameters, .X9ECPoint, .X9ObjectIdentifiers, org.bouncycastle.jcajce.provider.asymmetric.util.ECUtil, org.bouncycastle.jce.provider.BouncyCastleProvider

Utility class to allow conversion of EC key parameters to explicit from named curves and back (where possible).

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static PrivateKey

Returns:

the equivalent key with explicit curve parameters
privateToExplicitParameters
(PrivateKey
key to be converted
key
,
String
provider name to be used.
providerName
)

Convert a passed in private EC key to have explicit parameters.

public static PrivateKey

Returns:

the equivalent key with explicit curve parameters
privateToExplicitParameters
(PrivateKey
key to be converted
key
,
Provider
provider to be used.
provider
)

Convert a passed in private EC key to have explicit parameters.

public static PublicKey

Returns:

the equivalent key with explicit curve parameters
publicToExplicitParameters
(PublicKey
key to be converted
key
,
String
provider name to be used.
providerName
)

Convert a passed in public EC key to have explicit parameters.

public static PublicKey

Returns:

the equivalent key with explicit curve parameters
publicToExplicitParameters
(PublicKey
key to be converted
key
,
Provider
provider to be used.
provider
)

Convert a passed in public EC key to have explicit parameters.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ECKeyUtilback to summary
public ECKeyUtil()

Method Detail

privateToExplicitParametersback to summary
public static PrivateKey privateToExplicitParameters(PrivateKey key, String providerName) throws IllegalArgumentException, NoSuchAlgorithmException, NoSuchProviderException

Convert a passed in private EC key to have explicit parameters. If the key is already using explicit parameters it is returned.

Parameters
key:PrivateKey

key to be converted

providerName:String

provider name to be used.

Returns:PrivateKey

the equivalent key with explicit curve parameters

privateToExplicitParametersback to summary
public static PrivateKey privateToExplicitParameters(PrivateKey key, Provider provider) throws IllegalArgumentException, NoSuchAlgorithmException

Convert a passed in private EC key to have explicit parameters. If the key is already using explicit parameters it is returned.

Parameters
key:PrivateKey

key to be converted

provider:Provider

provider to be used.

Returns:PrivateKey

the equivalent key with explicit curve parameters

publicToExplicitParametersback to summary
public static PublicKey publicToExplicitParameters(PublicKey key, String providerName) throws IllegalArgumentException, NoSuchAlgorithmException, NoSuchProviderException

Convert a passed in public EC key to have explicit parameters. If the key is already using explicit parameters it is returned.

Parameters
key:PublicKey

key to be converted

providerName:String

provider name to be used.

Returns:PublicKey

the equivalent key with explicit curve parameters

publicToExplicitParametersback to summary
public static PublicKey publicToExplicitParameters(PublicKey key, Provider provider) throws IllegalArgumentException, NoSuchAlgorithmException

Convert a passed in public EC key to have explicit parameters. If the key is already using explicit parameters it is returned.

Parameters
key:PublicKey

key to be converted

provider:Provider

provider to be used.

Returns:PublicKey

the equivalent key with explicit curve parameters

org.bouncycastle.jce back to summary

private Class ECKeyUtil.UnexpectedException

extends RuntimeException
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Throwable

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Throwable
getCause()

Overrides java.lang.Throwable.getCause.

Returns the cause of this throwable or null if the cause is nonexistent or unknown.

Field Detail

causeback to summary
private Throwable cause

Hides java.lang.Throwable.cause.

Constructor Detail

UnexpectedExceptionback to summary
pack-priv UnexpectedException(Throwable cause)

Method Detail

getCauseback to summary
public Throwable getCause()

Overrides java.lang.Throwable.getCause.

Doc from java.lang.Throwable.getCause.

Returns the cause of this throwable or null if the cause is nonexistent or unknown. (The cause is the throwable that caused this throwable to get thrown.)

This implementation returns the cause that was supplied via one of the constructors requiring a Throwable, or that was set after creation with the initCause(Throwable) method. While it is typically unnecessary to override this method, a subclass can override it to return a cause set by some other means. This is appropriate for a "legacy chained throwable" that predates the addition of chained exceptions to Throwable. Note that it is not necessary to override any of the PrintStackTrace methods, all of which invoke the getCause method to determine the cause of a throwable.

Returns:Throwable

the cause of this throwable or null if the cause is nonexistent or unknown.