Class KeyPair
A Private key. Provides signing functionality.
Inheritance
System.Object
KeyPair
Assembly: Casper.Network.SDK.dll
Syntax
public class KeyPair : object
Properties
PublicKey
Declaration
public PublicKey PublicKey { get; }
Property Value
Methods
CreateNew(KeyAlgo)
Creates a new key pair with the specified elliptic curve.
Declaration
public static KeyPair CreateNew(KeyAlgo keyAlgorithm)
Parameters
Type |
Name |
Description |
KeyAlgo |
keyAlgorithm |
|
Returns
FromPem(String)
Loads a key pair from a PEM file containing a private key.
Declaration
public static KeyPair FromPem(string filePath)
Parameters
Type |
Name |
Description |
System.String |
filePath |
|
Returns
Sign(Byte[])
Signs a message and returns the signature.
Declaration
public byte[] Sign(byte[] message)
Parameters
Type |
Name |
Description |
System.Byte[] |
message |
|
Returns
Type |
Description |
System.Byte[] |
|
WritePublicKeyToPem(String)
Saves the public key to a PEM file.
Declaration
public void WritePublicKeyToPem(string filePath)
Parameters
Type |
Name |
Description |
System.String |
filePath |
|
WriteToPem(String)
Saves the private key to a PEM file.
Declaration
public void WriteToPem(string filePath)
Parameters
Type |
Name |
Description |
System.String |
filePath |
|