fm.liveswitch.EcdsaCrypto Class Reference

ECDSA-based cryptographic functions. More...

Static Public Member Functions

static EcdsaNamedCurve getDefaultNamedCurve ()
 Gets or sets the default curve. More...
 
static void setDefaultNamedCurve (EcdsaNamedCurve defaultNamedCurve)
 Gets or sets the default curve. More...
 
static EcdsaKey createKey ()
 Creates an ECDSA key. More...
 
static EcdsaKey createKey (EcdsaNamedCurve namedCurve)
 Creates an ECDSA key. More...
 
static byte[] sign (byte[] data, EcdsaKey privateKey)
 Signs data using a specified key. More...
 
static boolean verify (byte[] data, byte[] signature, EcdsaKey publicKey)
 Verifies a signature using a specified key and data. More...
 

Detailed Description

ECDSA-based cryptographic functions.

Member Function Documentation

◆ createKey() [1/2]

static EcdsaKey fm.liveswitch.EcdsaCrypto.createKey ( )
static

Creates an ECDSA key.

Returns
An ECDSA key.

◆ createKey() [2/2]

static EcdsaKey fm.liveswitch.EcdsaCrypto.createKey ( EcdsaNamedCurve  namedCurve)
static

Creates an ECDSA key.

Parameters
namedCurveThe named curve.
Returns
An ECDSA key.

◆ getDefaultNamedCurve()

static EcdsaNamedCurve fm.liveswitch.EcdsaCrypto.getDefaultNamedCurve ( )
static

Gets or sets the default curve.

◆ setDefaultNamedCurve()

static void fm.liveswitch.EcdsaCrypto.setDefaultNamedCurve ( EcdsaNamedCurve  defaultNamedCurve)
static

Gets or sets the default curve.

◆ sign()

static byte [] fm.liveswitch.EcdsaCrypto.sign ( byte[]  data,
EcdsaKey  privateKey 
)
static

Signs data using a specified key.

Parameters
dataThe data.
privateKeyThe private key.
Returns
The output byte array.

◆ verify()

static boolean fm.liveswitch.EcdsaCrypto.verify ( byte[]  data,
byte[]  signature,
EcdsaKey  publicKey 
)
static

Verifies a signature using a specified key and data.

Parameters
dataThe data.
signatureThe input signature.
publicKeyThe public key.
Returns
true if the signature is valid; otherwise, false.