Package org.italiangrid.voms.ac.impl
Class VOMSAttributesImpl
- java.lang.Object
-
- org.italiangrid.voms.ac.impl.VOMSAttributesImpl
-
- All Implemented Interfaces:
VOMSAttribute
public class VOMSAttributesImpl extends Object implements VOMSAttribute
The default implementation for voms attributes- Author:
- andreaceccanti
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_CLOCK_SKEW_IN_MINUTES
-
Constructor Summary
Constructors Constructor Description VOMSAttributesImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description X509Certificate[]
getAACertificates()
This method returns the certificate chain of the VOMS Attribute Authority (AA) that signed thisVOMSAttribute
.List<String>
getFQANs()
This method returns the list of signed Fully Qualified Attribute Names (FQANs) in thisVOMSAttribute
.List<VOMSGenericAttribute>
getGenericAttributes()
This method returns the list of VOMS Generic attributes in thisVOMSAttribute
.X500Principal
getHolder()
This method returns the subject (as anX500Principal
) of the holder of these VOMS attributesBigInteger
getHolderSerialNumber()
This method returns the holder certificate serial numberString
getHost()
This method returns the host where the VOMS Attribute Authority (AA) that signed these attribute livesX500Principal
getIssuer()
This method returns the subject of the VOMS Attribute Authority that signed these attributes.Date
getNotAfter()
This method returns the attributes' validity end timeDate
getNotBefore()
This method returns the attributes' validity start timeint
getPort()
This method returns the port on which the VOMS Attribute Authority (AA) that signed these attributes listens for requests.String
getPrimaryFQAN()
This method returns the primary FQAN (the first in the list returned byVOMSAttribute.getFQANs()
) in thisVOMSAttribute
.byte[]
getSignature()
This method returns the signature on the VOMS attribute certificate as a byte array.List<String>
getTargets()
This method returns the list of targets defined for thisVOMSAttribute
.String
getVO()
This method returns the name of the VO this VOMS attributes are aboutorg.bouncycastle.cert.X509AttributeCertificateHolder
getVOMSAC()
This method returns the underlying VOMS Attribute certificate object.boolean
isValid()
This method checks whether the attributes are valid in the current instant of time.void
setAACertificates(X509Certificate[] aaCerts)
void
setFQANs(List<String> fQANs)
void
setGenericAttributes(List<VOMSGenericAttribute> genericAttributes)
void
setHolder(X500Principal holder)
void
setHolderSerialNumber(BigInteger holderSerialNumber)
void
setHost(String host)
void
setIssuer(X500Principal issuer)
void
setNotAfter(Date notAfter)
void
setNotBefore(Date notBefore)
void
setPort(int port)
void
setSignature(byte[] signature)
void
setTargets(List<String> targets)
void
setVO(String vO)
void
setVOMSAC(org.bouncycastle.cert.X509AttributeCertificateHolder ac)
String
toString()
boolean
validAt(Date date)
This method checks whether the attributes are valid in a given time passed as argument.
-
-
-
Field Detail
-
DEFAULT_CLOCK_SKEW_IN_MINUTES
public static final int DEFAULT_CLOCK_SKEW_IN_MINUTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
getIssuer
public X500Principal getIssuer()
Description copied from interface:VOMSAttribute
This method returns the subject of the VOMS Attribute Authority that signed these attributes.- Specified by:
getIssuer
in interfaceVOMSAttribute
- Returns:
- The subject of the VOMS AA that signed these attributes
-
getPrimaryFQAN
public String getPrimaryFQAN()
Description copied from interface:VOMSAttribute
This method returns the primary FQAN (the first in the list returned byVOMSAttribute.getFQANs()
) in thisVOMSAttribute
.- Specified by:
getPrimaryFQAN
in interfaceVOMSAttribute
- Returns:
- The primary VOMS fully qualified attribute name
-
getVO
public String getVO()
Description copied from interface:VOMSAttribute
This method returns the name of the VO this VOMS attributes are about- Specified by:
getVO
in interfaceVOMSAttribute
- Returns:
- The name of the VO this VOMS attributes are about
-
setIssuer
public void setIssuer(X500Principal issuer)
-
setVO
public void setVO(String vO)
-
getFQANs
public List<String> getFQANs()
Description copied from interface:VOMSAttribute
This method returns the list of signed Fully Qualified Attribute Names (FQANs) in thisVOMSAttribute
.- Specified by:
getFQANs
in interfaceVOMSAttribute
- Returns:
- The
List
of VOMS fully qualified attribute names
-
getHost
public String getHost()
Description copied from interface:VOMSAttribute
This method returns the host where the VOMS Attribute Authority (AA) that signed these attribute lives- Specified by:
getHost
in interfaceVOMSAttribute
- Returns:
- The name of the host where the VOMS AA that signed these attributes lives
-
getPort
public int getPort()
Description copied from interface:VOMSAttribute
This method returns the port on which the VOMS Attribute Authority (AA) that signed these attributes listens for requests.- Specified by:
getPort
in interfaceVOMSAttribute
- Returns:
- The port on which the VOMS AA that signed these attributes listens for requests
-
getHolder
public X500Principal getHolder()
Description copied from interface:VOMSAttribute
This method returns the subject (as anX500Principal
) of the holder of these VOMS attributes- Specified by:
getHolder
in interfaceVOMSAttribute
- Returns:
- The subject of the holder of these VOMS attributes
-
getNotBefore
public Date getNotBefore()
Description copied from interface:VOMSAttribute
This method returns the attributes' validity start time- Specified by:
getNotBefore
in interfaceVOMSAttribute
- Returns:
- The attributes' validity start time
-
getNotAfter
public Date getNotAfter()
Description copied from interface:VOMSAttribute
This method returns the attributes' validity end time- Specified by:
getNotAfter
in interfaceVOMSAttribute
- Returns:
- The attributes' validity end time
-
getSignature
public byte[] getSignature()
Description copied from interface:VOMSAttribute
This method returns the signature on the VOMS attribute certificate as a byte array.- Specified by:
getSignature
in interfaceVOMSAttribute
- Returns:
- The signature of this VOMS attributes
-
setHost
public void setHost(String host)
-
setPort
public void setPort(int port)
-
setHolder
public void setHolder(X500Principal holder)
-
setNotAfter
public void setNotAfter(Date notAfter)
-
setNotBefore
public void setNotBefore(Date notBefore)
-
setSignature
public void setSignature(byte[] signature)
-
getGenericAttributes
public List<VOMSGenericAttribute> getGenericAttributes()
Description copied from interface:VOMSAttribute
This method returns the list of VOMS Generic attributes in thisVOMSAttribute
.- Specified by:
getGenericAttributes
in interfaceVOMSAttribute
- Returns:
- The VOMS generic attributes
-
setGenericAttributes
public void setGenericAttributes(List<VOMSGenericAttribute> genericAttributes)
-
getTargets
public List<String> getTargets()
Description copied from interface:VOMSAttribute
This method returns the list of targets defined for thisVOMSAttribute
.- Specified by:
getTargets
in interfaceVOMSAttribute
- Returns:
- The targets for this VOMS attributes
-
getAACertificates
public X509Certificate[] getAACertificates()
Description copied from interface:VOMSAttribute
This method returns the certificate chain of the VOMS Attribute Authority (AA) that signed thisVOMSAttribute
.- Specified by:
getAACertificates
in interfaceVOMSAttribute
- Returns:
- The VOMS AA certificate chain
-
setAACertificates
public void setAACertificates(X509Certificate[] aaCerts)
-
isValid
public boolean isValid()
Description copied from interface:VOMSAttribute
This method checks whether the attributes are valid in the current instant of time. No validation is performed on the attributes.- Specified by:
isValid
in interfaceVOMSAttribute
- Returns:
true
if valid,false
otherwise
-
validAt
public boolean validAt(Date date)
Description copied from interface:VOMSAttribute
This method checks whether the attributes are valid in a given time passed as argument. No validation is performed on the attributes.- Specified by:
validAt
in interfaceVOMSAttribute
- Parameters:
date
- the time used for the validity check- Returns:
true
if valid,false
otherwise
-
getVOMSAC
public org.bouncycastle.cert.X509AttributeCertificateHolder getVOMSAC()
Description copied from interface:VOMSAttribute
This method returns the underlying VOMS Attribute certificate object.- Specified by:
getVOMSAC
in interfaceVOMSAttribute
- Returns:
- the underlying bouncycastle object for the VOMS attribute certificate.
-
setVOMSAC
public void setVOMSAC(org.bouncycastle.cert.X509AttributeCertificateHolder ac)
-
getHolderSerialNumber
public BigInteger getHolderSerialNumber()
Description copied from interface:VOMSAttribute
This method returns the holder certificate serial number- Specified by:
getHolderSerialNumber
in interfaceVOMSAttribute
- Returns:
- The serial number of the holder certificate
-
setHolderSerialNumber
public void setHolderSerialNumber(BigInteger holderSerialNumber)
-
-