Message Security Layer (MSL)

com.netflix.msl.entityauth
Class EntityAuthenticationFactory

java.lang.Object
  extended by com.netflix.msl.entityauth.EntityAuthenticationFactory

public abstract class EntityAuthenticationFactory
extends Object

A entity authentication factory creates authentication data instances and authenticators for a specific entity authentication scheme.


Constructor Summary
protected EntityAuthenticationFactory(EntityAuthenticationScheme scheme)
          Create a new entity authentication factory for the specified scheme.
 
Method Summary
abstract  EntityAuthenticationData createData(MslContext ctx, JSONObject entityAuthJO)
          Construct a new entity authentication data instance from the provided JSON.
abstract  ICryptoContext getCryptoContext(MslContext ctx, EntityAuthenticationData authdata)
          Create a crypto context that can be used to encrypt/decrypt and authenticate data from the entity.
 EntityAuthenticationScheme getScheme()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityAuthenticationFactory

protected EntityAuthenticationFactory(EntityAuthenticationScheme scheme)
Create a new entity authentication factory for the specified scheme.

Parameters:
scheme - the entity authentication scheme.
Method Detail

getScheme

public EntityAuthenticationScheme getScheme()
Returns:
the entity authentication scheme this factory is for.

createData

public abstract EntityAuthenticationData createData(MslContext ctx,
                                                    JSONObject entityAuthJO)
                                             throws MslEncodingException,
                                                    MslCryptoException,
                                                    MslEntityAuthException
Construct a new entity authentication data instance from the provided JSON.

Parameters:
ctx - MSL context.
entityAuthJO - the JSON object.
Returns:
the entity authentication data.
Throws:
MslEncodingException - if there is an error parsing the JSON.
MslCryptoException - if there is an error with the entity authentication data cryptography.
MslEntityAuthException - if there is an error creating the entity authentication data.

getCryptoContext

public abstract ICryptoContext getCryptoContext(MslContext ctx,
                                                EntityAuthenticationData authdata)
                                         throws MslCryptoException,
                                                MslEntityAuthException
Create a crypto context that can be used to encrypt/decrypt and authenticate data from the entity. The implementation of this function must, by necessity, authenticate the entity authentication data.

Parameters:
ctx - MSL context.
authdata - the authentication data.
Returns:
the entity crypto context.
Throws:
MslCryptoException - if there is an error instantiating the crypto context.
MslEntityAuthException - if there is an error with the entity authentication data.

Message Security Layer (MSL)

Copyright © 2014 Netflix, Inc. All Rights Reserved.