Package org.opensaml.security.crypto.ec

# Class NamedCurveRegistry

java.lang.Object
org.opensaml.security.crypto.ec.NamedCurveRegistry

public class NamedCurveRegistry extends Object
A registry of `NamedCurve` descriptors.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final Map<String,NamedCurve>`
`byName`
Index by name.
`private final Map<String,NamedCurve>`
`byOID`
Index by OID.
`private final Map<EnhancedECParameterSpec,NamedCurve>`
`byParamSpec`
Index by `EnhancedECParameterSpec`.
`private final Map<String,NamedCurve>`
`byURI`
Index by URI.
`private final org.slf4j.Logger`
`log`
Logger.

## Constructor Summary

Constructors
Constructor
Description
`NamedCurveRegistry()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`clear()`
Clear all registered curves.
`void`
`deregister(NamedCurve curve)`
Deregister a curve.
`void`
`deregisterByName(String name)`
Deregister a curve.
`void`
`deregisterByOID(String oid)`
Deregister a curve.
`void`
`deregisterByParameterSpec(ECParameterSpec spec)`
Deregister a curve.
`void`
`deregisterByURI(String uri)`
Deregister a curve.
`NamedCurve`
`getByName(String name)`
Lookup a curve by the canonical name by which it is known to the Java Cryptography Architecture (JCA).
`NamedCurve`
`getByOID(String oid)`
Lookup a curve by object identifier (OID).
`NamedCurve`
`getByParameterSpec(ECParameterSpec spec)`
Lookup a curve by `ECParameterSpec`.
`NamedCurve`
`getByURI(String uri)`
Lookup a curve by URI.
`Set<NamedCurve>`
`getRegisteredCurves()`
Get a set of all the registered curves.
`void`
`register(NamedCurve curve)`
Register a curve.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Logger.

### byOID

@Nonnull private final Map<String,NamedCurve> byOID
Index by OID.

### byURI

@Nonnull private final Map<String,NamedCurve> byURI
Index by URI.

### byName

@Nonnull private final Map<String,NamedCurve> byName
Index by name.

### byParamSpec

@Nonnull private final Map<EnhancedECParameterSpec,NamedCurve> byParamSpec
Index by `EnhancedECParameterSpec`.

## Constructor Details

### NamedCurveRegistry

public NamedCurveRegistry()
Constructor.

## Method Details

### register

public void register(@Nonnull NamedCurve curve)
Register a curve.

Parameters:
  `curve` - the curve to register

### deregister

public void deregister(@Nonnull NamedCurve curve)
Deregister a curve.

Parameters:
  `curve` - the curve to deregister

### deregisterByOID

public void deregisterByOID(@Nonnull String oid)
Deregister a curve.

Parameters:
  `oid` - the object identifier (OID) of the curve to deregister

### deregisterByURI

public void deregisterByURI(@Nonnull String uri)
Deregister a curve.

Parameters:
  `uri` - the URI

### deregisterByName

public void deregisterByName(@Nonnull String name)
Deregister a curve.

Parameters:
  `name` - the curve name

### deregisterByParameterSpec

public void deregisterByParameterSpec(@Nonnull ECParameterSpec spec)
Deregister a curve.

Parameters:
  `spec` - the parameter spec instance

### clear

public void clear()
Clear all registered curves.

### getRegisteredCurves

@Nonnull @Unmodifiable @NotLive public Set<NamedCurve> getRegisteredCurves()
Get a set of all the registered curves.

Returns:
  the set of registered curves

### getByOID

@Nullable public NamedCurve getByOID(@Nonnull String oid)
Lookup a curve by object identifier (OID).

Parameters:
  `oid` - the object identifier
Returns:
  the `NamedCurve` instance, or null if no registered curve matched

### getByURI

@Nullable public NamedCurve getByURI(@Nonnull String uri)
Lookup a curve by URI.

Parameters:
  `uri` - the URI
Returns:
  the `NamedCurve` instance, or null if no registered curve matched

### getByName

@Nullable public NamedCurve getByName(@Nonnull String name)
Lookup a curve by the canonical name by which it is known to the Java Cryptography Architecture (JCA).

Parameters:
  `name` - the name
Returns:
  the `NamedCurve` instance, or null if no registered curve matched

### getByParameterSpec

@Nullable public NamedCurve getByParameterSpec(@Nonnull ECParameterSpec spec)
Lookup a curve by `ECParameterSpec`.

Parameters:
  `spec` - the parameter spec instance
Returns:
  the `NamedCurve` instance, or null if no registered curve matched