Skip to main content
Version: 2.x

Class OdinCrypto

Wrapper class of OdinNative.Wrapper.Crypto for Unity.

This convenient class provides predefined encryption helper functions for Unity. If Peers do not have the same cipher they can not communicate with each other besides some events.

Assembly: cs.temp.dll.dll
Declaration
public class OdinCrypto : MonoBehaviour

Fields

InitialPassword

Initial cipher value

Declaration
public string InitialPassword

Methods

GetCryptoCipher()

Get handle to cipher

Declaration
public OdinCipherHandle GetCryptoCipher()
Returns

Odin.OdinCipherHandle: Handle or null### ChangePassword(string) Set a password for encryption. Peers with the same password can hear each other. null == unencrypted

Declaration
public bool ChangePassword(string password)
Returns

System.Boolean: false on failure

Parameters
TypeNameDescription
System.Stringpasswordchipher password

GetPeerStatus(int)

Get the encryption status of peer

Declaration
public bool GetPeerStatus(int peerId)
Returns

System.Boolean: true if encrypted or false

Parameters
TypeNameDescription
System.Int32peerIdpeer id to check

GetPeerStatus(OdinPeer)

Get the encryption status of peer

Declaration
public bool GetPeerStatus(OdinPeer peer)
Returns

System.Boolean: true if encrypted or false

Parameters
TypeNameDescription
OdinNative.Unity.OdinPeerpeerpeer to check