Class EcdsaCrypto
Elliptic-curve-based cryptographic functions.
Inheritance
System.Object
EcdsaCrypto
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class EcdsaCrypto : object
Properties
DefaultNamedCurve
Gets or sets the default curve.
Declaration
public static EcdsaNamedCurve DefaultNamedCurve { get; set; }
Property Value
Type | Description |
---|---|
EcdsaNamedCurve |
Methods
CreateKey()
Creates an ECDSA key.
Declaration
public static EcdsaKey CreateKey()
Returns
Type | Description |
---|---|
EcdsaKey | An ECDSA key. |
CreateKey(EcdsaNamedCurve)
Creates an ECDSA key.
Declaration
public static EcdsaKey CreateKey(EcdsaNamedCurve namedCurve)
Parameters
Type | Name | Description |
---|---|---|
EcdsaNamedCurve | namedCurve | The named curve. |
Returns
Type | Description |
---|---|
EcdsaKey | An ECDSA key. |
Sign(Byte[], EcdsaKey)
Signs data using a specified key.
Declaration
public static byte[] Sign(byte[] data, EcdsaKey privateKey)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The data. |
EcdsaKey | privateKey | The private key. |
Returns
Type | Description |
---|---|
System.Byte[] | The output byte array. |
Verify(Byte[], Byte[], EcdsaKey)
Verifies a signature using a specified key and data.
Declaration
public static bool Verify(byte[] data, byte[] signature, EcdsaKey publicKey)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The data. |
System.Byte[] | signature | The input signature. |
EcdsaKey | publicKey | The public key. |
Returns
Type | Description |
---|---|
System.Boolean |
|