eu.emi.security.authn.x509.helpers.ns
Class GlobusNamespacesParser

java.lang.Object
  extended by eu.emi.security.authn.x509.helpers.ns.GlobusNamespacesParser
All Implemented Interfaces:
NamespacesParser

public class GlobusNamespacesParser
extends Object
implements NamespacesParser

Parses a single .signing_policy file and returns NamespacePolicy object. Only the simplified parsing of the EACL format is implemented, in a similar way is in case of a native Globus implementation. However there are differences. First of all the format of this file is defined in a very imprecise way.

The parsing is done in the following way:

Author:
K. Benedyczak

Field Summary
static String ACCESS_ID_CA
           
static String CONDITION_SUBJECT
           
static String DEF_AUTH_GLOBUS
           
static String DEF_AUTH_X509
           
static String POS_RIGHTS
           
static String VALUE_CA_SIGN
           
 
Constructor Summary
GlobusNamespacesParser(String filePath)
           
 
Method Summary
static String makeRegexpClassicWildcard(String pattern)
          Converts wildcard string to Java regexp, ensuring that literal sequences are correctly escaped.
static List<String> normalize(String dn)
          Converts input OpenSSL-style wildcard expression into a list of java regular expressions over a RFC2253 DN.
 List<NamespacePolicy> parse()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACCESS_ID_CA

public static String ACCESS_ID_CA

DEF_AUTH_X509

public static String DEF_AUTH_X509

DEF_AUTH_GLOBUS

public static String DEF_AUTH_GLOBUS

POS_RIGHTS

public static String POS_RIGHTS

CONDITION_SUBJECT

public static String CONDITION_SUBJECT

VALUE_CA_SIGN

public static String VALUE_CA_SIGN
Constructor Detail

GlobusNamespacesParser

public GlobusNamespacesParser(String filePath)
Method Detail

parse

public List<NamespacePolicy> parse()
                            throws IOException
Specified by:
parse in interface NamespacesParser
Throws:
IOException

normalize

public static List<String> normalize(String dn)
                              throws IOException
Converts input OpenSSL-style wildcard expression into a list of java regular expressions over a RFC2253 DN.

Buggy, it is impossible to precisely recreate the wildcard of the openssl DN in RFC form. But doing other way round (converting RFC dns to openssl) won't be good too.

Parameters:
dn - input openssl style wildcard
Returns:
list of RFC2253 DN regular expressions
Throws:
IOException

makeRegexpClassicWildcard

public static String makeRegexpClassicWildcard(String pattern)
Converts wildcard string to Java regexp, ensuring that literal sequences are correctly escaped.

Parameters:
pattern - input wildcard
Returns:
Java regular expression


Copyright © 2012 European Middleware Initiative. All Rights Reserved.