Class: Toybox.Cryptography.KeyPair

Overview

A public and private key pair.

See Also:

Since:

API Level 3.0.0

Supported Devices:

Instance Method Summary collapse

Instance Method Details

getPrivateKey() as Cryptography.Key

Get the private key.

Returns:

Since:

API Level 3.0.0

getPublicKey() as Cryptography.Key

Get the public key.

Returns:

Since:

API Level 3.0.0

initialize(options as { :algorithm as Cryptography.KeyPairAlgorithm, :privateKey as Lang.ByteArray })

Constructor

A KeyPair can be initialized from a private key by passing a private key ByteArray from an initialized Key object into the :privateKey option of the initialize method for this class. If no private key is provided, then both a private and public key will be generated using the required :algorithm option.

Note:

privateKey is expected to be in little-endian byte order.

Parameters:

Since:

API Level 3.0.0

Throws:


Generated Sep 23, 2024, 3:32:48 PM