Module org.snmp4j

Class PropertiesTlsTmSecurityCallback

  • All Implemented Interfaces:
    TlsTmSecurityCallback<X509Certificate>

    public class PropertiesTlsTmSecurityCallback
    extends Object
    implements TlsTmSecurityCallback<X509Certificate>
    The PropertiesTlsTmSecurityCallback resolves the tmSecurityName for incoming requests by using the (system) properties org.snmp4j.arg.securityName org.snmp4j.arg.tlsLocalID org.snmp4j.arg.tlsTrustCA org.snmp4j.arg.tlsPeerID
    Since:
    2.0
    Version:
    3.3.0
    Author:
    Frank Fock
    • Constructor Detail

      • PropertiesTlsTmSecurityCallback

        public PropertiesTlsTmSecurityCallback​(boolean serverMode)
      • PropertiesTlsTmSecurityCallback

        public PropertiesTlsTmSecurityCallback​(Properties properties,
                                               boolean serverMode)
    • Method Detail

      • getSecurityName

        public OctetString getSecurityName​(X509Certificate[] peerCertificateChain)
        Description copied from interface: TlsTmSecurityCallback
        Gets the tmSecurityName (see RFC 5953) from the certificate chain of the communication peer that needs to be authenticated.
        Specified by:
        getSecurityName in interface TlsTmSecurityCallback<X509Certificate>
        Parameters:
        peerCertificateChain - an array of Certificates with the peer's own certificate first followed by any CA authorities.
        Returns:
        the tmSecurityName as defined by RFC 5953.
      • getLocalCertificateAlias

        public String getLocalCertificateAlias​(Address targetAddress)
        Description copied from interface: TlsTmSecurityCallback
        Gets the local certificate alias to be used for the supplied target address.
        Specified by:
        getLocalCertificateAlias in interface TlsTmSecurityCallback<X509Certificate>
        Parameters:
        targetAddress - a target address or null if the default local certificate alias needs to be retrieved.
        Returns:
        the requested local certificate alias, if known. Otherwise null is returned which could cause a protocol violation if the local key store contains more than one certificate.