Module org.snmp4j

Class UsmSecurityParameters

java.lang.Object
org.snmp4j.security.UsmSecurityParameters
All Implemented Interfaces:
BERSerializable, SecurityParameters

public class UsmSecurityParameters extends Object implements SecurityParameters
  • Constructor Details

  • Method Details

    • getAuthoritativeEngineID

      public byte[] getAuthoritativeEngineID()
    • setAuthoritativeEngineID

      public void setAuthoritativeEngineID(byte[] authoritativeEngineID)
    • setAuthoritativeEngineBoots

      public void setAuthoritativeEngineBoots(int authoritativeEngineBoots)
    • getAuthoritativeEngineBoots

      public int getAuthoritativeEngineBoots()
    • setAuthoritativeEngineTime

      public void setAuthoritativeEngineTime(int authoritativeEngineTime)
    • getAuthoritativeEngineTime

      public int getAuthoritativeEngineTime()
    • setUserName

      public void setUserName(OctetString userName)
    • getUserName

      public OctetString getUserName()
    • setAuthenticationProtocol

      public void setAuthenticationProtocol(AuthenticationProtocol authenticationProtocol)
    • getAuthenticationProtocol

      public AuthenticationProtocol getAuthenticationProtocol()
    • setPrivacyProtocol

      public void setPrivacyProtocol(PrivacyProtocol privacyProtocol)
    • getPrivacyProtocol

      public PrivacyProtocol getPrivacyProtocol()
    • getBERLength

      public int getBERLength()
      Description copied from interface: BERSerializable
      Returns the length of this BERSerializable object in bytes when encoded according to the Basic Encoding Rules (BER).
      Specified by:
      getBERLength in interface BERSerializable
      Returns:
      the BER encoded length of this variable.
    • getBERPayloadLength

      public int getBERPayloadLength()
      Description copied from interface: BERSerializable
      Returns the length of the payload of this BERSerializable object in bytes when encoded according to the Basic Encoding Rules (BER).
      Specified by:
      getBERPayloadLength in interface BERSerializable
      Returns:
      the BER encoded length of this variable.
    • decodeBER

      public void decodeBER(BERInputStream inputStream) throws IOException
      Description copied from interface: BERSerializable
      Decodes a Variable from an InputStream.
      Specified by:
      decodeBER in interface BERSerializable
      Parameters:
      inputStream - an InputStream containing a BER encoded byte stream.
      Throws:
      IOException - if the stream could not be decoded by using BER rules.
    • getSequencePosition

      public int getSequencePosition()
    • encodeBER

      public void encodeBER(OutputStream outputStream) throws IOException
      Description copied from interface: BERSerializable
      Encodes a Variable to an OutputStream.
      Specified by:
      encodeBER in interface BERSerializable
      Parameters:
      outputStream - an OutputStream.
      Throws:
      IOException - if an error occurs while writing to the stream.
    • getBERUsmPayloadLength

      public int getBERUsmPayloadLength()
      getBERUsmPayloadLength
      Returns:
      int
    • getBERMaxLength

      public int getBERMaxLength(int securityLevel)
      Description copied from interface: SecurityParameters
      Gets the maximum length of the BER encoded representation of this SecurityParameters instance.
      Specified by:
      getBERMaxLength in interface SecurityParameters
      Parameters:
      securityLevel - the security level to be used.
      Returns:
      the maximum BER encoded length in bytes.
    • getAuthenticationKey

      public byte[] getAuthenticationKey()
    • setAuthenticationKey

      public void setAuthenticationKey(byte[] authenticationKey)
    • getPrivacyKey

      public byte[] getPrivacyKey()
    • setPrivacyKey

      public void setPrivacyKey(byte[] privacyKey)
    • getPrivacyParameters

      public OctetString getPrivacyParameters()
    • setPrivacyParameters

      public void setPrivacyParameters(OctetString privacyParameters)
    • getAuthenticationParameters

      public OctetString getAuthenticationParameters()
    • setAuthenticationParameters

      public void setAuthenticationParameters(OctetString authenticationParameters)
    • getSecurityParametersPosition

      public int getSecurityParametersPosition()
      Description copied from interface: SecurityParameters
      Gets the byte position of the first byte (counted from zero) of the security parameters in the whole message.
      Specified by:
      getSecurityParametersPosition in interface SecurityParameters
      Returns:
      the position of the first byte (counted from zero) of the security parameters in the whole SNMP message. -1 is returned, when the position is unknown (not set).
    • setSecurityParametersPosition

      public void setSecurityParametersPosition(int securityParametersPosition)
      Description copied from interface: SecurityParameters
      Sets the position of the first byte (counted from zero) of the security parameters in the whole SNMP message.
      Specified by:
      setSecurityParametersPosition in interface SecurityParameters
      Parameters:
      securityParametersPosition - an integer value greater or equal than zero.
    • getAuthParametersPosition

      public int getAuthParametersPosition()
    • getScopedPduPosition

      public int getScopedPduPosition()
      getScopedPduPosition
      Returns:
      int