|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nimbusds.jose.jwk.JWK com.nimbusds.jose.jwk.OctetSequenceKey
@Immutable public class OctetSequenceKey
Octet sequence
JSON Web Key (JWK), used to represent
symmetric keys. This class is immutable.
Example JSON object representation of an octet sequence JWK:
{ "kty" : "oct", "alg" : "A128KW", "k" : "GawgguFyGrWKav7AX4VKUg" }
Constructor Summary | |
---|---|
OctetSequenceKey(Base64URL k,
Use use,
Algorithm alg,
String kid)
Creates a new octet sequence JSON Web Key (JWK) with the specified parameters. |
|
OctetSequenceKey(byte[] k,
Use use,
Algorithm alg,
String kid)
Creates a new octet sequence JSON Web Key (JWK) with the specified parameters. |
Method Summary | |
---|---|
Base64URL |
getKeyValue()
Returns the value of this octet sequence key. |
boolean |
isPrivate()
Octet sequence (symmetric) keys are never considered public, this method always returns true . |
static OctetSequenceKey |
parse(net.minidev.json.JSONObject jsonObject)
Parses an octet sequence JWK from the specified JSON object representation. |
static OctetSequenceKey |
parse(String s)
Parses an octet sequence JWK from the specified JSON object string representation. |
byte[] |
toByteArray()
Returns a copy of this octet sequence key value as a byte array. |
net.minidev.json.JSONObject |
toJSONObject()
Returns a JSON object representation of this JWK. |
OctetSequenceKey |
toPublicJWK()
Octet sequence (symmetric) keys are never considered public, this method always returns null . |
Methods inherited from class com.nimbusds.jose.jwk.JWK |
---|
getAlgorithm, getKeyID, getKeyType, getKeyUse, parseAlgorithm, parseKeyID, parseKeyUse, toJSONString, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OctetSequenceKey(Base64URL k, Use use, Algorithm alg, String kid)
k
- The key value. It is represented as the Base64URL
encoding of value's big endian representation. Must not
be null
.use
- The key use. null
if not specified.alg
- The intended JOSE algorithm for the key, null
if
not specified.kid
- The key ID. null
if not specified.public OctetSequenceKey(byte[] k, Use use, Algorithm alg, String kid)
k
- The key value. It is represented as the value's big
endian representation. Must not be null
.use
- The key use. null
if not specified.alg
- The intended JOSE algorithm for the key, null
if
not specified.kid
- The key ID. null
if not specified.Method Detail |
---|
public Base64URL getKeyValue()
public byte[] toByteArray()
public boolean isPrivate()
true
.
isPrivate
in class JWK
true
public OctetSequenceKey toPublicJWK()
null
.
toPublicJWK
in class JWK
null
public net.minidev.json.JSONObject toJSONObject()
JWK
Example:
{ "kty" : "RSA", "use" : "sig", "kid" : "fd28e025-8d24-48bc-a51a-e2ffc8bc274b" }
toJSONObject
in class JWK
public static OctetSequenceKey parse(String s) throws ParseException
s
- The JSON object string to parse. Must not be null
.
ParseException
- If the string couldn't be parsed to an octet
sequence JWK.public static OctetSequenceKey parse(net.minidev.json.JSONObject jsonObject) throws ParseException
jsonObject
- The JSON object to parse. Must not be
ParseException
- If the JSON object couldn't be parsed to an
octet sequence JWK.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |