Oracle Application Server Certificate Authority Java API Reference
10g (9.0.4)
B12079-01

oracle.security.oca.policy
Interface OCACustomPolicyPlugin


public interface OCACustomPolicyPlugin

An interface that needs to be implemented by custom plugins. The class that implements this interface should be placed in a jar file under the directory ORACLE_HOME/oca/policy. The class that implements the OCACustomPolicyPluin plugin interface needs to be specified as the class name when adding the custom plugin in the Configuration Management pages. Please refer to the Administrator's guide for more details about a custom plugin.

The following is an example of how a custom plugin could be implemented:

public class validCountryPolicy implements OCACustomPolicyPlugin
{

//Implementing the enforce method that handles the functionality checked by this plugin.

  public boolean enforce(OCAPolicyRequest policyRequest)
  {
    String pluginname="validCountryPolicy";
    boolean pluginResult = true;
    if (policyRequest.getCountry() != "US")
    {
      if (!checkIfValidCountry(policyRequest.getCountry()))
      {
        pluginResult = false;

//Setting error for this plugin into OCAPolicyResult. This error reflects in the error rendered to the user.

        policyRequest.setError(pluginName, OCMPolicyConstants.POLICY_ERROR, "Invalid country selected in DN.");
      }
    }
    return pluginResult;
  }
  private boolean checkIfValidCountry(String countrySelected)
  {
    if (countrySelected.equals("XX"))
      return false;
    return true;
  }
}

If the above example is registered as a custom plugin that should be applied to certificate requests during enrollment, then this rule is applied to each enrollment request made to the certificate authority. The above plugin fails if the DN in the certificate request contains XX as the country.

Since:
9.0.4
See Also:
OCAPolicyRequest, OCMPolicyConstants


 

Method Summary
 boolean enforce(oracle.security.oca.policy.OCAPolicyRequest policyRequest)
          The enforce method will be implemented by all custom plugins.

 


 

Method Detail

enforce

public boolean enforce(oracle.security.oca.policy.OCAPolicyRequest policyRequest)
The enforce method will be implemented by all custom plugins. The plugin is expected to return a boolean TRUE if successful. If FALSE is returned, the policy processor marks the plugin as failed and errors out.
Parameters:
policyRequest - Instance of OCAPolicyRequest passed by the policy processor.
Returns:
The status of the plugin after execution. TRUE if successful, FALSE if failure.
Since:
9.0.4

Oracle Application Server Certificate Authority Java API Reference
10g (9.0.4)
B12079-01

Copyright © 2000, 2003 Oracle Corporation. All Rights Reserved.