Class 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 two LSCFile 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.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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.
    • Constructor Detail

      • LSCFile

        public LSCFile()
    • Method Detail

      • getVOName

        public java.lang.String getVOName()
        Returns the VO name.
        Specified by:
        getVOName in interface LSCInfo
        Returns:
        the VO name
      • getHostname

        public java.lang.String getHostname()
        Returns the hostname.
        Specified by:
        getHostname in interface LSCInfo
        Returns:
        the hostname
      • getCertificateChainDescription

        public java.util.List<java.lang.String> getCertificateChainDescription()
        Returns the certificate chain description.
        Specified by:
        getCertificateChainDescription in interface LSCInfo
        Returns:
        a list of certificate chain descriptions
      • getFilename

        public java.lang.String getFilename()
        Returns the filename of the LSC file.
        Specified by:
        getFilename in interface LSCInfo
        Returns:
        the LSC filename
      • setFilename

        public void setFilename​(java.lang.String filename)
        Sets the filename for this LSC file.
        Specified by:
        setFilename in interface LSCInfo
        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 class java.lang.Object
        Returns:
        the hash code
      • equals

        public boolean equals​(java.lang.Object obj)
        Determines if two LSCFile objects are equal based on their VO and hostname.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to compare with
        Returns:
        true if the objects are equal, otherwise false
      • toString

        public java.lang.String toString()
        Returns a string representation of this LSC file.
        Overrides:
        toString in class java.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.
        Specified by:
        matches in interface LSCInfo
        Parameters:
        certChain - the certificate chain to verify
        Returns:
        true if the certificate chain matches, otherwise false
      • 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 DN
        lscDn - the expected DN in the LSC file
        Returns:
        true if the DNs match, otherwise false