Package org.snmp4j.transport.tls
Interface TlsTransportMappingConfig<C extends Certificate>
- Type Parameters:
C
- the certificate type supported by theTlsTmSecurityCallback
hook provided by this transport mapping.
- All Known Subinterfaces:
X509TlsTransportMappingConfig
public interface TlsTransportMappingConfig<C extends Certificate>
The
TlsTransportMappingConfig
interface provides means to plug in a TlsTmSecurityCallback
into
the TransportMapping
implementation and to control other TLS specific settings.- Since:
- 3.0
- Author:
- Frank Fock
-
Method Summary
Modifier and TypeMethodDescriptionReturns the property name that is used by this transport mapping to determine the protocol versions from system properties.String[]
Return the (D)TLS protocol versions used by this transport mapping.Gets theTlsTmSecurityCallback
associated with thisTransportMapping
hook which is called by the transport mapping to lookup TLS security parameters from external configuration.void
setKeyStore
(String keyStore) void
setKeyStorePassword
(String keyStorePassword) void
setLocalCertificateAlias
(String localCertificateAlias) Sets the certificate alias used for client and server authentication by this TLSTM.void
setProtocolVersions
(String[] protocolVersions) Sets the (D)TLS protocols/versions that thisTlsTransportMappingConfig
should use during handshake.void
setSecurityCallback
(TlsTmSecurityCallback<C> securityCallback) Sets theTlsTmSecurityCallback
associated with thisTransportMapping
hook.void
setTrustStore
(String trustStore) void
setTrustStorePassword
(String trustStorePassword)
-
Method Details
-
getSecurityCallback
TlsTmSecurityCallback<C> getSecurityCallback()Gets theTlsTmSecurityCallback
associated with thisTransportMapping
hook which is called by the transport mapping to lookup TLS security parameters from external configuration.- Returns:
- a
TlsTmSecurityCallback
instance. - Since:
- 3.0
-
setSecurityCallback
Sets theTlsTmSecurityCallback
associated with thisTransportMapping
hook. This hook will be called to lookup the security name based on the TLS peer certificate, for example. SeeTlsTmSecurityCallback
for details.- Parameters:
securityCallback
- aTlsTmSecurityCallback
instance. Setting this hook tonull
will disable incoming request processing because these request will be rejected due to an authorization error (no mathing SNMPv3 view).- Since:
- 3.0
-
getKeyStore
String getKeyStore() -
setKeyStore
-
getKeyStorePassword
String getKeyStorePassword() -
setKeyStorePassword
-
getTrustStore
String getTrustStore() -
setTrustStore
-
getTrustStorePassword
String getTrustStorePassword() -
setTrustStorePassword
-
setLocalCertificateAlias
Sets the certificate alias used for client and server authentication by this TLSTM. Setting this property to a value other thannull
filters out any certificates which are not in the chain of the given alias.- Parameters:
localCertificateAlias
- a certificate alias which filters a single certification chain from thejavax.net.ssl.keyStore
key store to be used to authenticate this TLS transport mapping. Ifnull
no filtering appears, which could lead to more than a single chain available for authentication by the peer, which would violate the (D)TLSTM standard requirements.
-
setProtocolVersions
Sets the (D)TLS protocols/versions that thisTlsTransportMappingConfig
should use during handshake.- Parameters:
protocolVersions
- an array of (D)TLS protocol (version) names supported by the SunJSSE provider. The order in the array defines which protocol is tried during handshake first.- Since:
- 3.0
-
getProtocolVersions
String[] getProtocolVersions()Return the (D)TLS protocol versions used by this transport mapping.- Returns:
- an array of SunJSSE TLS/DTLS provider (depending on the transport mapping type).
-
getProtocolVersionPropertyName
String getProtocolVersionPropertyName()Returns the property name that is used by this transport mapping to determine the protocol versions from system properties.- Returns:
- a property name like
SnmpConfigurator.P_TLS_VERSION
orSnmpConfigurator.P_DTLS_VERSION
.
-