Header menu logo FSharp.ATProto

Keys Module

Key management for P-256 and secp256k1 curves.

Functions and values

Function or value Description

decompress key

Full Usage: decompress key

Parameters:
Returns: byte[]

Decompress a 33-byte compressed key to 65-byte uncompressed (0x04 + X + Y).

key : PublicKey
Returns: byte[]

generate algorithm

Full Usage: generate algorithm

Parameters:
Returns: KeyPair

Generate a new key pair for the given algorithm.

algorithm : Algorithm
Returns: KeyPair

importPrivateKey algorithm privateKeyBytes

Full Usage: importPrivateKey algorithm privateKeyBytes

Parameters:
    algorithm : Algorithm
    privateKeyBytes : byte[]

Returns: KeyPair

Import a private key from raw bytes.

algorithm : Algorithm
privateKeyBytes : byte[]
Returns: KeyPair

importPublicKey algorithm compressedBytes

Full Usage: importPublicKey algorithm compressedBytes

Parameters:
    algorithm : Algorithm
    compressedBytes : byte[]

Returns: Result<PublicKey, string>

Import a compressed public key (33 bytes).

algorithm : Algorithm
compressedBytes : byte[]
Returns: Result<PublicKey, string>

publicKey keyPair

Full Usage: publicKey keyPair

Parameters:
Returns: PublicKey

Get the public key from a key pair.

keyPair : KeyPair
Returns: PublicKey

Type something to start searching.