Package org.eclipse.ditto.jwt.model
Class ImmutableJsonWebKey
java.lang.Object
org.eclipse.ditto.jwt.model.ImmutableJsonWebKey
- All Implemented Interfaces:
JsonWebKey
Immutable implementation of
JsonWebKey.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.ditto.jwt.model.JsonWebKey
JsonWebKey.JsonFields -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic JsonWebKeyReturns a newJsonWebKeyfor the givenjsonString.static JsonWebKeyfromJson(org.eclipse.ditto.json.JsonObject jsonObject) Returns a newJsonWebKeyfor the givenjsonObject.Returns the algorithm parameter.Returns the curve type.Returns the exponent parameter.getId()Returns the id parameter.Returns the modulus parameter.getType()Returns the key type parameter.getUsage()Returns the usage parameter.Returns the EC X coordinate.Returns the EC Y coordinate.inthashCode()static JsonWebKeyof(String type, String algorithm, String usage, String id, BigInteger modulus, BigInteger exponent, BigInteger xCoordinate, BigInteger yCoordinate, String curveType) Returns a newJsonWebKeyfor the giventype,algorithm,usage,id,modulusandexponent.toString()
-
Method Details
-
of
public static JsonWebKey of(String type, @Nullable String algorithm, @Nullable String usage, String id, @Nullable BigInteger modulus, @Nullable BigInteger exponent, @Nullable BigInteger xCoordinate, @Nullable BigInteger yCoordinate, @Nullable String curveType) Returns a newJsonWebKeyfor the giventype,algorithm,usage,id,modulusandexponent.- Parameters:
type- the type of the JWK.algorithm- the algorithm of the JWK ornull.usage- the usage of the JWK ornull.id- the ID of the JWK.modulus- the optional modulus of the JWK.exponent- the optional exponent of the JWK.xCoordinate- the optional EC X coordinate.yCoordinate- the optional EC Y coordinate.curveType- the optional type of the used curve.- Returns:
- the JsonWebKey.
- Throws:
NullPointerException- if any argument butalgorithmorusageisnull.IllegalArgumentException- if anyStringargument is empty.
-
fromJson
Returns a newJsonWebKeyfor the givenjsonString.- Parameters:
jsonString- the string containing the JSON Web Key.- Returns:
- the JsonWebKey.
-
fromJson
Returns a newJsonWebKeyfor the givenjsonObject.- Parameters:
jsonObject- the object containing the JSON Web Key.- Returns:
- the JsonWebKey.
- Throws:
org.eclipse.ditto.json.JsonMissingFieldException- if anyJsonFieldis missing.
-
getType
Description copied from interface:JsonWebKeyReturns the key type parameter.- Specified by:
getTypein interfaceJsonWebKey- Returns:
- the key type.
-
getAlgorithm
Description copied from interface:JsonWebKeyReturns the algorithm parameter.- Specified by:
getAlgorithmin interfaceJsonWebKey- Returns:
- the algorithm.
-
getUsage
Description copied from interface:JsonWebKeyReturns the usage parameter.- Specified by:
getUsagein interfaceJsonWebKey- Returns:
- the usage.
-
getId
Description copied from interface:JsonWebKeyReturns the id parameter.- Specified by:
getIdin interfaceJsonWebKey- Returns:
- the id.
-
getModulus
Description copied from interface:JsonWebKeyReturns the modulus parameter.- Specified by:
getModulusin interfaceJsonWebKey- Returns:
- the modulus.
-
getExponent
Description copied from interface:JsonWebKeyReturns the exponent parameter.- Specified by:
getExponentin interfaceJsonWebKey- Returns:
- the exponent.
-
getXCoordinate
Description copied from interface:JsonWebKeyReturns the EC X coordinate.- Specified by:
getXCoordinatein interfaceJsonWebKey- Returns:
- the EC X coordinate.
-
getYCoordinate
Description copied from interface:JsonWebKeyReturns the EC Y coordinate.- Specified by:
getYCoordinatein interfaceJsonWebKey- Returns:
- the EC Y coordinate.
-
getCurveType
Description copied from interface:JsonWebKeyReturns the curve type.- Specified by:
getCurveTypein interfaceJsonWebKey- Returns:
- the curve type.
-
equals
-
hashCode
public int hashCode() -
toString
-