org.objectweb.proactive.ext.security
Class InternalBodySecurity

java.lang.Object
  extended by org.objectweb.proactive.ext.security.InternalBodySecurity
All Implemented Interfaces:
SecurityEntity

public class InternalBodySecurity
extends java.lang.Object
implements SecurityEntity

This class is enabled when the body is a forwarder. It acts like a forwarder for all security related messages


Field Summary
protected  SecurityEntity distantBody
           
 
Constructor Summary
InternalBodySecurity(UniversalBody distantBody)
           
 
Method Summary
 java.security.cert.X509Certificate getCertificate()
          entity certificate
 byte[] getCertificateEncoded()
          Entity's X509Certificate as byte array
 byte[] getCertificatEncoded()
           
 UniversalBody getDistantBody()
           
 java.util.ArrayList<Entity> getEntities()
          Retrieves all the entity's ID which contain this entity plus this entity ID.
 SecurityContext getPolicy(SecurityContext securityContext)
          Ask the entity to fill the securityContext parameters with its own policy according to the communication details contained in the given securityContext
 java.security.PublicKey getPublicKey()
          entity public key
 boolean isLocalBody()
           
 byte[][] publicKeyExchange(long sessionID, byte[] myPublicKey, byte[] myCertificate, byte[] signature)
          exchange entity certificate and/or public key if certificate are not available
 byte[] randomValue(long sessionID, byte[] clientRandomValue)
          Exchange random value between client and server entity
 byte[][] secretKeyExchange(long sessionID, byte[] encodedAESKey, byte[] encodedIVParameters, byte[] encodedClientMacKey, byte[] encodedLockData, byte[] parametersSignature)
          this method sends encoded secret parameters to the target entity
 void setDistantBody(UniversalBody distantBody)
           
 long startNewSession(Communication policy)
          start an unvalidated empty session
 void terminateSession(long sessionID)
          terminate a given session
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

distantBody

protected SecurityEntity distantBody
Constructor Detail

InternalBodySecurity

public InternalBodySecurity(UniversalBody distantBody)
Method Detail

terminateSession

public void terminateSession(long sessionID)
                      throws SecurityNotAvailableException,
                             java.io.IOException
Description copied from interface: SecurityEntity
terminate a given session

Specified by:
terminateSession in interface SecurityEntity
Throws:
SecurityNotAvailableException - id security is not available
java.io.IOException

getCertificate

public java.security.cert.X509Certificate getCertificate()
                                                  throws SecurityNotAvailableException,
                                                         java.io.IOException
Description copied from interface: SecurityEntity
entity certificate

Specified by:
getCertificate in interface SecurityEntity
Returns:
returns entity certificate
Throws:
SecurityNotAvailableException - if security is not available
java.io.IOException - if communication fails

startNewSession

public long startNewSession(Communication policy)
                     throws SecurityNotAvailableException,
                            RenegotiateSessionException,
                            java.io.IOException
Description copied from interface: SecurityEntity
start an unvalidated empty session

Specified by:
startNewSession in interface SecurityEntity
Parameters:
policy - policy associated to the session
Returns:
session ID
Throws:
SecurityNotAvailableException - if security is not available
RenegotiateSessionException - if the session immediatly expires
java.io.IOException

getPublicKey

public java.security.PublicKey getPublicKey()
                                     throws SecurityNotAvailableException,
                                            java.io.IOException
Description copied from interface: SecurityEntity
entity public key

Specified by:
getPublicKey in interface SecurityEntity
Returns:
returns entity public key
Throws:
SecurityNotAvailableException
java.io.IOException

randomValue

public byte[] randomValue(long sessionID,
                          byte[] clientRandomValue)
                   throws SecurityNotAvailableException,
                          RenegotiateSessionException,
                          java.io.IOException
Description copied from interface: SecurityEntity
Exchange random value between client and server entity

Specified by:
randomValue in interface SecurityEntity
Parameters:
sessionID - the session ID
clientRandomValue - client random value
Returns:
server random value
Throws:
SecurityNotAvailableException - if the security is not available
RenegotiateSessionException - if the session has expired
java.io.IOException

publicKeyExchange

public byte[][] publicKeyExchange(long sessionID,
                                  byte[] myPublicKey,
                                  byte[] myCertificate,
                                  byte[] signature)
                           throws SecurityNotAvailableException,
                                  RenegotiateSessionException,
                                  KeyExchangeException,
                                  java.io.IOException
Description copied from interface: SecurityEntity
exchange entity certificate and/or public key if certificate are not available

Specified by:
publicKeyExchange in interface SecurityEntity
Parameters:
sessionID - the session ID
myPublicKey - encoded public key
myCertificate - encoded certificate
signature - encoded signature of previous paramaters
Returns:
an array containing : - server certificate and/or server public key - encoded signature of these parameters
Throws:
SecurityNotAvailableException - if the security is not available
RenegotiateSessionException - if the session has expired
KeyExchangeException - if a key data/length/algorithm is not supported
java.io.IOException

secretKeyExchange

public byte[][] secretKeyExchange(long sessionID,
                                  byte[] encodedAESKey,
                                  byte[] encodedIVParameters,
                                  byte[] encodedClientMacKey,
                                  byte[] encodedLockData,
                                  byte[] parametersSignature)
                           throws SecurityNotAvailableException,
                                  RenegotiateSessionException,
                                  java.io.IOException
Description copied from interface: SecurityEntity
this method sends encoded secret parameters to the target entity

Specified by:
secretKeyExchange in interface SecurityEntity
Parameters:
sessionID - session ID
encodedAESKey - the AES key use to exchange secret message
encodedIVParameters - Initilization parameters for the AES key
encodedClientMacKey - MAC key for checking signature of future messages
encodedLockData - random value to prevent message replays by an external attacker
parametersSignature - encoded signature of the previous parameters
Returns:
an array containing : - encoded server AES key - encoded IV parameters - encoded server MAC key - encoded lock data to prevent message replays - encoded signature of previous parameters
Throws:
SecurityNotAvailableException - if this entity does not support security
RenegotiateSessionException - if the session has expired or has been cancelled during this exchange
java.io.IOException - if communication fails

setDistantBody

public void setDistantBody(UniversalBody distantBody)

isLocalBody

public boolean isLocalBody()

getDistantBody

public UniversalBody getDistantBody()
Returns:
distant Body Adapter

getCertificatEncoded

public byte[] getCertificatEncoded()
                            throws SecurityNotAvailableException,
                                   java.io.IOException
Returns:
distant object's certificate as byte array
Throws:
SecurityNotAvailableException
java.io.IOException

getPolicy

public SecurityContext getPolicy(SecurityContext securityContext)
                          throws SecurityNotAvailableException,
                                 java.io.IOException
Description copied from interface: SecurityEntity
Ask the entity to fill the securityContext parameters with its own policy according to the communication details contained in the given securityContext

Specified by:
getPolicy in interface SecurityEntity
Parameters:
securityContext -
Returns:
securityContext with distant object context
Throws:
SecurityNotAvailableException - thrown the entity doest not support the security
java.io.IOException

getEntities

public java.util.ArrayList<Entity> getEntities()
                                        throws SecurityNotAvailableException,
                                               java.io.IOException
Description copied from interface: SecurityEntity
Retrieves all the entity's ID which contain this entity plus this entity ID.

Specified by:
getEntities in interface SecurityEntity
Returns:
returns all the entity's ID which contain this entity plus this entity ID.
Throws:
SecurityNotAvailableException - if the target entity does not support security
java.io.IOException

getCertificateEncoded

public byte[] getCertificateEncoded()
                             throws SecurityNotAvailableException,
                                    java.io.IOException
Description copied from interface: SecurityEntity
Entity's X509Certificate as byte array

Specified by:
getCertificateEncoded in interface SecurityEntity
Returns:
entity's X509Certificate as byte array
Throws:
SecurityNotAvailableException
java.io.IOException


Copyright 2001-2007 INRIA All Rights Reserved.