org.glite.voms

Class VOMSAttribute


public class VOMSAttribute
extends java.lang.Object

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

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.

Constructor Details

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 Details

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

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.

getFullAttributes

public FullAttributes getFullAttributes()
Gets a copy of the Generic Attributes extension.
Returns:
the attributes, or null if they are not present.

getFullyQualifiedAttributes

public List getFullyQualifiedAttributes()
Returns:
List of String of the VOMS fully qualified attributes names (FQANs):
vo[/group[/group2...]][/Role=[role]][/Capability=capability]

getHolder

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

getHolderX509

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

getHost

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

getHostPort

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

getIssuer

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

getIssuerX509

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

getListOfFQAN

public List getListOfFQAN()
Returns:
List of FQAN of the VOMS fully qualified attributes names (FQANs)
See Also:
FQAN

getNotAfter

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

getNotBefore

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

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.

getSerial

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

getSignature

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

getTargets

public ACTargets getTargets()
Gets the targets of this AC.
Returns:
the ACTargets extension if present, or null otherwise.

getVO

public String getVO()
Returns the VO name
Returns:
the VO name

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.

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.

isValid

public boolean isValid()
Checks if the Attribute is valid. Only checks start and end of validity.
Returns:
true if is valid, false otherwise.

toString

public String toString()
Gets a (brief) string representation of this attribute.
Returns:
the Representation.

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.