Module org.snmp4j

Class TLSTMUtil


  • public class TLSTMUtil
    extends Object
    The TLSTMUtil class implements common functions for TLSTM and DTLSTM.
    Since:
    3.0
    Version:
    3.6.0
    Author:
    Frank Fock
    • Constructor Detail

      • TLSTMUtil

        public TLSTMUtil()
    • Method Detail

      • isMatchingFingerprint

        public static boolean isMatchingFingerprint​(X509Certificate[] x509Certificates,
                                                    OctetString fingerprint,
                                                    boolean useClientMode,
                                                    CounterSupport tlstmCounters,
                                                    LogAdapter logger,
                                                    Object eventSource)
                                             throws CertificateException
        Checks if any of the certificates in the provided array matches the given fingerprint. If the fingerprint to match is null or zero length, false will be returned, because a matching cannot be performed.
        Parameters:
        x509Certificates - the certificates to match.
        fingerprint - the searched fingerprint
        useClientMode - defines if server or client mode is active to emit the right counter events.
        tlstmCounters - the counters to increase on matching
        logger - where to log
        eventSource - the source object for events emitted by the matching.
        Returns:
        true if there is a match, false if matching could not be performed due to null or zero length fingerprint
        Throws:
        CertificateException - if there is no matching, but fingerprint is non-null and has a length greater than zero.
      • getSubjAltName

        public static Object getSubjAltName​(Collection<List<?>> subjAltNames,
                                            int type)
      • addCRLCertStore

        protected static void addCRLCertStore​(String crlFilePath,
                                              PKIXBuilderParameters pkixBuilderParameters)
        Return the initialization parameters for a TrustManager for doing cert path validation with CRL revocation based on a CRL file. Currently, only the default PKIX is supported.
        Parameters:
        crlFilePath - the path to the CRL file that provides the CRL collection for checking revocation.
        pkixBuilderParameters - the PKIXBuilderParameters to modify.
        Since:
        3.6.0