Photon Server API Documentation v5.0RC1

Public Member Functions | Properties | List of all members
Photon.SocketServer.Security.DiffieHellmanKeyExchange Class Reference

An implementation of the Diffie–Hellman key exchange. Diffie–Hellman establishes a shared secret that can be used for secret communications by exchanging data over a public network. More...

Inherits Photon.SocketServer.Security.IDiffieHellmanKeyExchange.

Public Member Functions

 DiffieHellmanKeyExchange ()
 Initializes a new instance of the DiffieHellmanKeyExchange class. More...
 
bool DeriveSharedKey (byte[] otherPartyPublicKey)
 Derives the shared key. More...
 
ICryptoProvider GetCryptoProvider (EncryptionMethod method=EncryptionMethod.Sha256Pkcs7)
 
void ExchangeKeys (PeerBase peer, byte[] otherPartyPublicKey)
 
void Dispose ()
 

Properties

byte[] PublicKey [get]
 Gets the public key which can be used by the other party to derive the shared key. More...
 
byte[] SharedKey [get]
 Gets the shared key that which can be used as the key for cryptographic operations. More...
 

Detailed Description

An implementation of the Diffie–Hellman key exchange. Diffie–Hellman establishes a shared secret that can be used for secret communications by exchanging data over a public network.

Constructor & Destructor Documentation

◆ DiffieHellmanKeyExchange()

Photon.SocketServer.Security.DiffieHellmanKeyExchange.DiffieHellmanKeyExchange ( )
inline

Initializes a new instance of the DiffieHellmanKeyExchange class.

Member Function Documentation

◆ DeriveSharedKey()

bool Photon.SocketServer.Security.DiffieHellmanKeyExchange.DeriveSharedKey ( byte[]  otherPartyPublicKey)
inline

Derives the shared key.

Parameters
otherPartyPublicKeyThe others party public key.

◆ Dispose()

void Photon.SocketServer.Security.DiffieHellmanKeyExchange.Dispose ( )
inline

◆ ExchangeKeys()

void Photon.SocketServer.Security.DiffieHellmanKeyExchange.ExchangeKeys ( PeerBase  peer,
byte[]  otherPartyPublicKey 
)
inline

◆ GetCryptoProvider()

ICryptoProvider Photon.SocketServer.Security.DiffieHellmanKeyExchange.GetCryptoProvider ( EncryptionMethod  method = EncryptionMethod.Sha256Pkcs7)
inline

Property Documentation

◆ PublicKey

byte [] Photon.SocketServer.Security.DiffieHellmanKeyExchange.PublicKey
get

Gets the public key which can be used by the other party to derive the shared key.

◆ SharedKey

byte [] Photon.SocketServer.Security.DiffieHellmanKeyExchange.SharedKey
get

Gets the shared key that which can be used as the key for cryptographic operations.