org.glite.security.util.namespace
Class DNCheckerImpl

java.lang.Object
  extended by org.glite.security.util.namespace.DNCheckerImpl
All Implemented Interfaces:
DNChecker

public class DNCheckerImpl
extends java.lang.Object
implements DNChecker

Implements DNChecker interface. Checks a DN against a policy/namespace file.

Author:
alyu

Constructor Summary
DNCheckerImpl()
          Creates a default DN checker using EU grid namespace format.
DNCheckerImpl(boolean isLegacy)
          Creates a default DN Checker using legacy policy format.
DNCheckerImpl(NamespaceFormat namespaceFormat)
          Creates a new DN checker with the specified namespace format.
 
Method Summary
 void check(DN subjectDN, DN issuerDN, java.util.List<NamespacePolicy> prevPolicies)
          Checks the specified subjectDN and issuerDN against previous policies.
 void read(java.lang.String fileName)
          Reads a namespaces file/policy language file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DNCheckerImpl

public DNCheckerImpl()
Creates a default DN checker using EU grid namespace format.


DNCheckerImpl

public DNCheckerImpl(boolean isLegacy)
Creates a default DN Checker using legacy policy format.

Parameters:
isLegacy - true if old policy format is to be used

DNCheckerImpl

public DNCheckerImpl(NamespaceFormat namespaceFormat)
Creates a new DN checker with the specified namespace format.

Parameters:
namespaceFormat - a namespace format
Method Detail

read

public void read(java.lang.String fileName)
          throws java.io.IOException,
                 java.text.ParseException
Reads a namespaces file/policy language file.

Specified by:
read in interface DNChecker
Parameters:
fileName - the namespaces file or policy language file.
Throws:
java.io.IOException - if unsuccessful
java.text.ParseException - if unsuccessful

check

public void check(DN subjectDN,
                  DN issuerDN,
                  java.util.List<NamespacePolicy> prevPolicies)
           throws java.security.cert.CertPathValidatorException
Checks the specified subjectDN and issuerDN against previous policies.

Specified by:
check in interface DNChecker
Parameters:
subjectDN - the subject DN.
issuerDN - the issuer DN.
prevPolicies - previous policies or null.
Throws:
java.security.cert.CertPathValidatorException - in case the DNs violate the namespace.