ECKeyUtil (Bouncy Castle Library 1.52 API Specification)

org.bouncycastle.jce

## Class ECKeyUtil

- java.lang.Object
- - org.bouncycastle.jce.ECKeyUtil

-     public class ECKeyUtil
      extends java.lang.Object

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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ECKeyUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.security.PrivateKey` | `privateToExplicitParameters(java.security.PrivateKey key, java.security.Provider provider)` Convert a passed in private EC key to have explicit parameters.
    `static java.security.PrivateKey` | `privateToExplicitParameters(java.security.PrivateKey key, java.lang.String providerName)` Convert a passed in private EC key to have explicit parameters.
    `static java.security.PublicKey` | `publicToExplicitParameters(java.security.PublicKey key, java.security.Provider provider)` Convert a passed in public EC key to have explicit parameters.
    `static java.security.PublicKey` | `publicToExplicitParameters(java.security.PublicKey key, java.lang.String providerName)` Convert a passed in public EC key to have explicit parameters.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ECKeyUtil

          public ECKeyUtil()

  - ### Method Detail

    - #### publicToExplicitParameters

          public static java.security.PublicKey publicToExplicitParameters(java.security.PublicKey key,
                                                           java.lang.String providerName)
                                                                    throws java.lang.IllegalArgumentException,
                                                                           java.security.NoSuchAlgorithmException,
                                                                           java.security.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 converted
        `providerName` - provider name to be used.
      Returns:
        the equivalent key with explicit curve parameters
      Throws:
        `java.lang.IllegalArgumentException`
        `java.security.NoSuchAlgorithmException`
        `java.security.NoSuchProviderException`

    - #### publicToExplicitParameters

          public static java.security.PublicKey publicToExplicitParameters(java.security.PublicKey key,
                                                           java.security.Provider provider)
                                                                    throws java.lang.IllegalArgumentException,
                                                                           java.security.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 converted
        `provider` - provider to be used.
      Returns:
        the equivalent key with explicit curve parameters
      Throws:
        `java.lang.IllegalArgumentException`
        `java.security.NoSuchAlgorithmException`

    - #### privateToExplicitParameters

          public static java.security.PrivateKey privateToExplicitParameters(java.security.PrivateKey key,
                                                             java.lang.String providerName)
                                                                      throws java.lang.IllegalArgumentException,
                                                                             java.security.NoSuchAlgorithmException,
                                                                             java.security.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 converted
        `providerName` - provider name to be used.
      Returns:
        the equivalent key with explicit curve parameters
      Throws:
        `java.lang.IllegalArgumentException`
        `java.security.NoSuchAlgorithmException`
        `java.security.NoSuchProviderException`

    - #### privateToExplicitParameters

          public static java.security.PrivateKey privateToExplicitParameters(java.security.PrivateKey key,
                                                             java.security.Provider provider)
                                                                      throws java.lang.IllegalArgumentException,
                                                                             java.security.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 converted
        `provider` - provider to be used.
      Returns:
        the equivalent key with explicit curve parameters
      Throws:
        `java.lang.IllegalArgumentException`
        `java.security.NoSuchAlgorithmException`