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 anKeyBasedAlgorithm.- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractKeyBasedAlgorithm.AbstractKeyBasedAlgorithmBuilder<T extends AbstractKeyBasedAlgorithm,B extends AbstractKeyBasedAlgorithm.AbstractKeyBasedAlgorithmBuilder<T,? extends AlgorithmBuilder<T>>>Abstract builder forKeyBasedAlgorithmobjects.-
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
Constructors Modifier Constructor Description protectedAbstractKeyBasedAlgorithm(String uri)Protected constructor used by builders.AbstractKeyBasedAlgorithm(String uri, int order, String keyType, String jcaName, com.nimbusds.jose.Algorithm joseAlgorithm)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)StringgetKeyType()Gets the "key type", e.g.inthashCode()protected voidsetKeyType(String keyType)Sets the "key type" for the algorithm.StringtoString()-
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 Detail
-
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 AbstractKeyBasedAlgorithm(String uri)
Protected constructor used by builders.- Parameters:
uri- the algorithm URI
-
-
Method Detail
-
getKeyType
public String getKeyType()
Gets the "key type", e.g. "RSA", "AES", for the algorithm.- Specified by:
getKeyTypein interfaceKeyBasedAlgorithm- Returns:
- the key type
-
setKeyType
protected void setKeyType(String keyType)
Sets the "key type" for the algorithm.- Parameters:
keyType- the key type
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractJoseAlgorithm
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classAbstractJoseAlgorithm
-
toString
public String toString()
- Overrides:
toStringin classAbstractJoseAlgorithm
-
-