org.openadaptor.security.interfaces
Interface OASecurityManager

All Known Implementing Classes:
AbstractSecurityManager, ServerSecurityManager, TestSecurityManager

public interface OASecurityManager

Adaptor-side interface to the Open Adaptor Security Server.
An instance of the OASecurityManager is created by the OA Controller, and its initialisation properties are read from the Adaptor properties file. Properties required by OASecurityManager for its initialization are:

It is used by MessageWriter or Security Agent Classes to interact with SecurityServer. Typically while encoding, key will be retrieved by sending in policy to the SecServer. and while decoding, key will be retrieved by sending in keyId to the SecServer.


Method Summary
 SecureKey generateKey(Policy policy, int keyId)
          Generates a secret key using the given policy and preferred keyId.
 java.security.PrivateKey generateKeyPair(Policy policy, int adaptorId)
          Generates a PublicKey/PrivateKey pair using the given policy and adaptor id.
 SecureKey getKey(int keyId)
          Gets key given a keyId.
 SecureKey getKey(Policy policy)
          Gets key for a policy.
 Policy[] getPolicy(DOType dotype)
          Gets policies for a DOType.
 Policy[] getPolicy(java.lang.String dotypeName)
          Gets policies for a DOType Name.
 Policy getPolicyWithName(java.lang.String policyName)
          Gets policies given a policy name.
 java.security.PrivateKey getPrivateKey(int adaptorId)
          Gets the PrivateKey of this Adaptor.
 java.security.PublicKey getPublicKey(int adaptorId)
          Gets the PublicKey of any other adaptor.
 void init(java.lang.String name, java.util.Properties properties, java.lang.String propsPrefix, Controller controller)
          Initialises the Security Manager
 void login(java.lang.String adaptorName, java.util.Properties adaptorContext)
          Logs in onto Security Server.
 

Method Detail

init

void init(java.lang.String name,
          java.util.Properties properties,
          java.lang.String propsPrefix,
          Controller controller)
          throws java.lang.SecurityException
Initialises the Security Manager

Parameters:
name - Name of the SecurityManager
Throws:
java.lang.SecurityException - if initialization fails

login

void login(java.lang.String adaptorName,
           java.util.Properties adaptorContext)
           throws java.lang.SecurityException
Logs in onto Security Server.

Parameters:
certFile - certificate file name
Throws:
java.lang.SecurityException

getPolicy

Policy[] getPolicy(DOType dotype)
                   throws java.lang.SecurityException
Gets policies for a DOType. Called by MessageWriter.

Parameters:
type - DOType for which policies are required
Returns:
Array of policies for this dotype
Throws:
java.lang.SecurityException

getPolicy

Policy[] getPolicy(java.lang.String dotypeName)
                   throws java.lang.SecurityException
Gets policies for a DOType Name. Called by MessageWriter.

Parameters:
type - DOType for which policies are required
Returns:
Array of policies for this dotype
Throws:
java.lang.SecurityException

getPolicyWithName

Policy getPolicyWithName(java.lang.String policyName)
                         throws java.lang.SecurityException
Gets policies given a policy name.

Returns:
Policy
Throws:
java.lang.SecurityException

getKey

SecureKey getKey(Policy policy)
                 throws java.lang.SecurityException
Gets key for a policy.

Returns:
SecureKey
Throws:
java.lang.SecurityException

getKey

SecureKey getKey(int keyId)
                 throws java.lang.SecurityException
Gets key given a keyId.

Returns:
SecureKey
Throws:
java.lang.SecurityException

generateKey

SecureKey generateKey(Policy policy,
                      int keyId)
                      throws java.lang.SecurityException
Generates a secret key using the given policy and preferred keyId.

The key is stored for future retrieval.

Returns:
the generated SecureKey
Throws:
java.lang.SecurityException

getPrivateKey

java.security.PrivateKey getPrivateKey(int adaptorId)
                                       throws java.lang.SecurityException
Gets the PrivateKey of this Adaptor.

Throws:
java.lang.SecurityException

getPublicKey

java.security.PublicKey getPublicKey(int adaptorId)
                                     throws java.lang.SecurityException
Gets the PublicKey of any other adaptor. Typically it is retrieved from the GDS via SecurityServer.

Throws:
java.lang.SecurityException

generateKeyPair

java.security.PrivateKey generateKeyPair(Policy policy,
                                         int adaptorId)
                                         throws java.lang.SecurityException
Generates a PublicKey/PrivateKey pair using the given policy and adaptor id.

The key pair is stored for future retrieval.

Returns:
the PrivateKey associated with the generated key pair.
Throws:
java.lang.SecurityException