Noble Connect
Add relays and punchthrough to Mirror or UNet
NobleConnect.Stun.Credentials Class Referenceabstract

Inherited by NobleConnect.Stun.ShortTermCredentials.

Public Member Functions

abstract void CalculateHashKey ()
 
virtual bool ValidateMessage (Message m, byte[] rawBytes)
 
abstract bool ValidateMessageCredentials (Message m)
 
abstract bool ValidateMessageIntegrity (Message m, byte[] rawBytes)
 
virtual void AddCredentialsToAttributes (List< Attribute > attributes)
 
abstract bool IsValid ()
 
virtual AttributeRaw GenerateMessageIntegrityAttribute (MessageHeader header, List< Attribute > attributes)
 
byte[] ComputeHash (BufferView bytesSoFar)
 Use HMACSHA1 along with the hash key and buffer data to generate the message integrity hash More...
 
byte[] ComputeHash (byte[] messageBytes, int offset=0, int length=-1)
 Use HMACSHA1 along with the hash key and buffer data to generate the message integrity hash More...
 

Public Attributes

AttributeString username
 The username is set via configuration on the Stun server and clients More...
 

Protected Attributes

byte[] hashKey
 This is used as the key to an HMACSHA1 hash of the message contents that is sent as the Value of a MessageIntegrity attribute. More...
 

Member Function Documentation

◆ AddCredentialsToAttributes()

virtual void NobleConnect.Stun.Credentials.AddCredentialsToAttributes ( List< Attribute attributes)
virtual

◆ CalculateHashKey()

abstract void NobleConnect.Stun.Credentials.CalculateHashKey ( )
pure virtual

◆ ComputeHash() [1/2]

byte [] NobleConnect.Stun.Credentials.ComputeHash ( BufferView  bytesSoFar)

Use HMACSHA1 along with the hash key and buffer data to generate the message integrity hash

Parameters
bytesSoFar
Returns

◆ ComputeHash() [2/2]

byte [] NobleConnect.Stun.Credentials.ComputeHash ( byte[]  messageBytes,
int  offset = 0,
int  length = -1 
)

Use HMACSHA1 along with the hash key and buffer data to generate the message integrity hash

Parameters
messageBytes
Returns

◆ GenerateMessageIntegrityAttribute()

virtual AttributeRaw NobleConnect.Stun.Credentials.GenerateMessageIntegrityAttribute ( MessageHeader  header,
List< Attribute attributes 
)
virtual

◆ IsValid()

abstract bool NobleConnect.Stun.Credentials.IsValid ( )
pure virtual

◆ ValidateMessage()

virtual bool NobleConnect.Stun.Credentials.ValidateMessage ( Message  m,
byte[]  rawBytes 
)
virtual

◆ ValidateMessageCredentials()

abstract bool NobleConnect.Stun.Credentials.ValidateMessageCredentials ( Message  m)
pure virtual

◆ ValidateMessageIntegrity()

abstract bool NobleConnect.Stun.Credentials.ValidateMessageIntegrity ( Message  m,
byte[]  rawBytes 
)
pure virtual

Member Data Documentation

◆ hashKey

byte [] NobleConnect.Stun.Credentials.hashKey
protected

This is used as the key to an HMACSHA1 hash of the message contents that is sent as the Value of a MessageIntegrity attribute.

◆ username

AttributeString NobleConnect.Stun.Credentials.username

The username is set via configuration on the Stun server and clients

The username may depend on the realm returned by the server