Class ECHWKeyParameterSpec

  • All Implemented Interfaces:
    java.security.spec.AlgorithmParameterSpec

    public class ECHWKeyParameterSpec
    extends java.lang.Object
    implements java.security.spec.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 Summary

      Constructors 
      Constructor Description
      ECHWKeyParameterSpec​(int strength, byte type)
      Construct an Elliptic Curve parameter set from the specified key size and key type.
      ECHWKeyParameterSpec​(int strength, byte type, byte usage)
      Construct an Elliptic Curve parameter set from the specified key size, key type, and key usage.
      ECHWKeyParameterSpec​(int strength, byte type, byte usage, java.lang.String label)
      Construct an Elliptic Curve parameter set from the specified key size, key type, key usage, and PKDS record label.
      ECHWKeyParameterSpec​(int strength, byte type, java.lang.String label)
      Construct an Elliptic Curve parameter set from the specified key size, key type, and PKDS record label.
      ECHWKeyParameterSpec​(java.lang.String name, byte type)
      Construct a parameter set using a standard Elliptic Curve name.
      ECHWKeyParameterSpec​(java.lang.String name, byte type, byte usage)
      Construct a parameter set using a standard Elliptic Curve name.
      ECHWKeyParameterSpec​(java.lang.String name, byte type, byte usage, java.lang.String label)
      Construct a parameter set using a standard Elliptic Curve name.
      ECHWKeyParameterSpec​(java.security.spec.EllipticCurve curve, java.security.spec.ECPoint g, java.math.BigInteger n, int h, byte type)
      Construct a parameter set from the set of domain parameters of a standard Elliptic Curve.
      ECHWKeyParameterSpec​(java.security.spec.EllipticCurve curve, java.security.spec.ECPoint g, java.math.BigInteger n, int h, byte type, byte usage)
      Construct a parameter set from the set of domain parameters of a standard Elliptic Curve.
      ECHWKeyParameterSpec​(java.security.spec.EllipticCurve curve, java.security.spec.ECPoint g, java.math.BigInteger n, int h, byte type, byte usage, java.lang.String label)
      Construct a parameter set from the set of domain parameters of a standard Elliptic Curve.
      ECHWKeyParameterSpec​(T spec, byte type)
      Construct an Elliptic Curve parameter set from the specified Elliptic Curve parameter specification and key type.
      ECHWKeyParameterSpec​(T spec, byte type, byte usage)
      Construct an Elliptic Curve parameter set from the specified Elliptic Curve parameter specification, key type, and key usage.
      ECHWKeyParameterSpec​(T spec, byte type, byte usage, java.lang.String label)
      Construct an Elliptic Curve parameter set from the specified Elliptic Curve parameter specification, key type, key usage, and PKDS record label.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ECHWKeyAttributes getAttributes()
      Returns hardware key attributes.
      int getKeySize()
      Returns the key size.
      java.lang.String getLabel()
      Returns the label that will be used to identify the key in the PKDS.
      <T extends java.security.spec.AlgorithmParameterSpec>
      T
      getParameterSpec​(java.lang.Class<T> spec)
      Returns the requested parameter specification.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ECHWKeyParameterSpec

        public ECHWKeyParameterSpec​(int strength,
                                    byte type)
                             throws java.lang.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:
        java.lang.IllegalArgumentException - if the specified hardware key type is not supported
      • ECHWKeyParameterSpec

        public ECHWKeyParameterSpec​(int strength,
                                    byte type,
                                    byte usage)
                             throws java.lang.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:
        java.lang.IllegalArgumentException - if the specified hardware key type or key usage is not supported
      • ECHWKeyParameterSpec

        public ECHWKeyParameterSpec​(int strength,
                                    byte type,
                                    java.lang.String label)
                             throws java.lang.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:
        java.security.InvalidParameterException - if the supplied key size is not supported
        java.lang.IllegalArgumentException - if the specified hardware key type or the PKDS record label is not valid
      • ECHWKeyParameterSpec

        public ECHWKeyParameterSpec​(int strength,
                                    byte type,
                                    byte usage,
                                    java.lang.String label)
                             throws java.lang.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:
        java.security.InvalidParameterException - if the supplied key size is not supported
        java.lang.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 java.security.spec.InvalidParameterSpecException,
                                    java.lang.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:
        java.security.spec.InvalidParameterSpecException - if the specified parameter specification is not supported
        java.lang.IllegalArgumentException - if the specified hardware key type is not supported
      • ECHWKeyParameterSpec

        public ECHWKeyParameterSpec​(T spec,
                                    byte type,
                                    byte usage)
                             throws java.security.spec.InvalidParameterSpecException,
                                    java.lang.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:
        java.security.spec.InvalidParameterSpecException - if the specified parameter specification is not supported
        java.lang.IllegalArgumentException - if the specified hardware key type or key usage is not supported
      • ECHWKeyParameterSpec

        public ECHWKeyParameterSpec​(T spec,
                                    byte type,
                                    byte usage,
                                    java.lang.String label)
                             throws java.security.spec.InvalidParameterSpecException,
                                    java.lang.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:
        java.security.spec.InvalidParameterSpecException - if the specified parameter specification is not supported
        java.lang.IllegalArgumentException - if the specified hardware key type or key usage is not supported, or PKDS label is not valid
      • ECHWKeyParameterSpec

        public ECHWKeyParameterSpec​(java.lang.String name,
                                    byte type)
                             throws java.lang.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:
        java.lang.NullPointerException - if the supplied name is null
        java.lang.IllegalArgumentException - for any parameter values outside the bounds for that parameter
      • ECHWKeyParameterSpec

        public ECHWKeyParameterSpec​(java.lang.String name,
                                    byte type,
                                    byte usage)
                             throws java.lang.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:
        java.lang.NullPointerException - if the supplied name is null
        java.lang.IllegalArgumentException - for any parameter values outside the bounds for that parameter
      • ECHWKeyParameterSpec

        public ECHWKeyParameterSpec​(java.lang.String name,
                                    byte type,
                                    byte usage,
                                    java.lang.String label)
                             throws java.lang.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:
        java.lang.NullPointerException - if the supplied name is null
        java.lang.IllegalArgumentException - for any parameter values outside the bounds for that parameter
      • ECHWKeyParameterSpec

        public ECHWKeyParameterSpec​(java.security.spec.EllipticCurve curve,
                                    java.security.spec.ECPoint g,
                                    java.math.BigInteger n,
                                    int h,
                                    byte type)
                             throws java.lang.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:
        java.lang.NullPointerException - if curve, g, or n is null
        java.lang.IllegalArgumentException - for any parameter values outside the bounds for that parameter
      • ECHWKeyParameterSpec

        public ECHWKeyParameterSpec​(java.security.spec.EllipticCurve curve,
                                    java.security.spec.ECPoint g,
                                    java.math.BigInteger n,
                                    int h,
                                    byte type,
                                    byte usage)
                             throws java.lang.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:
        java.lang.NullPointerException - if curve, g, or n is null
        java.lang.IllegalArgumentException - for any parameter values outside the bounds for that parameter
      • ECHWKeyParameterSpec

        public ECHWKeyParameterSpec​(java.security.spec.EllipticCurve curve,
                                    java.security.spec.ECPoint g,
                                    java.math.BigInteger n,
                                    int h,
                                    byte type,
                                    byte usage,
                                    java.lang.String label)
                             throws java.lang.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:
        java.lang.NullPointerException - if curve, g, or n is null
        java.lang.IllegalArgumentException - for any parameter values outside the bounds for that parameter
    • Method Detail

      • getKeySize

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

        public <T extends java.security.spec.AlgorithmParameterSpec> T getParameterSpec​(java.lang.Class<T> spec)
                                                                                 throws java.security.spec.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:
        java.security.spec.InvalidParameterSpecException - if the parameter specification is not appropriate
      • getAttributes

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

        public java.lang.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