Module org.snmp4j
Package org.snmp4j.transport.tls
Interface TlsTransportMappingConfig<C extends java.security.cert.Certificate>
-
- Type Parameters:
C- the certificate type supported by theTlsTmSecurityCallbackhook provided by this transport mapping.
- All Known Subinterfaces:
X509TlsTransportMappingConfig
public interface TlsTransportMappingConfig<C extends java.security.cert.Certificate>TheTlsTransportMappingConfiginterface provides means to plug in aTlsTmSecurityCallbackinto theTransportMappingimplementation and to control other TLS specific settings.- Since:
- 3.0
- Author:
- Frank Fock
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetKeyStore()java.lang.StringgetKeyStorePassword()java.lang.StringgetLocalCertificateAlias()Gets the certificate alias used for client and server authentication.java.lang.StringgetProtocolVersionPropertyName()Returns the property name that is used by this transport mapping to determine the protocol versions from system properties.java.lang.String[]getProtocolVersions()Return the (D)TLS protocol versions used by this transport mapping.TlsTmSecurityCallback<C>getSecurityCallback()Gets theTlsTmSecurityCallbackassociated with thisTransportMappinghook which is called by the transport mapping to lookup TLS security parameters from external configuration.java.lang.StringgetTrustStore()java.lang.StringgetTrustStorePassword()voidsetKeyStore(java.lang.String keyStore)voidsetKeyStorePassword(java.lang.String keyStorePassword)voidsetLocalCertificateAlias(java.lang.String localCertificateAlias)Sets the certificate alias used for client and server authentication by this TLSTM.voidsetProtocolVersions(java.lang.String[] protocolVersions)Sets the (D)TLS protocols/versions that thisTlsTransportMappingConfigshould use during handshake.voidsetSecurityCallback(TlsTmSecurityCallback<C> securityCallback)Sets theTlsTmSecurityCallbackassociated with thisTransportMappinghook.voidsetTrustStore(java.lang.String trustStore)voidsetTrustStorePassword(java.lang.String trustStorePassword)
-
-
-
Method Detail
-
getSecurityCallback
TlsTmSecurityCallback<C> getSecurityCallback()
Gets theTlsTmSecurityCallbackassociated with thisTransportMappinghook which is called by the transport mapping to lookup TLS security parameters from external configuration.- Returns:
- a
TlsTmSecurityCallbackinstance. - Since:
- 3.0
-
setSecurityCallback
void setSecurityCallback(TlsTmSecurityCallback<C> securityCallback)
Sets theTlsTmSecurityCallbackassociated with thisTransportMappinghook. This hook will be called to lookup the security name based on the TLS peer certificate, for example. SeeTlsTmSecurityCallbackfor details.- Parameters:
securityCallback- aTlsTmSecurityCallbackinstance. Setting this hook tonullwill disable incoming request processing because these request will be rejected due to an authorization error (no mathing SNMPv3 view).- Since:
- 3.0
-
getKeyStore
java.lang.String getKeyStore()
-
setKeyStore
void setKeyStore(java.lang.String keyStore)
-
getKeyStorePassword
java.lang.String getKeyStorePassword()
-
setKeyStorePassword
void setKeyStorePassword(java.lang.String keyStorePassword)
-
getTrustStore
java.lang.String getTrustStore()
-
setTrustStore
void setTrustStore(java.lang.String trustStore)
-
getTrustStorePassword
java.lang.String getTrustStorePassword()
-
setTrustStorePassword
void setTrustStorePassword(java.lang.String trustStorePassword)
-
setLocalCertificateAlias
void setLocalCertificateAlias(java.lang.String localCertificateAlias)
Sets the certificate alias used for client and server authentication by this TLSTM. Setting this property to a value other thannullfilters 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.keyStorekey store to be used to authenticate this TLS transport mapping. Ifnullno 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.
-
getLocalCertificateAlias
java.lang.String getLocalCertificateAlias()
Gets the certificate alias used for client and server authentication. See alsosetLocalCertificateAlias(java.lang.String)- Returns:
- the certificate alias selecting the local certificate.
- Since:
- 3.0.5
-
setProtocolVersions
void setProtocolVersions(java.lang.String[] protocolVersions)
Sets the (D)TLS protocols/versions that thisTlsTransportMappingConfigshould 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
java.lang.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
java.lang.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_VERSIONorSnmpConfigurator.P_DTLS_VERSION.
-
-