Interface SnmpContextv3Face

All Superinterfaces:
SnmpContextBasisFace
All Known Implementing Classes:
SnmpContextv3, SnmpContextv3Basis, SnmpContextv3Discovery, SnmpContextv3Pool

public interface SnmpContextv3Face extends SnmpContextBasisFace
This interface contains the SNMP context interface that is needed by every PDU to send a SNMP v3 request. See SNMP-USER-BASED-SM-MIB, RFC 3411, RFC 3826 (AES)
Version:
$Revision: 3.20 $ $Date: 2009/03/05 12:56:17 $
Author:
Birgit Arkesteijn
  • Field Details

    • version_id

      static final String version_id
      See Also:
    • SNMPv1_Security_Model

      static final int SNMPv1_Security_Model
      The SNMPv1 security model. This has value 1. The stack does not implement this security model.
      See Also:
    • SNMPv2c_Security_Model

      static final int SNMPv2c_Security_Model
      The SNMPv2c security model. This has value 2. The stack does not implement this security model.
      See Also:
    • USM_Security_Model

      static final int USM_Security_Model
      The USM security model. This has value 3. This stack only implements this security model!
      See Also:
    • MD5_PROTOCOL

      static final int MD5_PROTOCOL
      The MD5 protocol type.
      See Also:
    • SHA1_PROTOCOL

      static final int SHA1_PROTOCOL
      The SHA-1 protocol type.
      See Also:
    • DES_ENCRYPT

      static final int DES_ENCRYPT
      The DES encryption type.
      See Also:
    • AES_ENCRYPT

      static final int AES_ENCRYPT
      The AES 128 encryption type.
      See Also:
    • Default_UserName

      static final String Default_UserName
      The default value for the (security) user name. This is "initial".
      See Also:
    • Default_ContextName

      static final String Default_ContextName
      The default Context Name. This is the zero length string, i.e. "".
      See Also:
    • ProtocolNames

      static final String[] ProtocolNames
      The array with the String represensations of the protocols.
  • Method Details

    • getUserName

      String getUserName()
      Returns the username.
      Returns:
      the username
    • setUserName

      void setUserName(String newUserName)
      Sets the username. This username will be used for all PDUs sent with this context. The username corresponds to the 'msgUserName' in SNMP-USER-BASED-SM-MIB. The default value is "initial".
      Parameters:
      newUserName - The new username
    • isUseAuthentication

      boolean isUseAuthentication()
      Returns if authentication is used or not. By default no authentication will be used.
      Returns:
      true if authentication is used, false if not
    • setUseAuthentication

      void setUseAuthentication(boolean newUseAuthentication)
      Sets whether authentication has to be used. By default no authentication will be used.
      Parameters:
      newUseAuthentication - The use of authentication
    • getUserAuthenticationPassword

      String getUserAuthenticationPassword()
      Returns the user authentication password. This password will be transformed into the user authentication secret key.
      Returns:
      The user authentication password
    • setUserAuthenticationPassword

      void setUserAuthenticationPassword(String newUserAuthPassword) throws IllegalArgumentException
      Sets the user authentication password. This password will be transformed into the user authentication secret key. A user MUST set this password.
      Parameters:
      newUserAuthPassword - The user authentication password
      Throws:
      IllegalArgumentException
    • setAuthenticationProtocol

      void setAuthenticationProtocol(int protocol) throws IllegalArgumentException
      Sets the protocol to be used for authentication. This can either be MD5 or SHA-1. By default MD5 will be used.
      Parameters:
      protocol - The authentication protocol to be used
      Throws:
      IllegalArgumentException
      See Also:
    • getAuthenticationProtocol

      int getAuthenticationProtocol()
      Returns the protocol to be used for authentication. This can either be MD5 or SHA-1. By default MD5 will be used.
      Returns:
      The authentication protocol to be used
      See Also:
    • setPrivacyProtocol

      void setPrivacyProtocol(int protocol) throws IllegalArgumentException
      Sets the protocol to be used for privacy. This can either be DES or AES. By default DES will be used.
      Parameters:
      protocol - The privacy protocol to be used
      Throws:
      IllegalArgumentException
      See Also:
    • getPrivacyProtocol

      int getPrivacyProtocol()
      Returns the protocol to be used for privacy. This can either be DES or AES. By default DES will be used.
      Returns:
      The privacy protocol to be used
      See Also:
    • isUsePrivacy

      boolean isUsePrivacy()
      Returns if privacy is used or not. By default no privacy will be used.
      Returns:
      true if privacy is used, false if not
    • setUsePrivacy

      void setUsePrivacy(boolean newUsePrivacy)
      Sets whether privacy has to be used. By default no privacy will be used.
      Parameters:
      newUsePrivacy - The use of privacy
    • getUserPrivacyPassword

      String getUserPrivacyPassword()
      Returns the user privacy password. This password will be transformed into the user privacy secret key.
      Returns:
      The user privacy password
    • setUserPrivacyPassword

      void setUserPrivacyPassword(String newUserAuthPassword) throws IllegalArgumentException
      Sets the user privacy password. This password will be transformed into the user privacy secret key. A user MUST set this password.
      Parameters:
      newUserAuthPassword - The user privacy password
      Throws:
      IllegalArgumentException
    • setContextEngineId

      void setContextEngineId(byte[] newContextEngineId) throws IllegalArgumentException
      Sets the contextEngineID. See RFC 3411. A contextEngineID uniquely identifies an SNMP entity that may realize an instance of a context with a particular contextName.

      Note, when the stack is an authoritative engine, this parameter should equal the UsmAgent.getSnmpEngineId(). See the StackUsage documentation for an explanation.

      If the contextEngineID is of length zero, the encoder will use the (discovered) snmpEngineId.

      Parameters:
      newContextEngineId - The contextEngineID
      Throws:
      IllegalArgumentException
      See Also:
    • getContextEngineId

      byte[] getContextEngineId()
      Returns the contextEngineID.
      Returns:
      The contextEngineID
    • setContextName

      void setContextName(String newContextName)
      Sets the contextName. See RFC 3411. A contextName is used to name a context. Each contextName MUST be unique within an SNMP entity. By default this is "".
      Parameters:
      newContextName - The contextName
      See Also:
    • getContextName

      String getContextName()
      Returns the contextName.
      Returns:
      The contextName
    • addDiscoveryPdu

      boolean addDiscoveryPdu(DiscoveryPdu pdu) throws IOException, PduException
      Adds a discovery PDU. This is for internal use only and should NOT be called by the developer. This is called by the the PDU itself and is added to the interface to cover the different kind of Contexts.
      Parameters:
      pdu - the discovery PDU
      Returns:
      PDU is succesful added
      Throws:
      IOException
      PduException
    • encodeDiscoveryPacket

      byte[] encodeDiscoveryPacket(byte msg_type, int rId, int errstat, int errind, Enumeration ve, Object obj) throws IOException, EncodingException
      Encodes a discovery PDU. This is for internal use only and should NOT be called by the developer. This is called by the the PDU itself and is added to the interface to cover the different kind of Contexts.
      Returns:
      The encoded packet
      Throws:
      IOException
      EncodingException
    • setUsmAgent

      void setUsmAgent(UsmAgent agent)
      Sets the UsmAgent, needed when this stack is used as authoritative SNMP engine. This interface provides authentiation details, like its clock and its Engine ID.
      Parameters:
      agent - The USM authoritative interface
      Since:
      4_14
    • getUsmAgent

      UsmAgent getUsmAgent()
      Returns the UsmAgent.
      Since:
      4_14
      See Also: