keys

package
v0.0.0-...-9d09d82 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: BSD-3-Clause Imports: 5 Imported by: 1

Documentation

Overview

Package keys provides cryptographic key management primitives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	// contains filtered or unexported fields
}

func NewKeyFromMnemonic

func NewKeyFromMnemonic(mnemonic string) (*Key, error)

func NewKeyFromPrivKey

func NewKeyFromPrivKey(pkey types.PrivKey) (*Key, error)

func (*Key) Addr

func (k *Key) Addr() string

func (*Key) Alg

func (k *Key) Alg() string

func (*Key) DID

func (k *Key) DID() string

func (*Key) DIDKeyID

func (k *Key) DIDKeyID() string

func (*Key) PubKey

func (k *Key) PubKey() types.PubKey

func (*Key) Sign

func (k *Key) Sign(msg []byte) ([]byte, error)

type Keyring

type Keyring interface {
	Sign(msg []byte) ([]byte, error)
	PubKey() types.PubKey
	Alg() string
	// DID return the DID of the key.
	DID() string
	// DIDKeyID returns the DID key ID of the key.
	DIDKeyID() string
	// Addr returns the bech32 address of the key.
	Addr() string
}

Keyring defines the interface for a keyring that can sign messages.

Jump to

Keyboard shortcuts

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