org.objectweb.proactive.ext.security.domain
Class DomainImpl

java.lang.Object
  extended by org.objectweb.proactive.ext.security.domain.DomainImpl
All Implemented Interfaces:
SecurityDomain, SecurityEntity

public class DomainImpl
extends java.lang.Object
implements SecurityDomain


Constructor Summary
DomainImpl()
           
DomainImpl(java.lang.String securityFile)
           
 
Method Summary
 java.security.cert.X509Certificate getCertificate()
          entity certificate
 byte[] getCertificateEncoded()
          Entity's X509Certificate as byte array
 java.util.ArrayList<Entity> getEntities()
          Retrieves all the entity's ID which contain this entity plus this entity ID.
 java.lang.String getName()
           
 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
 ProActiveSecurityManager getProActiveSecurityManager()
           
 java.security.PublicKey getPublicKey()
          entity public key
 java.lang.String getVNName()
           
 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
 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
 

Constructor Detail

DomainImpl

public DomainImpl()

DomainImpl

public DomainImpl(java.lang.String securityFile)
Method Detail

getPolicy

public SecurityContext getPolicy(SecurityContext securityContext)
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 SecurityDomain
Specified by:
getPolicy in interface SecurityEntity
Parameters:
securityContext - communication details allowing the entity to look for a matching policy
Returns:
returns the policy matching the corresponding securityContext

getCertificateEncoded

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

Specified by:
getCertificateEncoded in interface SecurityDomain
Specified by:
getCertificateEncoded in interface SecurityEntity
Returns:
returns the certificate of the entity corresponding to this domain
Throws:
SecurityNotAvailableException

getEntities

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

Specified by:
getEntities in interface SecurityDomain
Specified by:
getEntities in interface SecurityEntity
Returns:
returns the set of wrapping entities
Throws:
SecurityNotAvailableException - if the target entity does not support security

getName

public java.lang.String getName()
Specified by:
getName in interface SecurityDomain
Returns:
Returns the name of the domain.

terminateSession

public void terminateSession(long sessionID)
                      throws java.io.IOException,
                             SecurityNotAvailableException
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
Description copied from interface: SecurityEntity
entity certificate

Specified by:
getCertificate in interface SecurityEntity
Returns:
returns entity certificate
Throws:
SecurityNotAvailableException - if security is not available

getProActiveSecurityManager

public ProActiveSecurityManager getProActiveSecurityManager()

startNewSession

public long startNewSession(Communication policy)
                     throws SecurityNotAvailableException,
                            RenegotiateSessionException
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

getPublicKey

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

Specified by:
getPublicKey in interface SecurityEntity
Returns:
returns entity public key
Throws:
SecurityNotAvailableException

randomValue

public byte[] randomValue(long sessionID,
                          byte[] clientRandomValue)
                   throws SecurityNotAvailableException,
                          RenegotiateSessionException
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

publicKeyExchange

public byte[][] publicKeyExchange(long sessionID,
                                  byte[] myPublicKey,
                                  byte[] myCertificate,
                                  byte[] signature)
                           throws SecurityNotAvailableException,
                                  RenegotiateSessionException,
                                  KeyExchangeException
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

secretKeyExchange

public byte[][] secretKeyExchange(long sessionID,
                                  byte[] encodedAESKey,
                                  byte[] encodedIVParameters,
                                  byte[] encodedClientMacKey,
                                  byte[] encodedLockData,
                                  byte[] parametersSignature)
                           throws SecurityNotAvailableException,
                                  RenegotiateSessionException
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

getVNName

public java.lang.String getVNName()
                           throws SecurityNotAvailableException
Throws:
SecurityNotAvailableException


Copyright 2001-2007 INRIA All Rights Reserved.