Message Security Layer (MSL)

com.netflix.msl.keyx
Class JsonWebKeyLadderExchange.RequestData

java.lang.Object
  extended by com.netflix.msl.keyx.KeyRequestData
      extended by com.netflix.msl.keyx.JsonWebKeyLadderExchange.RequestData
Enclosing class:
JsonWebKeyLadderExchange

public static class JsonWebKeyLadderExchange.RequestData
extends KeyRequestData

JSON Web Key ladder key request data.

{ "#mandatory" : [ "mechanism" ], "mechanism" : "enum(PSK|MGK|WRAP)", "wrapdata" : "base64", } where:


Field Summary
private static String KEY_MECHANISM
          JSON key wrap key wrapping mechanism.
private static String KEY_WRAPDATA
          JSON key wrap data.
private  JsonWebKeyLadderExchange.Mechanism mechanism
          Wrap key wrapping mechanism.
private  byte[] wrapdata
          Wrap data.
 
Constructor Summary
JsonWebKeyLadderExchange.RequestData(JSONObject keyRequestJO)
          Create a new JSON Web Key ladder key request data instance from the provided JSON object.
JsonWebKeyLadderExchange.RequestData(JsonWebKeyLadderExchange.Mechanism mechanism, byte[] wrapdata)
          Create a new JSON Web Key ladder key request data instance with the specified mechanism and wrapping key data.
 
Method Summary
 boolean equals(Object obj)
           
protected  JSONObject getKeydata()
           
 JsonWebKeyLadderExchange.Mechanism getMechanism()
           
 byte[] getWrapdata()
           
 int hashCode()
           
 
Methods inherited from class com.netflix.msl.keyx.KeyRequestData
create, getKeyExchangeScheme, toJSONString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_MECHANISM

private static final String KEY_MECHANISM
JSON key wrap key wrapping mechanism.

See Also:
Constant Field Values

KEY_WRAPDATA

private static final String KEY_WRAPDATA
JSON key wrap data.

See Also:
Constant Field Values

mechanism

private final JsonWebKeyLadderExchange.Mechanism mechanism
Wrap key wrapping mechanism.


wrapdata

private final byte[] wrapdata
Wrap data.

Constructor Detail

JsonWebKeyLadderExchange.RequestData

public JsonWebKeyLadderExchange.RequestData(JsonWebKeyLadderExchange.Mechanism mechanism,
                                            byte[] wrapdata)

Create a new JSON Web Key ladder key request data instance with the specified mechanism and wrapping key data.

Arguments not applicable to the specified mechanism are ignored.

Parameters:
mechanism - the wrap key wrapping mechanism.
wrapdata - the wrap data for reconstructing the previous wrapping key. May be null if the mechanism does not use the previous wrapping key.
Throws:
MslInternalException - if the mechanism requires wrap data and the required argument is null.

JsonWebKeyLadderExchange.RequestData

public JsonWebKeyLadderExchange.RequestData(JSONObject keyRequestJO)
                                     throws MslCryptoException,
                                            MslKeyExchangeException,
                                            MslEncodingException
Create a new JSON Web Key ladder key request data instance from the provided JSON object.

Parameters:
keyRequestJO - the JSON object.
Throws:
MslEncodingException - if there is an error parsing the JSON.
MslCryptoException - the wrapped key data cannot be verified or decrypted, or the specified mechanism is not supported.
MslKeyExchangeException - if the specified mechanism is not recognized or the wrap data is missing or invalid.
Method Detail

getMechanism

public JsonWebKeyLadderExchange.Mechanism getMechanism()
Returns:
the wrap key wrapping mechanism.

getWrapdata

public byte[] getWrapdata()
Returns:
the previous wrapping key data or null if not applicable.

getKeydata

protected JSONObject getKeydata()
                         throws JSONException
Specified by:
getKeydata in class KeyRequestData
Returns:
the key data JSON representation.
Throws:
JSONException - if there was an error constructing the JSON representation.

equals

public boolean equals(Object obj)
Overrides:
equals in class KeyRequestData

hashCode

public int hashCode()
Overrides:
hashCode in class KeyRequestData

Message Security Layer (MSL)

Copyright © 2014 Netflix, Inc. All Rights Reserved.