Class ECHWKeyParameterSpec

java.lang.Object
com.ibm.crypto.hdwrCCA.provider.ECHWKeyParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec

public class ECHWKeyParameterSpec extends Object implements AlgorithmParameterSpec
This class specifies the set of domain parameters and hardware key attributes to be used for the generation of Elliptic Curve hardware key pair. This class is immutable.
  • Constructor Details

    • ECHWKeyParameterSpec

      public ECHWKeyParameterSpec(int strength, byte type) throws IllegalArgumentException
      Construct an Elliptic Curve parameter set from the specified key size and key type. Key usage will default to key management if key management capabilities are supported by Elliptic Curve keys. Otherwise, key usage will default to signature.
      Parameters:
      strength - the Elliptic Curve key size
      type - the hardware key type, either CLEAR or PKDS
      Throws:
      IllegalArgumentException - if the specified hardware key type is not supported
    • ECHWKeyParameterSpec

      public ECHWKeyParameterSpec(int strength, byte type, byte usage) throws IllegalArgumentException
      Construct an Elliptic Curve parameter set from the specified key size, key type, and key usage.
      Parameters:
      strength - the Elliptic Curve key size
      type - the hardware key type, either CLEAR or PKDS
      usage - indicates how the key will be used, either for key management or for signatures
      Throws:
      IllegalArgumentException - if the specified hardware key type or key usage is not supported
    • ECHWKeyParameterSpec

      public ECHWKeyParameterSpec(int strength, byte type, String label) throws IllegalArgumentException
      Construct an Elliptic Curve parameter set from the specified key size, key type, and PKDS record label. Key usage will default to key management if key management functionalities are supported by Elliptic Curve keys. Otherwise, key usage will default to signature.
      Parameters:
      strength - the Elliptic Curve key size
      type - the hardware key type, either CLEAR or PKDS
      label - the PKDS record label
      Throws:
      InvalidParameterException - if the supplied key size is not supported
      IllegalArgumentException - if the specified hardware key type or the PKDS record label is not valid
    • ECHWKeyParameterSpec

      public ECHWKeyParameterSpec(int strength, byte type, byte usage, String label) throws IllegalArgumentException
      Construct an Elliptic Curve parameter set from the specified key size, key type, key usage, and PKDS record label.
      Parameters:
      strength - the Elliptic Curve key size
      type - the hardware key type, either CLEAR or PKDS
      usage - indicates how the key will be used, either for key management or for signatures
      label - the PKDS record label
      Throws:
      InvalidParameterException - if the supplied key size is not supported
      IllegalArgumentException - if the specified hardware key type or key usage is not supported, or the PKDS record label is not valid
    • ECHWKeyParameterSpec

      public ECHWKeyParameterSpec(T spec, byte type) throws InvalidParameterSpecException, IllegalArgumentException
      Construct an Elliptic Curve parameter set from the specified Elliptic Curve parameter specification and key type. Key usage will default to key management if key management functionalities are supported by Elliptic Curve keys. Otherwise, key usage will default to signature.
      Parameters:
      spec - the Elliptic Curve parameter specification, must be an instance of either ECParameterSpec or ECGenParameterSpec
      type - the hardware key type, either CLEAR or PKDS
      Throws:
      InvalidParameterSpecException - if the specified parameter specification is not supported
      IllegalArgumentException - if the specified hardware key type is not supported
    • ECHWKeyParameterSpec

      public ECHWKeyParameterSpec(T spec, byte type, byte usage) throws InvalidParameterSpecException, IllegalArgumentException
      Construct an Elliptic Curve parameter set from the specified Elliptic Curve parameter specification, key type, and key usage.
      Parameters:
      spec - the Elliptic Curve parameter specification, must be an instance of either ECParameterSpec or ECGenParameterSpec
      type - the hardware key type, either CLEAR or PKDS
      usage - indicates how the key will be used, either for key management or for signatures
      Throws:
      InvalidParameterSpecException - if the specified parameter specification is not supported
      IllegalArgumentException - if the specified hardware key type or key usage is not supported
    • ECHWKeyParameterSpec

      public ECHWKeyParameterSpec(T spec, byte type, byte usage, String label) throws InvalidParameterSpecException, IllegalArgumentException
      Construct an Elliptic Curve parameter set from the specified Elliptic Curve parameter specification, key type, key usage, and PKDS record label.
      Parameters:
      spec - the Elliptic Curve parameter specification, must be an instance of either ECParameterSpec or ECGenParameterSpec
      type - the hardware key type, either CLEAR or PKDS
      usage - indicates how the key will be used, either for key management or for signatures
      label - the PKDS record label
      Throws:
      InvalidParameterSpecException - if the specified parameter specification is not supported
      IllegalArgumentException - if the specified hardware key type or key usage is not supported, or PKDS label is not valid
    • ECHWKeyParameterSpec

      public ECHWKeyParameterSpec(String name, byte type) throws IllegalArgumentException
      Construct a parameter set using a standard Elliptic Curve name. Key usage will default to key management if key management functionalities are supported by Elliptic Curve keys. Otherwise, key usage will default to signature.
      Parameters:
      name - the standard name of a set of Elliptic Curve domain parameters
      type - the hardware key type, PKDS or CLEAR
      Throws:
      NullPointerException - if the supplied name is null
      IllegalArgumentException - for any parameter values outside the bounds for that parameter
    • ECHWKeyParameterSpec

      public ECHWKeyParameterSpec(String name, byte type, byte usage) throws IllegalArgumentException
      Construct a parameter set using a standard Elliptic Curve name.
      Parameters:
      name - the standard name of a set of Elliptic Curve domain parameters
      type - the hardware key type, PKDS or CLEAR
      usage - the way that the key will be used, either SIGNATURE, use for signing purposes only, or KEYMANAGMENT, use for both management of keys and signing purposes
      Throws:
      NullPointerException - if the supplied name is null
      IllegalArgumentException - for any parameter values outside the bounds for that parameter
    • ECHWKeyParameterSpec

      public ECHWKeyParameterSpec(String name, byte type, byte usage, String label) throws IllegalArgumentException
      Construct a parameter set using a standard Elliptic Curve name.
      Parameters:
      name - the standard name of a set of Elliptic Curve domain parameters
      type - the hardware key type, PKDS or CLEAR
      usage - the way that the key will be used, either SIGNATURE, use for signing purposes only, or KEYMANAGEMENT, use for both management of keys and signing purposes
      label - the PKDS record label
      Throws:
      NullPointerException - if the supplied name is null
      IllegalArgumentException - for any parameter values outside the bounds for that parameter
    • ECHWKeyParameterSpec

      public ECHWKeyParameterSpec(EllipticCurve curve, ECPoint g, BigInteger n, int h, byte type) throws IllegalArgumentException
      Construct a parameter set from the set of domain parameters of a standard Elliptic Curve. Key usage will default to key management if key management functionalities are supported by Elliptic Curve keys. Otherwise, key usage will default to signature.
      Parameters:
      curve - the elliptic curve
      g - the generator
      n - the order
      h - the cofactor
      type - the hardware key type, PKDS or CLEAR
      Throws:
      NullPointerException - if curve, g, or n is null
      IllegalArgumentException - for any parameter values outside the bounds for that parameter
    • ECHWKeyParameterSpec

      public ECHWKeyParameterSpec(EllipticCurve curve, ECPoint g, BigInteger n, int h, byte type, byte usage) throws IllegalArgumentException
      Construct a parameter set from the set of domain parameters of a standard Elliptic Curve.
      Parameters:
      curve - the elliptic curve
      g - the generator
      n - the order
      h - the cofactor
      type - the hardware key type, PKDS or CLEAR
      usage - the way that the key will be used, either SIGNATURE, used for signing purposes only, or KEYMANAGMENT, used for both management of keys and signing purposes
      Throws:
      NullPointerException - if curve, g, or n is null
      IllegalArgumentException - for any parameter values outside the bounds for that parameter
    • ECHWKeyParameterSpec

      public ECHWKeyParameterSpec(EllipticCurve curve, ECPoint g, BigInteger n, int h, byte type, byte usage, String label) throws IllegalArgumentException
      Construct a parameter set from the set of domain parameters of a standard Elliptic Curve.
      Parameters:
      curve - the elliptic curve
      g - the generator
      n - the order
      h - the cofactor
      type - the hardware key type, PKDS or CLEAR
      usage - the way that the key will be used, either SIGNATURE, used for signing purposes only, or KEYMANAGMENT, used for both management of keys and signing purposes
      label - the PKDS record label
      Throws:
      NullPointerException - if curve, g, or n is null
      IllegalArgumentException - for any parameter values outside the bounds for that parameter
  • Method Details

    • getKeySize

      public int getKeySize()
      Returns the key size.
      Returns:
      the key size
    • getParameterSpec

      public <T extends AlgorithmParameterSpec> T getParameterSpec(Class<T> spec) throws InvalidParameterSpecException
      Returns the requested parameter specification.
      Parameters:
      spec - the requested parameter specification class, can be either ECParameterSpec or ECGenParameterSpec
      Returns:
      the requested parameter specification
      Throws:
      InvalidParameterSpecException - if the parameter specification is not appropriate
    • getAttributes

      public ECHWKeyAttributes getAttributes()
      Returns hardware key attributes.
      Returns:
      the hardware key attributes
    • getLabel

      public String getLabel()
      Returns the label that will be used to identify the key in the PKDS. The key label is not relevant for keys of type CLEAR.
      Returns:
      the key label