Class AbstractKeyBasedAlgorithm
java.lang.Object
se.swedenconnect.security.algorithms.impl.AbstractAlgorithm
se.swedenconnect.security.algorithms.impl.AbstractJoseAlgorithm
se.swedenconnect.security.algorithms.impl.AbstractKeyBasedAlgorithm
- All Implemented Interfaces:
Algorithm
,JoseAlgorithm
,KeyBasedAlgorithm
- Direct Known Subclasses:
AbstractEncryptionAlgorithm
,KeyTransportAlgorithmImpl
,SignatureAlgorithmImpl
public abstract class AbstractKeyBasedAlgorithm
extends AbstractJoseAlgorithm
implements KeyBasedAlgorithm
Abstract implementation of an
KeyBasedAlgorithm
.- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
AbstractKeyBasedAlgorithm.AbstractKeyBasedAlgorithmBuilder<T extends AbstractKeyBasedAlgorithm,
B extends AbstractKeyBasedAlgorithm.AbstractKeyBasedAlgorithmBuilder<T, ? extends AlgorithmBuilder<T>>> Abstract builder forKeyBasedAlgorithm
objects.Nested classes/interfaces inherited from class se.swedenconnect.security.algorithms.impl.AbstractJoseAlgorithm
AbstractJoseAlgorithm.AbstractJoseAlgorithmBuilder<T extends AbstractJoseAlgorithm,
B extends AbstractJoseAlgorithm.AbstractJoseAlgorithmBuilder<T, ? extends AlgorithmBuilder<T>>> Nested classes/interfaces inherited from class se.swedenconnect.security.algorithms.impl.AbstractAlgorithm
AbstractAlgorithm.AbstractAlgorithmBuilder<T extends AbstractAlgorithm,
B extends AlgorithmBuilder<T>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Protected constructor used by builders.AbstractKeyBasedAlgorithm
(String uri, int order, String keyType, String jcaName, com.nimbusds.jose.Algorithm joseAlgorithm) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the "key type", e.g.int
hashCode()
protected void
setKeyType
(String keyType) Sets the "key type" for the algorithm.toString()
Methods inherited from class se.swedenconnect.security.algorithms.impl.AbstractJoseAlgorithm
getJoseAlgorithm, setJoseAlgorithm
Methods inherited from class se.swedenconnect.security.algorithms.impl.AbstractAlgorithm
getJcaName, getOrder, getUri, isBlacklisted, setBlacklisted, setJcaName, setOrder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface se.swedenconnect.security.algorithms.Algorithm
getJcaName, getOrder, getType, getUri, isBlacklisted
-
Constructor Details
-
AbstractKeyBasedAlgorithm
public AbstractKeyBasedAlgorithm(String uri, int order, String keyType, String jcaName, com.nimbusds.jose.Algorithm joseAlgorithm) Constructor.- Parameters:
uri
- the algorithm URIorder
- the ordering for the algorithmkeyType
- the key typejcaName
- the JCA namejoseAlgorithm
- the JOSE algorithm (may be null)
-
AbstractKeyBasedAlgorithm
Protected constructor used by builders.- Parameters:
uri
- the algorithm URI
-
-
Method Details
-
getKeyType
Gets the "key type", e.g. "RSA", "AES", for the algorithm.- Specified by:
getKeyType
in interfaceKeyBasedAlgorithm
- Returns:
- the key type
-
setKeyType
Sets the "key type" for the algorithm.- Parameters:
keyType
- the key type
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractJoseAlgorithm
-
equals
- Overrides:
equals
in classAbstractJoseAlgorithm
-
toString
- Overrides:
toString
in classAbstractJoseAlgorithm
-