Interface ICryptoAuthenticator
Defines methods used for authenticating secure hosts.
Namespace: SuperNet.Netcode.Crypto
Assembly: cs.temp.dll.dll
Syntax
public interface ICryptoAuthenticator : IDisposable
Properties
SignatureLength
Number of bytes in the signature.
Declaration
int SignatureLength { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
ExportPrivateKey()
Export the current private key to a human readable format.
Declaration
string ExportPrivateKey()
Returns
Type | Description |
---|---|
System.String | Human readable private key |
ExportPublicKey()
Export the current public key to a human readable format.
Declaration
string ExportPublicKey()
Returns
Type | Description |
---|---|
System.String | Human readable public key. |
ImportPrivateKey(String)
Import private key.
Declaration
void ImportPrivateKey(string privateKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | privateKey | Private key to import. |
Sign(ArraySegment<Byte>, ArraySegment<Byte>)
Generate a signature that can be verified by the public key.
Declaration
void Sign(ArraySegment<byte> data, ArraySegment<byte> output)
Parameters
Type | Name | Description |
---|---|---|
ArraySegment<System.Byte> | data | Data to sign. |
ArraySegment<System.Byte> | output | Output to write signature to. |
Verify(ArraySegment<Byte>, ArraySegment<Byte>, String)
Verify signature.
Declaration
bool Verify(ArraySegment<byte> data, ArraySegment<byte> signature, string remotePublicKey)
Parameters
Type | Name | Description |
---|---|---|
ArraySegment<System.Byte> | data | Data that has been signed. |
ArraySegment<System.Byte> | signature | Signature that has been generated. |
System.String | remotePublicKey | Public key corresponding to the private key that signed the data. |
Returns
Type | Description |
---|---|
System.Boolean | True if verified, false if not. |