Record Class SnmpMcpServer.ServerConfiguration.TlsConfig
java.lang.Object
java.lang.Record
org.snmp4j.mcp.SnmpMcpServer.ServerConfiguration.TlsConfig
- Record Components:
trustCa- The distinguished name (DN) of the Certificate Authority that is accepted as issuer of the peer certificate chain, for example"CN=ca,OU=snmp4j,O=SNMP4J.org,C=DE". If not set, the peer certificate is validated by certification path validation against thetrustStoreonly.peerId- The subject distinguished name (DN) that the peer (server) certificate must have to be accepted, for example"CN=agent,OU=snmp4j,O=SNMP4J.org,C=DE".localId- The certificate alias inkeyStorethat identifies this SNMP command generator towards the (D)TLS server. It is used aslocalCertificateAliasunlesslocalCertificateAliasis set explicitly.tlsVersion- The TLS protocol versions to be offered during handshake, as a comma separated list in descending preference (e.g."TLSv1.3,TLSv1.2"). Applies totls:addresses; default isTLSTM.DEFAULT_TLSTM_PROTOCOLS.keyStore- The file path of the key store holding the private key and certificate of this command generator.keyStorePassword- The password used to access the key store.trustStore- The file path of the trust store holding the trusted (CA) certificates.trustStorePassword- The password used to access the trust store.peerHostId- The identity the peer has to prove with its certificate, independently of thesecurityName. It corresponds tosnmpTlstmAddrServerIdentityof RFC 6353 §5.3.1 and is matched against thedNSNameandiPAddresssubject alternative names of the server certificate, where the left-most label of adNSNamemay be a wildcard. If not set, thesecurityNameis used as expected identity.securityName- ThetmSecurityNameof the (D)TLS target. If not set, thesecurityNameof theSNMPv3configuration is used.securityLevel- The security level of the (D)TLS target (noAuthNoPriv,authNoPrivorauthPriv). Defaults to thesecurityLevelof theSNMPv3configuration and, if that is not set either, toauthPrivas required by RFC 5953 §3.1.serverFingerprint- The hexadecimal fingerprint of the server certificate to pin, optionally colon delimited. When set, the server certificate is accepted if it matches this fingerprint, without certification path validation.clientFingerprint- The hexadecimal fingerprint of the local (client) certificate to present, optionally colon delimited.dtlsVersion- The DTLS protocol versions to be offered during handshake, as a comma separated list (e.g."DTLSv1.2"). Applies todtls:addresses; default isDTLSTM.DEFAULT_DTLSTM_PROTOCOLS.localCertificateAlias- The alias that selects a single certification chain fromkeyStorefor authenticating this command generator. Defaults tolocalId.endpointIdentificationAlgorithm- The JSSE endpoint identification algorithm applied to the client mode SSL engine,"HTTPS"by default. Set it to an empty string to disable JSSE endpoint identification, which is needed for fingerprint pinned targets whose certificates carry no matching subject alternative name.crlURI- The URI of an X.509 certificate revocation list (CRL) to be consulted during certification path validation.revocationCheckOptions- The names of thePKIXRevocationChecker.Optionconstants (e.g.["PREFER_CRLS", "ONLY_END_ENTITY", "NO_FALLBACK"]) that configure PKIX revocation checking. An empty list activates revocation checking with the SNMP4J defaults; if the property is absent, no revocation checker is installed.maxFragmentSize- The maximum (D)TLS fragment size as defined by RFC 6066 §4.maxInboundMessageSize- The maximum size of an inbound SNMP message in bytes.dtlsHandshakeTimeout- The DTLS handshake timeout in milliseconds (DTLSTM.DEFAULT_HANDSHAKE_TIMEOUTby default).dtlsConnectionTimeout- The time in milliseconds after which an idle DTLS connection is closed (DTLSTM.DEFAULT_CONNECTION_TIMEOUTby default).localEngineID- The local SNMP engine ID of this command generator as a hexadecimal string. It is used as the engine ID of the Transport Security Model (TSM, RFC 5591) that (D)TLS targets require. A random engine ID is generated when not configured.tsmUsePrefix- ThesnmpTsmConfigurationUsePrefixflag of RFC 5591 §5.
- Enclosing class:
SnmpMcpServer.ServerConfiguration
public static record SnmpMcpServer.ServerConfiguration.TlsConfig(String trustCa, String peerId, String localId, String tlsVersion, String keyStore, String keyStorePassword, String trustStore, String trustStorePassword, String peerHostId, String securityName, String securityLevel, String serverFingerprint, String clientFingerprint, String dtlsVersion, String localCertificateAlias, String endpointIdentificationAlgorithm, String crlURI, List<String> revocationCheckOptions, Integer maxFragmentSize, Integer maxInboundMessageSize, Integer dtlsHandshakeTimeout, Long dtlsConnectionTimeout, String localEngineID, Boolean tsmUsePrefix)
extends Record
A record representing the configuration for (D)TLS (Datagram Transport Layer Security) as defined by
RFC 6353 (TLSTM) and RFC 7296/RFC 5953 (DTLSTM). It carries both the parameters of the
TLSTM/DTLSTM transport mapping (key and trust
material, protocol versions, revocation checking) and the parameters of the
TlsX509CertifiedTarget that is created for a tls: or
dtls: target address (security name, certificate fingerprints, expected server identity).
All string parameters are optional; a null or blank value means "not configured" and leaves
the corresponding SNMP4J default (which for the key and trust store falls back to the
javax.net.ssl.* system properties) in place.
- Since:
- 0.0.1
- Version:
- 0.1.0
- Author:
- SNMP4J.org
-
Constructor Summary
ConstructorsConstructorDescriptionTlsConfig(String trustCa, String peerId, String localId, String tlsVersion, String keyStore, String keyStorePassword, String trustStore, String trustStorePassword, String peerHostId, String securityName, String securityLevel, String serverFingerprint, String clientFingerprint, String dtlsVersion, String localCertificateAlias, String endpointIdentificationAlgorithm, String crlURI, List<String> revocationCheckOptions, Integer maxFragmentSize, Integer maxInboundMessageSize, Integer dtlsHandshakeTimeout, Long dtlsConnectionTimeout, String localEngineID, Boolean tsmUsePrefix) Creates an instance of aTlsConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theclientFingerprintrecord component.crlURI()Returns the value of thecrlURIrecord component.Returns the value of thedtlsConnectionTimeoutrecord component.Returns the value of thedtlsHandshakeTimeoutrecord component.Returns the value of thedtlsVersionrecord component.Returns the value of theendpointIdentificationAlgorithmrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.keyStore()Returns the value of thekeyStorerecord component.Returns the value of thekeyStorePasswordrecord component.Returns the value of thelocalCertificateAliasrecord component.Returns the value of thelocalEngineIDrecord component.localId()Returns the value of thelocalIdrecord component.Returns the value of themaxFragmentSizerecord component.Returns the value of themaxInboundMessageSizerecord component.Returns the value of thepeerHostIdrecord component.peerId()Returns the value of thepeerIdrecord component.Returns the value of therevocationCheckOptionsrecord component.Returns the value of thesecurityLevelrecord component.Returns the value of thesecurityNamerecord component.Returns the value of theserverFingerprintrecord component.Returns the value of thetlsVersionrecord component.final StringtoString()Returns a string representation of this record class.trustCa()Returns the value of thetrustCarecord component.Returns the value of thetrustStorerecord component.Returns the value of thetrustStorePasswordrecord component.Returns the value of thetsmUsePrefixrecord component.
-
Constructor Details
-
TlsConfig
public TlsConfig(String trustCa, String peerId, String localId, String tlsVersion, String keyStore, String keyStorePassword, String trustStore, String trustStorePassword, String peerHostId, String securityName, String securityLevel, String serverFingerprint, String clientFingerprint, String dtlsVersion, String localCertificateAlias, String endpointIdentificationAlgorithm, String crlURI, List<String> revocationCheckOptions, Integer maxFragmentSize, Integer maxInboundMessageSize, Integer dtlsHandshakeTimeout, Long dtlsConnectionTimeout, String localEngineID, Boolean tsmUsePrefix) Creates an instance of aTlsConfigrecord class.- Parameters:
trustCa- the value for thetrustCarecord componentpeerId- the value for thepeerIdrecord componentlocalId- the value for thelocalIdrecord componenttlsVersion- the value for thetlsVersionrecord componentkeyStore- the value for thekeyStorerecord componentkeyStorePassword- the value for thekeyStorePasswordrecord componenttrustStore- the value for thetrustStorerecord componenttrustStorePassword- the value for thetrustStorePasswordrecord componentpeerHostId- the value for thepeerHostIdrecord componentsecurityName- the value for thesecurityNamerecord componentsecurityLevel- the value for thesecurityLevelrecord componentserverFingerprint- the value for theserverFingerprintrecord componentclientFingerprint- the value for theclientFingerprintrecord componentdtlsVersion- the value for thedtlsVersionrecord componentlocalCertificateAlias- the value for thelocalCertificateAliasrecord componentendpointIdentificationAlgorithm- the value for theendpointIdentificationAlgorithmrecord componentcrlURI- the value for thecrlURIrecord componentrevocationCheckOptions- the value for therevocationCheckOptionsrecord componentmaxFragmentSize- the value for themaxFragmentSizerecord componentmaxInboundMessageSize- the value for themaxInboundMessageSizerecord componentdtlsHandshakeTimeout- the value for thedtlsHandshakeTimeoutrecord componentdtlsConnectionTimeout- the value for thedtlsConnectionTimeoutrecord componentlocalEngineID- the value for thelocalEngineIDrecord componenttsmUsePrefix- the value for thetsmUsePrefixrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
trustCa
-
peerId
-
localId
-
tlsVersion
Returns the value of thetlsVersionrecord component.- Returns:
- the value of the
tlsVersionrecord component
-
keyStore
-
keyStorePassword
Returns the value of thekeyStorePasswordrecord component.- Returns:
- the value of the
keyStorePasswordrecord component
-
trustStore
Returns the value of thetrustStorerecord component.- Returns:
- the value of the
trustStorerecord component
-
trustStorePassword
Returns the value of thetrustStorePasswordrecord component.- Returns:
- the value of the
trustStorePasswordrecord component
-
peerHostId
Returns the value of thepeerHostIdrecord component.- Returns:
- the value of the
peerHostIdrecord component
-
securityName
Returns the value of thesecurityNamerecord component.- Returns:
- the value of the
securityNamerecord component
-
securityLevel
Returns the value of thesecurityLevelrecord component.- Returns:
- the value of the
securityLevelrecord component
-
serverFingerprint
Returns the value of theserverFingerprintrecord component.- Returns:
- the value of the
serverFingerprintrecord component
-
clientFingerprint
Returns the value of theclientFingerprintrecord component.- Returns:
- the value of the
clientFingerprintrecord component
-
dtlsVersion
Returns the value of thedtlsVersionrecord component.- Returns:
- the value of the
dtlsVersionrecord component
-
localCertificateAlias
Returns the value of thelocalCertificateAliasrecord component.- Returns:
- the value of the
localCertificateAliasrecord component
-
endpointIdentificationAlgorithm
Returns the value of theendpointIdentificationAlgorithmrecord component.- Returns:
- the value of the
endpointIdentificationAlgorithmrecord component
-
crlURI
-
revocationCheckOptions
Returns the value of therevocationCheckOptionsrecord component.- Returns:
- the value of the
revocationCheckOptionsrecord component
-
maxFragmentSize
Returns the value of themaxFragmentSizerecord component.- Returns:
- the value of the
maxFragmentSizerecord component
-
maxInboundMessageSize
Returns the value of themaxInboundMessageSizerecord component.- Returns:
- the value of the
maxInboundMessageSizerecord component
-
dtlsHandshakeTimeout
Returns the value of thedtlsHandshakeTimeoutrecord component.- Returns:
- the value of the
dtlsHandshakeTimeoutrecord component
-
dtlsConnectionTimeout
Returns the value of thedtlsConnectionTimeoutrecord component.- Returns:
- the value of the
dtlsConnectionTimeoutrecord component
-
localEngineID
Returns the value of thelocalEngineIDrecord component.- Returns:
- the value of the
localEngineIDrecord component
-
tsmUsePrefix
Returns the value of thetsmUsePrefixrecord component.- Returns:
- the value of the
tsmUsePrefixrecord component
-