public class AlgorithmRegistry extends Object
AlgorithmDescriptor
instances, to support various use cases for working with algorithm URIs.Modifier and Type | Class and Description |
---|---|
protected class |
AlgorithmRegistry.SignatureAlgorithmIndex
Class used as index key for signature algorithm lookup.
|
Constructor and Description |
---|
AlgorithmRegistry()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear all registered algorithms.
|
void |
deregister(AlgorithmDescriptor descriptor)
Deregister an algorithm.
|
void |
deregister(String uri)
Deregister an algorithm.
|
AlgorithmDescriptor |
get(String algorithmURI)
Get the algorithm descriptor instance associated with the specified algorithm URI.
|
DigestAlgorithm |
getDigestAlgorithm(String digestMethod)
Lookup a digest method algorithm descriptor by the JCA digest method ID.
|
SignatureAlgorithm |
getSignatureAlgorithm(String keyType,
String digestMethod)
Lookup a signature algorithm descriptor by the JCA key algorithm and digest method IDs.
|
boolean |
isRuntimeSupported(String algorithmURI)
Retrieve indication of whether the runtime environment supports the algorithm.
|
void |
register(AlgorithmDescriptor descriptor)
Register an algorithm.
|
@Nullable public AlgorithmDescriptor get(@Nullable String algorithmURI)
algorithmURI
- the algorithm URI to resolvepublic boolean isRuntimeSupported(@Nullable String algorithmURI)
This evaluation is performed dynamically when the algorithm is registered.
algorithmURI
- the algorithm URI to evaluatepublic void clear()
public void register(@Nonnull AlgorithmDescriptor descriptor)
descriptor
- the algorithmpublic void deregister(@Nonnull AlgorithmDescriptor descriptor)
descriptor
- the algorithmpublic void deregister(@Nonnull String uri)
uri
- the algorithm URI@Nullable public DigestAlgorithm getDigestAlgorithm(@Nonnull String digestMethod)
digestMethod
- the JCA digest method ID.@Nullable public SignatureAlgorithm getSignatureAlgorithm(@Nonnull String keyType, @Nonnull String digestMethod)
keyType
- the JCA key algorithm ID.digestMethod
- the JCA digest method ID.Copyright © 2016 JBoss by Red Hat. All rights reserved.