com.outbackinc.services.protocol.snmp
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
          1
static int CSMv2c_ID
          2
static int USM_ID
          3
 
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, java.net.DatagramPacket 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

CSMv1_ID

public static final int CSMv1_ID
1

CSMv2c_ID

public static final int CSMv2c_ID
2

USM_ID

public static final int USM_ID
3
Method Detail

getID

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.

processOutgoingMessage

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.
Parameters:
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.
Returns:
an ready to send SNMP message (ASN.1-encoded byte array) as a Pair (byte[] array and length).

processIncomingMessage

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

createSecurityToken

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.
Parameters:
cSnmpAuthoritativeSession - the session that the security model will create a token for
Returns:
the security token for the session

supportedBySnmpVersion

public boolean supportedBySnmpVersion(int iSnmpVersion)
Determines if the given SNMP version supports this security model.
Parameters:
iSnmpVersion - SNMP version
Returns:
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.