Casper.Network.SDK
Show / Hide Table of Contents

Class KeyPair

A Private key. Provides signing functionality.

Inheritance
System.Object
KeyPair
Namespace: Casper.Network.SDK.Types
Assembly: Casper.Network.SDK.dll
Syntax
public class KeyPair : object

Properties

PublicKey

Declaration
public PublicKey PublicKey { get; }
Property Value
Type Description
PublicKey

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
Type Description
KeyPair

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
Type Description
KeyPair

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
In This Article
Back to top Maintained by MAKE Technology LLC