Class TsmSecurityParameters

All Implemented Interfaces:
Serializable, Cloneable, Comparable<Variable>, BERSerializable, SecurityParameters, AssignableFromByteArray, AssignableFromString, Variable

public class TsmSecurityParameters extends OctetString implements SecurityParameters
SecurityParameters implementation for the TSM security model.
Since:
2.0
Version:
2.0
Author:
Frank Fock
See Also:
  • Constructor Details

    • TsmSecurityParameters

      public TsmSecurityParameters()
  • Method Details

    • 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 pos)
      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:
      pos - an integer value greater or equal than zero.
    • 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.
    • decodeBER

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

      public int getScopedPduPosition()
      Gets the position of the ScopedPDU.
      Returns:
      the start position in the BERInputStream.