crypto

package
v1.0.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2023 License: LGPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

The crypto package is used to provide functionality to several keypair types. The current supported types are secp256k1 and sr25519.

Keypairs

The keypair interface is used to bridge the different types of crypto formats. Every Keypair has both a Encode and Decode function that allows writing and reading from keystore files. There is also the Address and PublicKey functions that allow access to public facing fields.

Types

A general overview on the secp256k1 can be found here: https://en.bitcoin.it/wiki/Secp256k1 A general overview on the sr25519 type can be found here: https://wiki.polkadot.network/docs/en/learn-cryptography

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyType

type KeyType = string
const Secp256k1Type KeyType = "secp256k1"
const Sr25519Type KeyType = "sr25519"

type Keypair

type Keypair interface {
	// Encode is used to write the key to a file
	Encode() []byte
	// Decode is used to retrieve a key from a file
	Decode([]byte) error
	// Address provides the address for the keypair
	Address() string
	// PublicKey returns the keypair's public key an encoded a string
	PublicKey() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL