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.KeySpec
    A 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
      NamedParameterSpec getParams()
      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.
      • Methods inherited from class java.lang.Object

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

      • XECPrivateKeySpec

        public XECPrivateKeySpec(java.security.spec.AlgorithmParameterSpec params,
                                 java.util.Optional<byte[]> scalar)
                          throws java.lang.NullPointerException,
                                 java.security.spec.InvalidParameterSpecException
        Construct a private key spec from params
        Parameters:
        params - the algorithm parameters
        scalar - the scalar value
        Throws:
        java.lang.NullPointerException - if either of scalar or params is null
        java.security.spec.InvalidParameterSpecException - if params is 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

© Portions Copyright 2003, 2023 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2023 Oracle and/or its affiliates. All rights reserved.