Class NamedCurveRegistryImpl
java.lang.Object
se.swedenconnect.security.algorithms.curves.NamedCurveRegistryImpl
- All Implemented Interfaces:
NamedCurveRegistry
- Direct Known Subclasses:
StaticNamedCurveRegistry
Implementation of the
NamedCurveRegistry interface.- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.NamedCurveRegistryImpl(List<NamedCurve> registry) Constructor setting up the registry according to the supplied list. -
Method Summary
Modifier and TypeMethodDescriptionGets aNamedCurvebased on its name.getCurve(Predicate<NamedCurve> predicate) Gets aNamedCurvebased on the given predicate.getCurves(Predicate<NamedCurve> predicate) Gets all curves that matches the given predicate.voidregister(NamedCurve curve) Registers the given curve in the registry.voidunregister(String name) Removes the given curve from the registry.
-
Constructor Details
-
NamedCurveRegistryImpl
public NamedCurveRegistryImpl()Default constructor. -
NamedCurveRegistryImpl
Constructor setting up the registry according to the supplied list.Note: a copy of the supplied registry is made.
- Parameters:
registry- initial contents of the registry
-
-
Method Details
-
register
Registers the given curve in the registry.- Parameters:
curve- the curve to register
-
unregister
Removes the given curve from the registry.- Parameters:
name- the curve name
-
getCurve
Gets aNamedCurvebased on its name.- Specified by:
getCurvein interfaceNamedCurveRegistry- Parameters:
name- the name- Returns:
- the NamedCurve or null if no match is found
-
getCurve
Gets aNamedCurvebased on the given predicate.- Specified by:
getCurvein interfaceNamedCurveRegistry- Parameters:
predicate- the predicate- Returns:
- the first curve that matches the supplied predicate, or null if no matches are found
-
getCurves
Gets all curves that matches the given predicate.- Specified by:
getCurvesin interfaceNamedCurveRegistry- Parameters:
predicate- the predicate- Returns:
- a (possibly empty) list of NamedCurve objects
-