ibm.security.internal.spec

Class NamedParameterSpec

  • java.lang.Object
    • ibm.security.internal.spec.NamedParameterSpec
  • All Implemented Interfaces:
    java.security.spec.AlgorithmParameterSpec


    public class NamedParameterSpec
    extends java.lang.Object
    implements java.security.spec.AlgorithmParameterSpec
    This class is used to specify any algorithm parameters that are determined by a standard name. This class also holds constants for standard parameter set names. The names of these constants exactly match the corresponding parameter set name. For example, NamedParameterSpec.X25519 represents the parameter set identified by the string "X25519".
    Since:
    1.8
    • Constructor Detail

      • NamedParameterSpec

        public NamedParameterSpec(java.lang.String curveName)
                           throws java.security.InvalidParameterException
        Constructs a NamedParameterSpec from the curve name. The curve names are :
        • "X25519"
        • "X448"
        • "FFDHE2048"
        • "FFDHE3072"
        • "FFDHE4096"
        • "FFDHE6144"
        • "FFDHE8192"
        • "Ed25519"
        • "Ed448"
        Parameters:
        curveName - the name of the curve
        Throws:
        java.security.InvalidParameterException - if the curve name is not supported
      • NamedParameterSpec

        public NamedParameterSpec(int keySize)
                           throws java.security.InvalidParameterException
        Constructs keySize NamedParameterSpec from the keySize.
        Parameters:
        keySize - the size of the key
        Throws:
        java.security.InvalidParameterException
      • NamedParameterSpec

        public NamedParameterSpec(NamedParameterSpec.CURVE curve)
                           throws java.security.InvalidParameterException
        Constructs a NamedParameterSpec from the curve enum
        Parameters:
        curve - the elliptic curve
        Throws:
        java.security.InvalidParameterException
    • Method Detail

      • getPublicCurveSize

        public static int getPublicCurveSize(NamedParameterSpec.CURVE curve)
                                      throws java.security.InvalidParameterException
        Returns the public curve size from the given curve.
        Parameters:
        curve - the curve
        Throws:
        java.security.InvalidParameterException - if curve is not supported
      • getPrivateCurveSize

        public static int getPrivateCurveSize(NamedParameterSpec.CURVE curve)
                                       throws java.security.InvalidParameterException
        Returns the private curve size from the given curve.
        Parameters:
        curve - the elliptic curve
        Throws:
        java.security.InvalidParameterException - if curve is not supported
      • getPublicCurveOfSize

        public static NamedParameterSpec.CURVE getPublicCurveOfSize(int size)
                                                             throws java.security.InvalidParameterException
        Returns the public curve from the given size.
        Parameters:
        size - the size of the curve
        Throws:
        java.security.InvalidParameterException - if the public key size does not correspond to a supported curve
      • getCurveOfSize

        public static NamedParameterSpec.CURVE getCurveOfSize(int size)
                                                       throws java.security.InvalidParameterException
        Returns the curve from the given size.
        Parameters:
        size - the size of the curve
        Throws:
        java.security.InvalidParameterException - if the key size does not correspond to a supported curve
      • getName

        public java.lang.String getName()
        Returns the curve's name
        Returns:
        curveName

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