Message Security Layer (MSL)

com.netflix.msl.entityauth
Class EntityAuthenticationData

java.lang.Object
  extended by com.netflix.msl.entityauth.EntityAuthenticationData
Direct Known Subclasses:
PresharedAuthenticationData, RsaAuthenticationData, UnauthenticatedAuthenticationData, X509AuthenticationData

public abstract class EntityAuthenticationData
extends Object

The entity authentication data provides proof of entity identity.

Specific entity authentication mechanisms should define their own entity authentication data types.

Entity authentication data is represented as entityauthdata = { "#mandatory" : [ "scheme", "authdata" ], "scheme" : "string", "authdata" : object } where:


Field Summary
private static String KEY_AUTHDATA
          JSON key entity authentication data.
private static String KEY_SCHEME
          JSON key entity authentication scheme.
private  EntityAuthenticationScheme scheme
          Entity authentication scheme.
 
Constructor Summary
protected EntityAuthenticationData(EntityAuthenticationScheme scheme)
          Create a new entity authentication data object with the specified entity authentication scheme.
 
Method Summary
static EntityAuthenticationData create(MslContext ctx, JSONObject entityAuthJO)
          Construct a new entity authentication data instance of the correct type from the provided JSON object.
 boolean equals(Object obj)
           
abstract  JSONObject getAuthData()
           
abstract  String getIdentity()
           
 EntityAuthenticationScheme getScheme()
           
 int hashCode()
           
 String toJSONString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_SCHEME

private static final String KEY_SCHEME
JSON key entity authentication scheme.

See Also:
Constant Field Values

KEY_AUTHDATA

private static final String KEY_AUTHDATA
JSON key entity authentication data.

See Also:
Constant Field Values

scheme

private final EntityAuthenticationScheme scheme
Entity authentication scheme.

Constructor Detail

EntityAuthenticationData

protected EntityAuthenticationData(EntityAuthenticationScheme scheme)
Create a new entity authentication data object with the specified entity authentication scheme.

Parameters:
scheme - the entity authentication scheme.
Method Detail

create

public static EntityAuthenticationData create(MslContext ctx,
                                              JSONObject entityAuthJO)
                                       throws MslEntityAuthException,
                                              MslEncodingException,
                                              MslCryptoException
Construct a new entity authentication data instance of the correct type from the provided JSON object.

Parameters:
ctx - MSL context.
entityAuthJO - the JSON object.
Returns:
the entity authentication data concrete instance.
Throws:
MslEntityAuthException - if unable to create the entity authentication data.
MslEncodingException - if there is an error parsing the entity authentication data.
MslCryptoException - if there is an error creating the entity authentication data crypto.

getScheme

public EntityAuthenticationScheme getScheme()
Returns:
the entity authentication scheme.

getIdentity

public abstract String getIdentity()
                            throws MslCryptoException
Returns:
the entity identity.
Throws:
MslCryptoException - if there is a crypto error accessing the entity identity.

getAuthData

public abstract JSONObject getAuthData()
                                throws MslEncodingException
Returns:
the authentication data JSON representation.
Throws:
MslEncodingException - if there was an error constructing the JSON representation.

toJSONString

public final String toJSONString()

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

Message Security Layer (MSL)

Copyright © 2014 Netflix, Inc. All Rights Reserved.