Class AbstractEncryptionAlgorithm
- java.lang.Object
-
- se.swedenconnect.security.algorithms.impl.AbstractAlgorithm
-
- se.swedenconnect.security.algorithms.impl.AbstractJoseAlgorithm
-
- se.swedenconnect.security.algorithms.impl.AbstractKeyBasedAlgorithm
-
- se.swedenconnect.security.algorithms.impl.AbstractEncryptionAlgorithm
-
- All Implemented Interfaces:
Algorithm,EncryptionAlgorithm,JoseAlgorithm,KeyBasedAlgorithm
- Direct Known Subclasses:
BlockEncryptionAlgorithmImpl,SymmetricKeyWrapImpl
public abstract class AbstractEncryptionAlgorithm extends AbstractKeyBasedAlgorithm implements EncryptionAlgorithm
Abstract base class for encryption algorithms.- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractEncryptionAlgorithm.AbstractEncryptionAlgorithmBuilder<T extends AbstractEncryptionAlgorithm,B extends AbstractEncryptionAlgorithm.AbstractEncryptionAlgorithmBuilder<T,? extends AlgorithmBuilder<T>>>Abstract builder forEncryptionAlgorithmobjects.-
Nested classes/interfaces inherited from class se.swedenconnect.security.algorithms.impl.AbstractKeyBasedAlgorithm
AbstractKeyBasedAlgorithm.AbstractKeyBasedAlgorithmBuilder<T extends AbstractKeyBasedAlgorithm,B extends AbstractKeyBasedAlgorithm.AbstractKeyBasedAlgorithmBuilder<T,? extends AlgorithmBuilder<T>>>
-
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 protectedAbstractEncryptionAlgorithm(String uri)Protected constructor used by builders.AbstractEncryptionAlgorithm(String uri, int order, String keyType, int keyLength, String jcaName, com.nimbusds.jose.Algorithm joseAlgorithm)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)intgetKeyLength()Gets the key length in bits.inthashCode()protected voidsetKeyLength(int keyLength)Assigns the key length in bits.StringtoString()-
Methods inherited from class se.swedenconnect.security.algorithms.impl.AbstractKeyBasedAlgorithm
getKeyType, setKeyType
-
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
-
Methods inherited from interface se.swedenconnect.security.algorithms.JoseAlgorithm
getJoseAlgorithm
-
Methods inherited from interface se.swedenconnect.security.algorithms.KeyBasedAlgorithm
getKeyType
-
-
-
-
Constructor Detail
-
AbstractEncryptionAlgorithm
public AbstractEncryptionAlgorithm(String uri, int order, String keyType, int keyLength, String jcaName, com.nimbusds.jose.Algorithm joseAlgorithm)
Constructor.- Parameters:
uri- the algorithm URIorder- the ordering for the algorithmkeyType- the key typekeyLength- the key length in bitsjcaName- the JCA namejoseAlgorithm- the JOSE algorithm (may be null)
-
AbstractEncryptionAlgorithm
protected AbstractEncryptionAlgorithm(String uri)
Protected constructor used by builders.- Parameters:
uri- the algorithm URI
-
-
Method Detail
-
getKeyLength
public int getKeyLength()
Gets the key length in bits.- Specified by:
getKeyLengthin interfaceEncryptionAlgorithm- Returns:
- the key length
-
setKeyLength
protected void setKeyLength(int keyLength)
Assigns the key length in bits.- Parameters:
keyLength- the key length in bits
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractKeyBasedAlgorithm
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classAbstractKeyBasedAlgorithm
-
toString
public String toString()
- Overrides:
toStringin classAbstractKeyBasedAlgorithm
-
-