Package com.nimbusds.jose
Class Algorithm
java.lang.Object
com.nimbusds.jose.Algorithm
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
EncryptionMethod
,JWEAlgorithm
,JWSAlgorithm
The base class for algorithm names, with optional implementation
requirement. This class is immutable.
Includes constants for the following standard algorithm names:
- Version:
- 2024-04-20
- Author:
- Vladimir Dzhuvinov
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new JOSE algorithm name.Algorithm
(String name, Requirement req) Creates a new JOSE algorithm name. -
Method Summary
Modifier and TypeMethodDescriptionboolean
OverridesObject.equals()
.final String
getName()
Gets the name of this algorithm.final Requirement
Gets the implementation requirement of this algorithm.final int
hashCode()
OverridesObject.hashCode()
.static Algorithm
Parses an optional algorithm.final String
Returns the JSON string representation of this algorithm.final String
toString()
Returns the string representation of this algorithm.
-
Field Details
-
NONE
No algorithm (unsecured JOSE object without signature / encryption).
-
-
Constructor Details
-
Algorithm
Creates a new JOSE algorithm name.- Parameters:
name
- The algorithm name. Must not benull
.req
- The implementation requirement,null
if not known.
-
Algorithm
Creates a new JOSE algorithm name.- Parameters:
name
- The algorithm name. Must not benull
.
-
-
Method Details
-
getName
Gets the name of this algorithm.- Returns:
- The algorithm name.
-
getRequirement
Gets the implementation requirement of this algorithm.- Returns:
- The implementation requirement,
null
if not known.
-
hashCode
OverridesObject.hashCode()
. -
equals
OverridesObject.equals()
. -
toString
Returns the string representation of this algorithm. -
toJSONString
Returns the JSON string representation of this algorithm.- Returns:
- The JSON string representation.
-
parse
Parses an optional algorithm.- Parameters:
s
- The string to parse. May benull
.- Returns:
- The JOSE algorithm,
null
if not specified.
-