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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
NamedParameterSpec.CURVE
ENUM that identifiy's the elliptic curve to be used.
-
Constructor Summary
Constructors Constructor and Description NamedParameterSpec(int keySize)
Constructs keySize NamedParameterSpec from the keySize.NamedParameterSpec(NamedParameterSpec.CURVE curve)
Constructs a NamedParameterSpec from the curve enumNamedParameterSpec(java.lang.String curveName)
Constructs a NamedParameterSpec from the curve name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description NamedParameterSpec.CURVE
getCurve()
Returns the curve's type (enum)static NamedParameterSpec.CURVE
getCurveOfSize(int size)
Returns the curve from the given size.java.lang.String
getName()
Returns the curve's namestatic int
getPrivateCurveSize(NamedParameterSpec.CURVE curve)
Returns the private curve size from the given curve.static NamedParameterSpec.CURVE
getPublicCurveOfSize(int size)
Returns the public curve from the given size.static int
getPublicCurveSize(NamedParameterSpec.CURVE curve)
Returns the public curve size from the given curve.
-
-
-
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
-
getCurve
public NamedParameterSpec.CURVE getCurve()
Returns the curve's type (enum)- Returns:
- curve
-
-