Class

spinoco.protocol.stun.StunAttribute

MessageIntegrity

Related Doc: package StunAttribute

Permalink

case class MessageIntegrity(hash: ByteVector) extends StunAttribute with Product with Serializable

The MESSAGE-INTEGRITY attribute contains an HMAC-SHA1 [RFC2104] of the STUN message. The MESSAGE-INTEGRITY attribute can be present in any STUN message type. Since it uses the SHA1 hash, the HMAC will be 20 bytes. The text used as input to HMAC is the STUN message, including the header, up to and including the attribute preceding the MESSAGE-INTEGRITY attribute. With the exception of the FINGERPRINT attribute, which appears after MESSAGE-INTEGRITY, agents MUST ignore all other attributes that follow MESSAGE-INTEGRITY.

https://tools.ietf.org/html/rfc5389#section-15.4

hash

The key for the HMAC depends on whether long-term or short-term credentials are in use. For long-term credentials, the key is 16 bytes: key = MD5(username ":" realm ":" SASLprep(password)) That is, the 16-byte key is formed by taking the MD5 hash of the result of concatenating the following five fields: (1) the username, with any quotes and trailing nulls removed, as taken from the USERNAME attribute (in which case SASLprep has already been applied); (2) a single colon; (3) the realm, with any quotes and trailing nulls removed; (4) a single colon; and (5) the password, with any trailing nulls removed and after processing using SASLprep. For example, if the username was 'user', the realm was 'realm', and the password was 'pass', then the 16-byte HMAC key would be the result of performing an MD5 hash on the string 'user:realm:pass', the resulting hash being 0x8493fbc53ba582fb4c044c456bdc40eb. For short-term credentials: key = SASLprep(password) where MD5 is defined in RFC 1321 [RFC1321] and SASLprep() is defined in RFC 4013 [RFC4013].

Source
StunAttribute.scala
Linear Supertypes
Serializable, Serializable, Product, Equals, StunAttribute, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MessageIntegrity
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. StunAttribute
  7. AnyRef
  8. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MessageIntegrity(hash: ByteVector)

    Permalink

    hash

    The key for the HMAC depends on whether long-term or short-term credentials are in use. For long-term credentials, the key is 16 bytes: key = MD5(username ":" realm ":" SASLprep(password)) That is, the 16-byte key is formed by taking the MD5 hash of the result of concatenating the following five fields: (1) the username, with any quotes and trailing nulls removed, as taken from the USERNAME attribute (in which case SASLprep has already been applied); (2) a single colon; (3) the realm, with any quotes and trailing nulls removed; (4) a single colon; and (5) the password, with any trailing nulls removed and after processing using SASLprep. For example, if the username was 'user', the realm was 'realm', and the password was 'pass', then the 16-byte HMAC key would be the result of performing an MD5 hash on the string 'user:realm:pass', the resulting hash being 0x8493fbc53ba582fb4c044c456bdc40eb. For short-term credentials: key = SASLprep(password) where MD5 is defined in RFC 1321 [RFC1321] and SASLprep() is defined in RFC 4013 [RFC4013].

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from MessageIntegrity to any2stringadd[MessageIntegrity] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (MessageIntegrity, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from MessageIntegrity to ArrowAssoc[MessageIntegrity] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (MessageIntegrity) ⇒ Boolean, msg: ⇒ Any): MessageIntegrity

    Permalink
    Implicit information
    This member is added by an implicit conversion from MessageIntegrity to Ensuring[MessageIntegrity] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (MessageIntegrity) ⇒ Boolean): MessageIntegrity

    Permalink
    Implicit information
    This member is added by an implicit conversion from MessageIntegrity to Ensuring[MessageIntegrity] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ Any): MessageIntegrity

    Permalink
    Implicit information
    This member is added by an implicit conversion from MessageIntegrity to Ensuring[MessageIntegrity] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): MessageIntegrity

    Permalink
    Implicit information
    This member is added by an implicit conversion from MessageIntegrity to Ensuring[MessageIntegrity] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from MessageIntegrity to StringFormat[MessageIntegrity] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. val hash: ByteVector

    Permalink

    The key for the HMAC depends on whether long-term or short-term credentials are in use.

    The key for the HMAC depends on whether long-term or short-term credentials are in use. For long-term credentials, the key is 16 bytes: key = MD5(username ":" realm ":" SASLprep(password)) That is, the 16-byte key is formed by taking the MD5 hash of the result of concatenating the following five fields: (1) the username, with any quotes and trailing nulls removed, as taken from the USERNAME attribute (in which case SASLprep has already been applied); (2) a single colon; (3) the realm, with any quotes and trailing nulls removed; (4) a single colon; and (5) the password, with any trailing nulls removed and after processing using SASLprep. For example, if the username was 'user', the realm was 'realm', and the password was 'pass', then the 16-byte HMAC key would be the result of performing an MD5 hash on the string 'user:realm:pass', the resulting hash being 0x8493fbc53ba582fb4c044c456bdc40eb. For short-term credentials: key = SASLprep(password) where MD5 is defined in RFC 1321 [RFC1321] and SASLprep() is defined in RFC 4013 [RFC4013].

  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  22. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. def [B](y: B): (MessageIntegrity, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from MessageIntegrity to ArrowAssoc[MessageIntegrity] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from StunAttribute

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from MessageIntegrity to any2stringadd[MessageIntegrity]

Inherited by implicit conversion StringFormat from MessageIntegrity to StringFormat[MessageIntegrity]

Inherited by implicit conversion Ensuring from MessageIntegrity to Ensuring[MessageIntegrity]

Inherited by implicit conversion ArrowAssoc from MessageIntegrity to ArrowAssoc[MessageIntegrity]

Ungrouped