| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.adventnet.snmp.snmp2.SecurityModelEntry
This is an abstract class which is used to define a new security model. API users should extend this class to implement their own security model. This class has a security model number, a model independent securityName, a model dependent securityID and the securityLevel of the model independent securityName. This class has to be extended to provide the securityModel specific parameters (In case of the USM, the parameters are engineID, engineBoots, engineTime, authentication and privacy parameters). In addition this class also has the abstract methods to encode/decode the messageSecurityParameters and authenticate the message to be sent/received.
To implement a securityModel, the securityModel has to be registered with the securityProvider. And it is for this purpose a security provider class is given.
SecurityProvider| Constructor Summary | |
SecurityModelEntry()
 | 
|
| Method Summary | |
abstract  void | 
authenticateMessageToSend(Snmp3Message msg,
                          SnmpSession session)
Prepares the outgoing message as per security model and message security level etc.  | 
abstract  int | 
authenticateReceivedMessage(Snmp3Message msg,
                            SnmpSession session)
Performs authentication of the received message as per the security model.  | 
abstract  SecurityModelEntry | 
copy()
This returns the copy of this Security Entry object.  | 
abstract  void | 
decodeMsgSecurityParams(Snmp3Message msg,
                        SnmpSession session,
                        ASN1Parser parser)
This method will decode the securityModel dependent security parameters.  | 
abstract  byte[] | 
decrypt(byte[] data,
        int offset,
        byte[] key,
        int protocol,
        byte[] privParams)
This method is called to decrypt the data.  | 
abstract  boolean | 
encodeMsgSecurityParams(Snmp3Message msg,
                        SnmpAPI API,
                        ASN1Parser asnParser)
This method will encode the securityModel dependent security parameters.  | 
abstract  int | 
encrypt(byte[] data,
        int spaceLeft,
        byte[] key,
        int protocol,
        byte[] privParams)
This method is called to encrypt the data.  | 
abstract  byte[] | 
getEngineID()
Returns the engineID of this SnmpEngine.  | 
abstract  java.lang.Object | 
getKey()
Returns an Object which is interpretted as a key to uniquely identify this entry in the SecurityModelTable.  | 
abstract  byte[] | 
getSecurityID(byte[] securityName)
Returns a security model dependent securityID, using the security model independent security name.  | 
abstract  byte | 
getSecurityLevel()
Returns the security level associated with this securityEntry.  | 
abstract  int | 
getSecurityModel()
Returns the security model.  | 
abstract  byte[] | 
getSecurityName()
Returns the security model independent security name.  | 
abstract  byte[] | 
getSecurityName(byte[] securityID)
Returns a security model independent security name, using the security model dependent securityID.  | 
abstract  void | 
processEncodedMsg(Snmp3Message msg,
                  ASN1Parser parser)
This method is called after encoding the message version.  | 
abstract  void | 
setSecurityLevel(byte level)
Sets the security level associated with this securityEntry.  | 
abstract  void | 
setSecurityName(byte[] name)
Sets the security name by taking in the security model independent security name as the argument.  | 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public SecurityModelEntry()
| Method Detail | 
public abstract int getSecurityModel()
public abstract byte[] getEngineID()
public abstract byte[] getSecurityName()
public abstract byte[] getSecurityName(byte[] securityID)
public abstract byte[] getSecurityID(byte[] securityName)
public abstract void setSecurityName(byte[] name)
public abstract byte getSecurityLevel()
public abstract void setSecurityLevel(byte level)
public abstract java.lang.Object getKey()
public abstract int authenticateReceivedMessage(Snmp3Message msg,
                                                SnmpSession session)
msg - The Smp3Message instance.session - The SnmpSession instance, incase this module requires
 to reply appropriately.
public abstract void authenticateMessageToSend(Snmp3Message msg,
                                               SnmpSession session)
                                        throws SnmpException
msg - The Snmp3Message instance.session - The SnmpSession instance.SnmpException - If the message could not be authenticated
 properly or the particular entry is not available.public abstract SecurityModelEntry copy()
public abstract boolean encodeMsgSecurityParams(Snmp3Message msg,
                                                SnmpAPI API,
                                                ASN1Parser asnParser)
msg - The Snmp3Message instance.API - The SnmpAPI Instance.asnParser - The reference to ASN1Parser which has the
 methods to encode the SnmpPDU.
public abstract void decodeMsgSecurityParams(Snmp3Message msg,
                                             SnmpSession session,
                                             ASN1Parser parser)
                                      throws SnmpException,
                                             java.lang.ArrayIndexOutOfBoundsException
msg - The Snmp3Message instance.asnParser - The reference to ASN1Parser which has the
 data and methods to encode/decode the SnmpPDU.SnmpException - If the security parameters could not be 
 decoded properly.java.lang.ArrayIndexOutOfBoundsException - If an unrecognized 
 snmp message
public abstract void processEncodedMsg(Snmp3Message msg,
                                       ASN1Parser parser)
msg - Snmp3Messgage instance.asnParser - The reference to ASN1Parser which has the
 encoded data and methods to encode the SnmpPDU.
public abstract int encrypt(byte[] data,
                            int spaceLeft,
                            byte[] key,
                            int protocol,
                            byte[] privParams)
                     throws SnmpException
data - The data to be encrypt.spaceleft - The space left in the buffer while encoding.key - The key value used in encryption.protocol - The protocol used for encryption.privParams - The privacy params used in encryption.
public abstract byte[] decrypt(byte[] data,
                               int offset,
                               byte[] key,
                               int protocol,
                               byte[] privParams)
data - The data to be decrypt.offset - The offset value to be used in decrypt.key - The key value to be used in decryption.protocol - The protocol used for decryption.privParams - The privacy params used in decryption.
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||