- java.lang.Object
-
- com.ibm.crypto.hdwrCCA.provider.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>
TgetParameterSpec(java.lang.Class<T> spec)
Returns the requested parameter specification.
-
-
-
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 sizetype
- 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 sizetype
- the hardware key type, either CLEAR or PKDSusage
- 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 sizetype
- the hardware key type, either CLEAR or PKDSlabel
- the PKDS record label- Throws:
java.security.InvalidParameterException
- if the supplied key size is not supportedjava.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 sizetype
- the hardware key type, either CLEAR or PKDSusage
- indicates how the key will be used, either for key management or for signatureslabel
- the PKDS record label- Throws:
java.security.InvalidParameterException
- if the supplied key size is not supportedjava.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 eitherECParameterSpec
orECGenParameterSpec
type
- the hardware key type, either CLEAR or PKDS- Throws:
java.security.spec.InvalidParameterSpecException
- if the specified parameter specification is not supportedjava.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 eitherECParameterSpec
orECGenParameterSpec
type
- the hardware key type, either CLEAR or PKDSusage
- 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 supportedjava.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 eitherECParameterSpec
orECGenParameterSpec
type
- the hardware key type, either CLEAR or PKDSusage
- indicates how the key will be used, either for key management or for signatureslabel
- the PKDS record label- Throws:
java.security.spec.InvalidParameterSpecException
- if the specified parameter specification is not supportedjava.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 parameterstype
- the hardware key type, PKDS or CLEAR- Throws:
java.lang.NullPointerException
- if the supplied name is nulljava.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 parameterstype
- the hardware key type, PKDS or CLEARusage
- 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 nulljava.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 parameterstype
- the hardware key type, PKDS or CLEARusage
- 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 purposeslabel
- the PKDS record label- Throws:
java.lang.NullPointerException
- if the supplied name is nulljava.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 curveg
- the generatorn
- the orderh
- the cofactortype
- the hardware key type, PKDS or CLEAR- Throws:
java.lang.NullPointerException
- if curve, g, or n is nulljava.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 curveg
- the generatorn
- the orderh
- the cofactortype
- the hardware key type, PKDS or CLEARusage
- 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 nulljava.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 curveg
- the generatorn
- the orderh
- the cofactortype
- the hardware key type, PKDS or CLEARusage
- 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 purposeslabel
- the PKDS record label- Throws:
java.lang.NullPointerException
- if curve, g, or n is nulljava.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 eitherECParameterSpec
orECGenParameterSpec
- 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
-
-