Class SubjectDNMatcher


  • public class SubjectDNMatcher
    extends java.lang.Object
    Help class used to match a DN field for a specific value Created by philip on 2017-08-07.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.bouncycastle.asn1.ASN1ObjectIdentifier getIdentifier​(java.lang.String dnSymbol)
      Returns the symbols related ASN1 identifier.
      boolean subjectMatch​(java.security.cert.X509Certificate cert, java.lang.String subjectDNField, java.lang.String subjectDNValue)
      Help method to verify if a certificate matches the subject DN of a certificate.
      boolean subjectMatch​(java.security.cert.X509Certificate cert, org.bouncycastle.asn1.ASN1ObjectIdentifier subjectDNField, java.lang.String subjectDNValue)
      Help method to verify if a certificate matches the subject DN of a certificate.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SubjectDNMatcher

        public SubjectDNMatcher()
    • Method Detail

      • subjectMatch

        public boolean subjectMatch​(java.security.cert.X509Certificate cert,
                                    java.lang.String subjectDNField,
                                    java.lang.String subjectDNValue)
        Help method to verify if a certificate matches the subject DN of a certificate.
        Parameters:
        cert - the certificate to check if subject dn matches.
        subjectDNField - the subject dn field to match, ex OU
        subjectDNValue - the value to match, ex backend
        Returns:
        true if subject matches otherwise false.
      • subjectMatch

        public boolean subjectMatch​(java.security.cert.X509Certificate cert,
                                    org.bouncycastle.asn1.ASN1ObjectIdentifier subjectDNField,
                                    java.lang.String subjectDNValue)
        Help method to verify if a certificate matches the subject DN of a certificate.
        Parameters:
        cert - the certificate to check if subject dn matches.
        subjectDNField - the ASN1ObjectIdentifier subject dn field to match, ex OU
        subjectDNValue - the value to match, ex backend
        Returns:
        true if subject matches otherwise false.
      • getIdentifier

        public org.bouncycastle.asn1.ASN1ObjectIdentifier getIdentifier​(java.lang.String dnSymbol)
        Returns the symbols related ASN1 identifier.
        Parameters:
        dnSymbol - the dn symbol
        Returns:
        the related asn1 identifier or null if symbol was not found.