org.snmp4j.security package contains three groups of
classes and interfaces:
- The authentication protocols group contains interfaces and classes for authentication of SNMP(v3) messages.
- The privacy protocols group contains interfaces and classes for encryption and decryption of SNMP(v3) messages.
- The security model group combines authentication and privacy protocols to provide security services to message processing models.
Authentication as well as privacy protocols are security protocols and
thus both are derived from the common interface
In order to be able to use a security protocol with SNMP4J, the protocol
implementation class has to be registered with the
SecurityProtocols singleton, which provides access to
authentication and privacy protocols.
All SNMP4J authentication protocol implementations have to implement the
AuthenticationProtocol interface. SNMP4J provides implementation
for the following authentication protocols:
- MD5, which is implemented by
- SHA, which is implemented by
All SNMP4J privacy protocol implementations have to implement the
PrivacyProtocol interface. SNMP4J provides implementation
for the following privacy protocols:
- DES in CBC mode, which is implemented by
- AES with 128bit key, which is implemented by
- AES with 192bit key, which is implemented by
- AES with 256bit key, which is implemented by
PrivAES256. In order to be able to use 256bit strong encryption, the strong encryption enhancement package has to be downloaded and installed.
All SNMP4J security models have to implement the
interface. Before a security model can be used with SNMP4J, it has to be
registered with the
SecurityModels singleton which provides
access to security models. SNMP4J implements a single security model, the
User Based Security Model (USM).
USM class uses a user name table (which contains
user names) and a user table (which contains localized user information) to
store user information. A time table is used to store time information
about SNMP engines to protect SNMP communication against replay attacks
if the corresponding security level has chosen.
The following UML class diagram shows the most important classes of the
org.snmp4j.security package and their relationships
(relationships to other packages are not shown):
Interface Summary Interface Description AuthenticationProtocolThe
AuthenticationProtocolinterface defines a common interface for all SNMP authentication protocols.
PrivacyProtocolinterface defines a common interface for all SNMP privacy protocols.
SecurityModelinterface as described in RFC3411 section 4.4 and RFC 5590 section 5.
SecurityParametersinterface represents the security parameters in a SNMPv3 message.
SecurityProtocolclass defines common methods of authentication and privacy protocols.
SecurityStateReferenceinterface is an empty marker interface for security model dependent state references.
Class Summary Class Description AuthGenericThe abstract class AuthGeneric implements common operations for SNMP authentication protocols, such as MD5 and SHA. AuthHMAC128SHA224The class
AuthHMAC128SHA224implements the usmHMAC128SHA224AuthProtocol defined by RFC 7630.
AuthHMAC192SHA256implements the usmHMAC192SHA2256AuthProtocol defined by RFC 7630.
AuthHMAC256SHA384implements the usmHMAC256SHA3846AuthProtocol defined by RFC 7630.
AuthHMAC384SHA512implements the usmHMAC384SHA5126AuthProtocol defined by RFC 7630.
AuthMD5The AuthMD5 class implements the MD5 authentication protocol. AuthSHAThe
SHAclass implements the Secure Hash Authentication.
SHA-2class implements the Secure Hash Authentication 2.
ByteArrayWindowprovides windowed access to a subarray of a byte array.
CipherPoolThe CipherPool class provides service to share and reuse Cipher instances, across different threads. DecryptParamsParameter class for encrypt and decrypt methods of
Priv3DESPrivacy protocol class for Triple DES (DESEDE). PrivacyGenericThe PrivacyGeneric abstract class implements common functionality of privacy protocols. PrivAESBase class for PrivAES128, PrivAES192 and PrivAES256. PrivAES128Encryption class for AES 128. PrivAES192Encryption class for AES 192. PrivAES256Encryption class for AES 256. PrivDESPrivacy protocol class for DES. SaltClass that holds a 64 bit salt value for crypto operations. SecurityModelsThe
SecurityModelsclass is a collection of all supported security models of a SNMP entity.
SecurityProtocolsclass holds all authentication and privacy protocols for a SNMP entity.
SNMPv3SecurityModelThe abstract class
SNMPv3SecurityModelimplements common methods and fields for security models for the SNMPv3 message processing model.
TSM(Transport Security Model) implements a
SecurityModelwhich uses transport security mechanisms as defined in RFC 5591.
TsmSecurityStateReferenceholds cached security data for the
USMclass implements the User Based Security Model (USM) as defined in RFC 3414.
UsmSecurityStateReferenceholds cached security data for the
UsmTimeEntryclass represents time synchronization information associated with an engine ID.
UsmTimeTableclass is a singleton that stores USM user information as part of the Local Configuration Datastore (LCD).
UsmUserclass represents USM user providing information to secure SNMPv3 message exchange.
UsmUserEntryclass represents a user in the Local Configuration Datastore (LCD).
UsmUserTableclass stores USM user information as part of the Local Configuration Datastore (LCD).
Enum Summary Enum Description SecurityLevelThe
SecurityLevelinterface contains enumerated values for the different security levels.