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
LSCFile
objects 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>
certChainDescription
The certificate chain description contained in this LSC file.(package private) java.lang.String
filename
The LSC filename.(package private) java.lang.String
hostname
The hostname that this LSC file pertains to.(package private) java.lang.String
vo
The 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 boolean
equals(java.lang.Object obj)
Determines if twoLSCFile
objects are equal based on their VO and hostname.java.util.List<java.lang.String>
getCertificateChainDescription()
Returns the certificate chain description.java.lang.String
getFilename()
Returns the filename of the LSC file.java.lang.String
getHostname()
Returns the hostname.java.lang.String
getVOName()
Returns the VO name.int
hashCode()
Computes the hash code for this LSC file.boolean
matches(java.security.cert.X509Certificate[] certChain)
Checks if the given certificate chain matches the description in this LSC file.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.void
setCertificateChainDescription(java.util.List<java.lang.String> certChainDesc)
Sets the certificate chain description.void
setFilename(java.lang.String filename)
Sets the filename for this LSC file.void
setHostname(java.lang.String hostname)
Sets the hostname.void
setVo(java.lang.String vo)
Sets the VO name.java.lang.String
toString()
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:
getHostname
in interfaceLSCInfo
- Returns:
- the hostname
-
getCertificateChainDescription
public java.util.List<java.lang.String> getCertificateChainDescription()
Returns the certificate chain description.- Specified by:
getCertificateChainDescription
in interfaceLSCInfo
- Returns:
- a list of certificate chain descriptions
-
getFilename
public java.lang.String getFilename()
Returns the filename of the LSC file.- Specified by:
getFilename
in interfaceLSCInfo
- Returns:
- the LSC filename
-
setFilename
public void setFilename(java.lang.String filename)
Sets the filename for this LSC file.- Specified by:
setFilename
in 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:
hashCode
in classjava.lang.Object
- Returns:
- the hash code
-
equals
public boolean equals(java.lang.Object obj)
Determines if twoLSCFile
objects are equal based on their VO and hostname.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the object to compare with- Returns:
true
if the objects are equal, otherwisefalse
-
toString
public java.lang.String toString()
Returns a string representation of this LSC file.- Overrides:
toString
in 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:
true
if the DNs match, otherwisefalse
-
-