• Home
  • Tutorials
  • API Documentation
  • Asset Store
  • SuperNet.Netcode.Crypto
  • CryptoECDH
Show / Hide Table of Contents
  • SuperNet.Netcode.Compress
    • CompressorDeflate
    • CompressorLZF
    • ICompressor
  • SuperNet.Netcode.Crypto
    • CryptoAES
    • CryptoECDH
    • CryptoRandom
    • CryptoRSA
    • Curve25519
    • ICryptoAuthenticator
    • ICryptoEncryptor
    • ICryptoExchanger
    • ICryptoRandom
  • SuperNet.Netcode.Transport
    • ConnectionRequest
    • DisconnectReason
    • Host
    • HostConfig
    • HostEvents
    • HostStatistics
    • HostTimespan
    • HostTimestamp
    • IHostListener
    • IMessage
    • IMessageListener
    • IPeerListener
    • MessageEvents
    • MessageReceived
    • MessageSent
    • Peer
    • PeerConfig
    • PeerEvents
    • PeerStatistics
  • SuperNet.Netcode.Util
    • Allocator
    • ArrayPool<T>
    • CRC32
    • IPComparer
    • IPResolver
    • IWritable
    • ObjectPool<T>
    • Reader
    • Serializer
    • Writer
  • SuperNet.Unity.Components
    • INetworkAuthoritative
    • INetworkRegisterable
    • INetworkRollbackable
    • NetworkAnimation
    • NetworkAnimator
    • NetworkAuthority
    • NetworkPrefab
    • NetworkRegistrar
    • NetworkSpawner
    • NetworkSyncModeMethod
    • NetworkSyncModeVector2
    • NetworkSyncModeVector3
    • NetworkTransform
  • SuperNet.Unity.Core
    • NetworkComponent
    • NetworkHost
    • NetworkIdentity
    • NetworkIdentityExtensions
    • NetworkManager
  • SuperNet.Unity.Editor
    • NetworkAuthorityEditor
    • NetworkHostEditor
    • NetworkHostEditor.BandwithUnit
    • NetworkIdentityDrawer
    • NetworkManagerEditor
    • NetworkPrefabEditor
    • NetworkSpawnerEditor

Class CryptoECDH

Implements Elliptic Curve Diffie Hellman key exchange.

Inheritance
System.Object
CryptoECDH
Implements
ICryptoExchanger
IDisposable
Namespace: SuperNet.Netcode.Crypto
Assembly: cs.temp.dll.dll
Syntax
public sealed class CryptoECDH : ICryptoExchanger, IDisposable

Constructors

CryptoECDH(ICryptoRandom, Allocator)

Create a new ECDH key pair for key exchange.

Declaration
public CryptoECDH(ICryptoRandom random, Allocator allocator)
Parameters
Type Name Description
ICryptoRandom random

Random number generator to use for generating keys.

Allocator allocator

Allocator to use for allocating keys.

Fields

KeyLength

Size of exchange key in bytes. For ECDH this is 32.

Declaration
public const int KeyLength = 32
Field Value
Type Description
System.Int32

Methods

DeriveEncryptor(ArraySegment<Byte>)

Generate a shared encryptor.

Declaration
public ICryptoEncryptor DeriveEncryptor(ArraySegment<byte> remoteKey)
Parameters
Type Name Description
ArraySegment<System.Byte> remoteKey

Received remote exchange key.

Returns
Type Description
ICryptoEncryptor

Shared encryptor that is guaranteed to be the same on both peers.

Dispose()

Returns key pair back to the allocator.

Declaration
public void Dispose()

ExportKey(ArraySegment<Byte>)

Copy exchange key to the output.

Declaration
public void ExportKey(ArraySegment<byte> output)
Parameters
Type Name Description
ArraySegment<System.Byte> output

Output to write to.

Explicit Interface Implementations

ICryptoExchanger.KeyLength

Size of exchange key in bytes. For ECDH this is 32.

Declaration
int ICryptoExchanger.KeyLength { get; }
Returns
Type Description
System.Int32

Implements

ICryptoExchanger
IDisposable
In This Article
  • Constructors
    • CryptoECDH(ICryptoRandom, Allocator)
  • Fields
    • KeyLength
  • Methods
    • DeriveEncryptor(ArraySegment<Byte>)
    • Dispose()
    • ExportKey(ArraySegment<Byte>)
  • Explicit Interface Implementations
    • ICryptoExchanger.KeyLength
  • Implements
Back to top Generated by DocFX