java.lang.Object
com.ibm.crypto.hdwrCCA.provider.ECHWKeyParameterSpec
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionECHWKeyParameterSpec
(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, 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, String label) Construct an Elliptic Curve parameter set from the specified key size, key type, and PKDS record label.ECHWKeyParameterSpec
(String name, byte type) Construct a parameter set using a standard Elliptic Curve name.ECHWKeyParameterSpec
(String name, byte type, byte usage) Construct a parameter set using a standard Elliptic Curve name.ECHWKeyParameterSpec
(String name, byte type, byte usage, String label) Construct a parameter set using a standard Elliptic Curve name.ECHWKeyParameterSpec
(EllipticCurve curve, ECPoint g, BigInteger n, int h, byte type) Construct a parameter set from the set of domain parameters of a standard Elliptic Curve.ECHWKeyParameterSpec
(EllipticCurve curve, ECPoint g, BigInteger n, int h, byte type, byte usage) Construct a parameter set from the set of domain parameters of a standard Elliptic Curve.ECHWKeyParameterSpec
(EllipticCurve curve, ECPoint g, BigInteger n, int h, byte type, byte usage, 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, 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
Modifier and TypeMethodDescriptionReturns hardware key attributes.int
Returns the key size.getLabel()
Returns the label that will be used to identify the key in the PKDS.<T extends AlgorithmParameterSpec>
TgetParameterSpec
(Class<T> spec) Returns the requested parameter specification.
-
Constructor Details
-
ECHWKeyParameterSpec
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:
IllegalArgumentException
- if the specified hardware key type is not supported
-
ECHWKeyParameterSpec
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:
IllegalArgumentException
- if the specified hardware key type or key usage is not supported
-
ECHWKeyParameterSpec
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:
InvalidParameterException
- if the supplied key size is not supportedIllegalArgumentException
- 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 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:
InvalidParameterException
- if the supplied key size is not supportedIllegalArgumentException
- 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 eitherECParameterSpec
orECGenParameterSpec
type
- the hardware key type, either CLEAR or PKDS- Throws:
InvalidParameterSpecException
- if the specified parameter specification is not supportedIllegalArgumentException
- 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 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:
InvalidParameterSpecException
- if the specified parameter specification is not supportedIllegalArgumentException
- 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 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:
InvalidParameterSpecException
- if the specified parameter specification is not supportedIllegalArgumentException
- if the specified hardware key type or key usage is not supported, or PKDS label is not valid
-
ECHWKeyParameterSpec
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:
NullPointerException
- if the supplied name is nullIllegalArgumentException
- for any parameter values outside the bounds for that parameter
-
ECHWKeyParameterSpec
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:
NullPointerException
- if the supplied name is nullIllegalArgumentException
- 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 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:
NullPointerException
- if the supplied name is nullIllegalArgumentException
- 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 curveg
- the generatorn
- the orderh
- the cofactortype
- the hardware key type, PKDS or CLEAR- Throws:
NullPointerException
- if curve, g, or n is nullIllegalArgumentException
- 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 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:
NullPointerException
- if curve, g, or n is nullIllegalArgumentException
- 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 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:
NullPointerException
- if curve, g, or n is nullIllegalArgumentException
- 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 eitherECParameterSpec
orECGenParameterSpec
- Returns:
- the requested parameter specification
- Throws:
InvalidParameterSpecException
- if the parameter specification is not appropriate
-
getAttributes
Returns hardware key attributes.- Returns:
- the hardware key attributes
-
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
-