Package com.nimbusds.jose
Class Algorithm
- java.lang.Object
-
- com.nimbusds.jose.Algorithm
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
EncryptionMethod
,JWEAlgorithm
,JWSAlgorithm
@Immutable public class Algorithm extends Object implements Serializable
The base class for algorithm names, with optional implementation requirement. This class is immutable.Includes constants for the following standard algorithm names:
- Version:
- 2020-06-03
- Author:
- Vladimir Dzhuvinov
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Algorithm(String name)
Creates a new JOSE algorithm name.Algorithm(String name, Requirement req)
Creates a new JOSE algorithm name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object object)
OverridesObject.equals()
.String
getName()
Gets the name of this algorithm.Requirement
getRequirement()
Gets the implementation requirement of this algorithm.int
hashCode()
OverridesObject.hashCode()
.static Algorithm
parse(String s)
Parses an optional algorithm.String
toJSONString()
Returns the JSON string representation of this algorithm.String
toString()
Returns the string representation of this algorithm.
-
-
-
Constructor Detail
-
Algorithm
public Algorithm(String name, Requirement req)
Creates a new JOSE algorithm name.- Parameters:
name
- The algorithm name. Must not benull
.req
- The implementation requirement,null
if not known.
-
-
Method Detail
-
getRequirement
public final Requirement getRequirement()
Gets the implementation requirement of this algorithm.- Returns:
- The implementation requirement,
null
if not known.
-
hashCode
public final int hashCode()
OverridesObject.hashCode()
.
-
toJSONString
public final String toJSONString()
Returns the JSON string representation of this algorithm.- Returns:
- The JSON string representation.
-
-