Class NamedCurveRegistrySingleton
java.lang.Object
se.swedenconnect.security.algorithms.curves.NamedCurveRegistrySingleton
- All Implemented Interfaces:
NamedCurveRegistry
A singleton for easy access to the
NamedCurveRegistry.- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
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.static NamedCurveRegistrySingletonGets the singleton instance.static voidsetAlgorithmRegistry(NamedCurveRegistry registry) Assigns theNamedCurveRegistryinstance to be used by this singleton.
-
Method Details
-
getInstance
Gets the singleton instance.- Returns:
- the singleton instance
-
setAlgorithmRegistry
Assigns theNamedCurveRegistryinstance to be used by this singleton. If no instance is assigned, a default implementation of the registry will be used.- Parameters:
registry- the registry to be used by the singleton
-
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
-