Package org.bouncycastle.jce
Class ECKeyUtil
java.lang.Object
org.bouncycastle.jce.ECKeyUtil
Utility class to allow conversion of EC key parameters to explicit from named
curves and back (where possible).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PrivateKeyprivateToExplicitParameters(PrivateKey key, String providerName) Convert a passed in private EC key to have explicit parameters.static PrivateKeyprivateToExplicitParameters(PrivateKey key, Provider provider) Convert a passed in private EC key to have explicit parameters.static PublicKeypublicToExplicitParameters(PublicKey key, String providerName) Convert a passed in public EC key to have explicit parameters.static PublicKeypublicToExplicitParameters(PublicKey key, Provider provider) Convert a passed in public EC key to have explicit parameters.
-
Constructor Details
-
ECKeyUtil
public ECKeyUtil()
-
-
Method Details
-
publicToExplicitParameters
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- key to be convertedproviderName- provider name to be used.- Returns:
- the equivalent key with explicit curve parameters
- Throws:
IllegalArgumentExceptionNoSuchAlgorithmExceptionNoSuchProviderException
-
publicToExplicitParameters
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- key to be convertedprovider- provider to be used.- Returns:
- the equivalent key with explicit curve parameters
- Throws:
IllegalArgumentExceptionNoSuchAlgorithmException
-
privateToExplicitParameters
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- key to be convertedproviderName- provider name to be used.- Returns:
- the equivalent key with explicit curve parameters
- Throws:
IllegalArgumentExceptionNoSuchAlgorithmExceptionNoSuchProviderException
-
privateToExplicitParameters
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- key to be convertedprovider- provider to be used.- Returns:
- the equivalent key with explicit curve parameters
- Throws:
IllegalArgumentExceptionNoSuchAlgorithmException
-