Package org.italiangrid.voms.store.impl
Class LSCFile
- java.lang.Object
-
- org.italiangrid.voms.store.impl.LSCFile
-
- All Implemented Interfaces:
LSCInfo
public class LSCFile extends java.lang.Object implements LSCInfo
Represents a VOMS LSC (Legacy Secure Channel) file.The LSC file describes the certificate chain that a VOMS attribute authority uses to sign a VOMS attribute certificate. The LSC mechanism helps in solving the public key distribution problem for VOMS AA certificates and is used in the VOMS validation process to validate the signature on the AC. It does this by extracting the VOMS AA certificate included in the VOMS extension and ensuring that the chain conforms to the description in the LSC file.
Two
LSCFileobjects are considered equal if their VO and hostname fields match.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<java.lang.String>certChainDescriptionThe certificate chain description contained in this LSC file.(package private) java.lang.StringfilenameThe LSC filename.(package private) java.lang.StringhostnameThe hostname that this LSC file pertains to.(package private) java.lang.StringvoThe VO (Virtual Organization) this LSC file is associated with.
-
Constructor Summary
Constructors Constructor Description LSCFile()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Determines if twoLSCFileobjects are equal based on their VO and hostname.java.util.List<java.lang.String>getCertificateChainDescription()Returns the certificate chain description.java.lang.StringgetFilename()Returns the filename of the LSC file.java.lang.StringgetHostname()Returns the hostname.java.lang.StringgetVOName()Returns the VO name.inthashCode()Computes the hash code for this LSC file.booleanmatches(java.security.cert.X509Certificate[] certChain)Checks if the given certificate chain matches the description in this LSC file.private booleanmatches(javax.security.auth.x500.X500Principal certDn, java.lang.String lscDn)Checks if a certificate distinguished name (DN) matches the expected DN in the LSC file.voidsetCertificateChainDescription(java.util.List<java.lang.String> certChainDesc)Sets the certificate chain description.voidsetFilename(java.lang.String filename)Sets the filename for this LSC file.voidsetHostname(java.lang.String hostname)Sets the hostname.voidsetVo(java.lang.String vo)Sets the VO name.java.lang.StringtoString()Returns a string representation of this LSC file.
-
-
-
Field Detail
-
filename
java.lang.String filename
The LSC filename.
-
vo
java.lang.String vo
The VO (Virtual Organization) this LSC file is associated with.
-
hostname
java.lang.String hostname
The hostname that this LSC file pertains to.
-
certChainDescription
java.util.List<java.lang.String> certChainDescription
The certificate chain description contained in this LSC file.
-
-
Method Detail
-
getVOName
public java.lang.String getVOName()
Returns the VO name.
-
getHostname
public java.lang.String getHostname()
Returns the hostname.- Specified by:
getHostnamein interfaceLSCInfo- Returns:
- the hostname
-
getCertificateChainDescription
public java.util.List<java.lang.String> getCertificateChainDescription()
Returns the certificate chain description.- Specified by:
getCertificateChainDescriptionin interfaceLSCInfo- Returns:
- a list of certificate chain descriptions
-
getFilename
public java.lang.String getFilename()
Returns the filename of the LSC file.- Specified by:
getFilenamein interfaceLSCInfo- Returns:
- the LSC filename
-
setFilename
public void setFilename(java.lang.String filename)
Sets the filename for this LSC file.- Specified by:
setFilenamein interfaceLSCInfo- Parameters:
filename- the filename to set
-
setVo
public void setVo(java.lang.String vo)
Sets the VO name.- Parameters:
vo- the VO name to set
-
setHostname
public void setHostname(java.lang.String hostname)
Sets the hostname.- Parameters:
hostname- the hostname to set
-
setCertificateChainDescription
public void setCertificateChainDescription(java.util.List<java.lang.String> certChainDesc)
Sets the certificate chain description.- Parameters:
certChainDesc- the certificate chain description to set
-
hashCode
public int hashCode()
Computes the hash code for this LSC file.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hash code
-
equals
public boolean equals(java.lang.Object obj)
Determines if twoLSCFileobjects are equal based on their VO and hostname.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object to compare with- Returns:
trueif the objects are equal, otherwisefalse
-
toString
public java.lang.String toString()
Returns a string representation of this LSC file.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this LSC file
-
matches
public boolean matches(java.security.cert.X509Certificate[] certChain)
Checks if the given certificate chain matches the description in this LSC file.
-
matches
private boolean matches(javax.security.auth.x500.X500Principal certDn, java.lang.String lscDn)Checks if a certificate distinguished name (DN) matches the expected DN in the LSC file.- Parameters:
certDn- the certificate DNlscDn- the expected DN in the LSC file- Returns:
trueif the DNs match, otherwisefalse
-
-