org.glite.voms
Class VOMSAttribute

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

public class VOMSAttribute
extends Object

Representation of the authorization information (VO, server address and list of Fully Qualified Attribute Names, or FQANs) contained in a VOMS attribute certificate.

Author:
Olle Mulmo, Vincenzo Ciaschini

Constructor Summary
VOMSAttribute(AttributeCertificate ac)
          Parses the contents of an attribute certificate.
NOTE: Cryptographic signatures, time stamps etc.
 
Method Summary
 AttributeCertificate getAC()
          Direct access to the Attribute Certificate is going to be removed.
 ACCerts getCertList()
          Gets the certificates that signed the AC, if the ACCerts extension is present.
 FullAttributes getFullAttributes()
          Gets a copy of the Generic Attributes extension.
 List getFullyQualifiedAttributes()
           
 String getHolder()
          Returns an String representation of the AC holder.
 String getHolderX509()
          Returns an OpenSSL-style representation of the AC holder.
 String getHost()
          Returns the hostName of the issuing VOMS server.
 String getHostPort()
          Returns the address of the issuing VOMS server, on the form <host>:<port>
 String getIssuer()
          Returns an OpenSSL-style representation of the AC issuer.
 String getIssuerX509()
          Returns an OpenSSL-style representation of the AC issuer.
 List getListOfFQAN()
           
 Date getNotAfter()
          Returns the end date of the AC validity.
 Date getNotBefore()
          Return the start date of the AC validity.
 int getPort()
          Returns the port on which the issuing VOMS server is listening
 String getSerial()
          Returns the serial number of the AC.
 byte[] getSignature()
          Returns the signature of the AC.
 ACTargets getTargets()
          Gets the targets of this AC.
 String getVO()
          Returns the VO name
 boolean isHolder(X509Certificate cert)
          Checks the given X509 certificate to see if it is the holder of the AC.
 boolean isIssuer(X509Certificate cert)
          Checks the given X509 certificate to see if it is the issuer of the AC.
 boolean isValid()
          Checks if the Attribute is valid.
 String toString()
          Gets a (brief) string representation of this attribute.
 boolean validAt(Date date)
          Checks if the AC was valid at the provided timestamp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VOMSAttribute

public VOMSAttribute(AttributeCertificate ac)
Parses the contents of an attribute certificate.
NOTE: Cryptographic signatures, time stamps etc. will not be checked.

Parameters:
ac - the attribute certificate to parse for VOMS attributes
Method Detail

getSignature

public byte[] getSignature()
Returns the signature of the AC.

Returns:
the byte representation of the AC signature.

getSerial

public String getSerial()
Returns the serial number of the AC.

Returns:
the serial number of the AC.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

getNotAfter

public Date getNotAfter()
                 throws ParseException
Returns the end date of the AC validity.

Returns:
the end Date.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.
ParseException

getNotBefore

public Date getNotBefore()
                  throws ParseException
Return the start date of the AC validity.

Returns:
the start Date.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.
ParseException

validAt

public boolean validAt(Date date)
Checks if the AC was valid at the provided timestamp.

Parameters:
date - if null, current time is used
Returns:
true if the AC was valid at the time in question.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded or the dates have been encoded incorrectly.

getIssuer

public String getIssuer()
Returns an OpenSSL-style representation of the AC issuer.

Returns:
the AC issuer.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

getIssuerX509

public String getIssuerX509()
Returns an OpenSSL-style representation of the AC issuer.

Returns:
the AC issuer.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

getHolder

public String getHolder()
Returns an String representation of the AC holder.

Returns:
the AC holder.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

getHolderX509

public String getHolderX509()
Returns an OpenSSL-style representation of the AC holder.

Returns:
the AC holder.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

isValid

public boolean isValid()
Checks if the Attribute is valid. Only checks start and end of validity.

Returns:
true if is valid, false otherwise.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

isHolder

public boolean isHolder(X509Certificate cert)
Checks the given X509 certificate to see if it is the holder of the AC.

Parameters:
cert - the X509 certificate to check.
Returns:
true if the give certificate is the holder of the AC.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

isIssuer

public boolean isIssuer(X509Certificate cert)
Checks the given X509 certificate to see if it is the issuer of the AC.

Parameters:
cert - the X509 certificate to check.
Returns:
true if the give certificate is the issuer of the AC.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

getAC

public AttributeCertificate getAC()
Direct access to the Attribute Certificate is going to be removed. Use the getXXX methods in this same classe instead.

Returns:
The AttributeCertificate containing the VOMS information

getFullyQualifiedAttributes

public List getFullyQualifiedAttributes()
Returns:
List of String of the VOMS fully qualified attributes names (FQANs):
vo[/group[/group2...]][/Role=[role]][/Capability=capability]
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

getListOfFQAN

public List getListOfFQAN()
Returns:
List of FQAN of the VOMS fully qualified attributes names (FQANs)
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.
See Also:
FQAN

getHostPort

public String getHostPort()
Returns the address of the issuing VOMS server, on the form <host>:<port>

Returns:
String
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

getHost

public String getHost()
Returns the hostName of the issuing VOMS server.

Returns:
hostName.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

getPort

public int getPort()
Returns the port on which the issuing VOMS server is listening

Returns:
the port, or -1 if the informations could not be found.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

getVO

public String getVO()
Returns the VO name

Returns:
the VO name
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

toString

public String toString()
Gets a (brief) string representation of this attribute.

Overrides:
toString in class Object
Returns:
the Representation.

getFullAttributes

public FullAttributes getFullAttributes()
Gets a copy of the Generic Attributes extension.

Returns:
the attributes, or null if they are not present.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

getCertList

public ACCerts getCertList()
Gets the certificates that signed the AC, if the ACCerts extension is present.

Returns:
the ACCerts extension, or null if it is not present.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.

getTargets

public ACTargets getTargets()
Gets the targets of this AC.

Returns:
the ACTargets extension if present, or null otherwise.
Throws:
IllegalArgumentException - if no Attribute Certificate has been loaded.


Copyright © 2013. All Rights Reserved.