org.glite.voms
Class SigningPolicy

java.lang.Object
  extended by org.glite.voms.SigningPolicy

public class SigningPolicy
extends java.lang.Object

The purpose of this class is to represent a *.signing_policy file.

Author:
Vincenzo Ciaschini

Constructor Summary
SigningPolicy(java.io.File f)
          Loads a *.signing_policy file.
 
Method Summary
 int findIssuer(java.lang.String issuer)
          Finds the record in the signing policy which deals with the specified issuer.
 int findIssuer(java.lang.String issuer, int previous)
          Finds the record in the signing policy which deals with the specified issuer, starting from a specified record.
 java.lang.String getAccessIDCA()
          Gets the AccessIDCA from the current record.
 java.util.Vector getCondSubjects()
          Gets the CondSubjects from the current record.
 java.lang.String getName()
          Gets the basename of the file from which this was loaded.
 java.lang.String getPosRights()
          Gets the PosRights from the current record.
 void setCurrent(int index)
          Sets the indicate record as the current record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SigningPolicy

public SigningPolicy(java.io.File f)
              throws java.io.IOException
Loads a *.signing_policy file.

Parameters:
f - the File from which to load the Signing Policy.
Throws:
java.io.IOException - if there have been problems loading the file.
Method Detail

getName

public java.lang.String getName()
Gets the basename of the file from which this was loaded.

Returns:
the basename or null if nothign was loaded.

findIssuer

public int findIssuer(java.lang.String issuer)
Finds the record in the signing policy which deals with the specified issuer.

Parameters:
issuer - an OpenSSL-style representation of the issuer.
Returns:
the record number, or -1 if none is found.

findIssuer

public int findIssuer(java.lang.String issuer,
                      int previous)
Finds the record in the signing policy which deals with the specified issuer, starting from a specified record.

Parameters:
issuer - an OpenSSL-style representation of the issuer.
previous - the previous match, or -1 if ther was no previous match.
Returns:
the record number, or -1 if none is found.

setCurrent

public void setCurrent(int index)
Sets the indicate record as the current record.

Parameters:
index - the record number
Throws:
java.lang.IllegalArgumentException - if the record number is too great or < 0.

getAccessIDCA

public java.lang.String getAccessIDCA()
Gets the AccessIDCA from the current record.

Returns:
the AccessIDCA.
Throws:
java.lang.IllegalArgumentException - if the record number has not been set.

getPosRights

public java.lang.String getPosRights()
Gets the PosRights from the current record.

Returns:
the PosRight
Throws:
java.lang.IllegalArgumentException - if the record number has not been set.

getCondSubjects

public java.util.Vector getCondSubjects()
Gets the CondSubjects from the current record.

Returns:
a Vector of CondSubjects. Each element is a String.
Throws:
java.lang.IllegalArgumentException - if the record number has not been set.


Copyright © 2012. All Rights Reserved.