Interface SnmpSecurityModel

All Known Implementing Classes:
USMSecurityModel, CSMSecurityModel

public interface SnmpSecurityModel

The SnmpSecurityModel interface defines methods that all security models must implement to be used in jSNMP. For example, the user-based Security Model, as defined in SNMPv3, must have its own implementation of this interface. Each implemenation of Security Model must have its own implementations of SnmpSecurityToken and SnmpSecurityInfo.

Each Security Model object must have a unique ID in order to register with the SnmpSecurityManager. The ID is the integer placed into the msgSecurityModel field in an SNMPv3 header. The IDs for USM and CSM are defined in this interface.

See Also:
SnmpAuthoritativeSession, SnmpSecurityManager, SnmpSecurityInfo, SnmpSecurityToken

Field Summary
static int CSMv1_ID
static int CSMv2c_ID
static int USM_ID
Method Summary
 SnmpSecurityToken createSecurityToken(SnmpAuthoritativeSession cSnmpAuthoritativeSession)
          Creates a security token for an authoritative session.
 int getID()
          Returns the unique identifier, used in an SNMPv3 header, of the security model.
 byte[] processIncomingMessage(SnmpAuthoritativeSession cSnmpAuthoritativeSession, cDatagramPacket)
          Processes an incoming message.
 com.outbackinc.util.ds.Pair processOutgoingMessage(SnmpAuthoritativeSession cSnmpAuthoritativeSession, int iMtu, byte[] cbMessageHeader, byte[] cbScopedPDU)
          Processes a message to be sent out to an agent.
 boolean supportedBySnmpVersion(int iSnmpVersion)
          Determines if the given SNMP version supports this security model.

Field Detail


public static final int CSMv1_ID


public static final int CSMv2c_ID


public static final int USM_ID
Method Detail


public int getID()
Returns the unique identifier, used in an SNMPv3 header, of the security model. Each security model implementation that is registered with jSNMP must return a unique value.


public com.outbackinc.util.ds.Pair processOutgoingMessage(SnmpAuthoritativeSession cSnmpAuthoritativeSession,
                                                          int iMtu,
                                                          byte[] cbMessageHeader,
                                                          byte[] cbScopedPDU)
                                                   throws SnmpSecurityException
Processes a message to be sent out to an agent. Performs any security mechanisms defined in the security model and specified in the security token. USM, for example, will encrypt and authenticate the message if security the security level is set to authPriv.
cSnmpAuthoritativeSession - specific session
iMtu - MTU of sending socket
cbMessageHeader - an ASN.1 encoded header (global data) for the PDU, excluding the security parameters.
cbScopedPDU - the scoped PDU of the message, which will be encrypted if encryption is used.
an ready to send SNMP message (ASN.1-encoded byte array) as a Pair (byte[] array and length).


public byte[] processIncomingMessage(SnmpAuthoritativeSession cSnmpAuthoritativeSession,
                              throws SnmpSecurityException
Processes an incoming message. Performs any decryption or authentication necessary, and returns a scoped PDU if sucessful.
cSnmpAuthoritativeSession - specific session
cDatagramPacket - the entire Datagram message, ASN.1 encoded
an ASN.1 encoded scoped PDU.


public SnmpSecurityToken createSecurityToken(SnmpAuthoritativeSession cSnmpAuthoritativeSession)
                                      throws SnmpSecurityException
Creates a security token for an authoritative session. A token is particular to a specific security model implementation, and can only be used by the security model that created it.
cSnmpAuthoritativeSession - the session that the security model will create a token for
the security token for the session


public boolean supportedBySnmpVersion(int iSnmpVersion)
Determines if the given SNMP version supports this security model.
iSnmpVersion - SNMP version
true if the SNMP version supports this security model.

Home  Services  Products  Purchase  Contact Us  About Us  Legal  Ceramics
Copyright © 2003-2008 jSNMP Enterprises All rights reserved.