@Immutable public final class KeyType extends java.lang.Object implements net.minidev.json.JSONAware
kty parameter in a JSON Web Key
(JWK). This class is immutable.
Includes constants for the following standard key types:
Additional key types can be defined using the constructor.
| Modifier and Type | Field and Description |
|---|---|
static KeyType |
EC
Elliptic Curve (DSS) key type (recommended).
|
static KeyType |
OCT
Octet sequence key type (optional)
|
static KeyType |
RSA
RSA (RFC 3447) key type (required).
|
| Constructor and Description |
|---|
KeyType(java.lang.String value,
Requirement req)
Creates a new key type with the specified value and implementation
requirement.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object object)
Overrides
Object.equals(). |
Requirement |
getRequirement()
Gets the implementation requirement of this key type.
|
java.lang.String |
getValue()
Gets the value of this key type.
|
int |
hashCode()
Overrides
Object.hashCode(). |
static KeyType |
parse(java.lang.String s)
Parses a key type from the specified string.
|
java.lang.String |
toJSONString()
Returns the JSON string representation of this key type.
|
java.lang.String |
toString()
Returns the string representation of this key type.
|
public KeyType(java.lang.String value, Requirement req)
value - The key type value. Values are case sensitive. Must not
be null.req - The implementation requirement, null if not
known.public java.lang.String getValue()
public Requirement getRequirement()
null if not known.public int hashCode()
Object.hashCode().hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object object)
Object.equals().equals in class java.lang.Objectobject - The object to compare to.true if the objects have the same value, otherwise
false.public java.lang.String toString()
toString in class java.lang.ObjectgetValue()public java.lang.String toJSONString()
toJSONString in interface net.minidev.json.JSONAwareCopyright © 2013 NimbusDS. All Rights Reserved.