ibm.security.internal.spec
Class XECPrivateKeySpec
- java.lang.Object
-
- ibm.security.internal.spec.XECPrivateKeySpec
-
- All Implemented Interfaces:
- java.security.spec.KeySpec
public class XECPrivateKeySpec extends java.lang.Object implements java.security.spec.KeySpecA class representing elliptic curve private keys as defined in RFC 7748, including the curve and other algorithm parameters. The private key is represented as an encoded scalar value. The decoding procedure defined in the RFC includes an operation that forces certain bits of the key to either 1 or 0. This operation is known as "pruning" or "clamping" the private key. All arrays in this spec are unpruned, and implementations will need to prune the array before using it in any numerical operations.- Since:
- 1.8
-
-
Constructor Summary
Constructors Constructor and Description XECPrivateKeySpec(java.security.spec.AlgorithmParameterSpec params, java.util.Optional<byte[]> scalar)Construct a private key spec from params
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description NamedParameterSpecgetParams()Get the algorithm parameters that define the curve and other settings.java.util.Optional<byte[]>getScalar()Get the scalar value encoded as an unpruned byte array.
-
-
-
Constructor Detail
-
XECPrivateKeySpec
public XECPrivateKeySpec(java.security.spec.AlgorithmParameterSpec params, java.util.Optional<byte[]> scalar) throws java.lang.NullPointerException, java.security.spec.InvalidParameterSpecExceptionConstruct a private key spec from params- Parameters:
params- the algorithm parametersscalar- the scalar value- Throws:
java.lang.NullPointerException- if either ofscalarorparamsis nulljava.security.spec.InvalidParameterSpecException- ifparamsis not of type NamedParameterSpec
-
-
Method Detail
-
getScalar
public java.util.Optional<byte[]> getScalar()
Get the scalar value encoded as an unpruned byte array.- Returns:
- the unpruned encoded scalar value
-
getParams
public NamedParameterSpec getParams()
Get the algorithm parameters that define the curve and other settings.- Returns:
- the algorithm parameters
-
-