keys

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

View Source
const (
	PublicKeyLength = 32
)

Variables

This section is empty.

Functions

func PrivateKeyValidate

func PrivateKeyValidate(b []byte) (bool, *errors.Error)

func PublicKeyIsOnCurve

func PublicKeyIsOnCurve(b []byte) bool

func ValidateNineoraID

func ValidateNineoraID(idStr string) bool

Types

type Address

type Address string

func (Address) IsEmpty

func (addr Address) IsEmpty() bool

func (Address) PublicKey

func (addr Address) PublicKey() (PublicKey, *errors.Error)

func (Address) String

func (addr Address) String() string

type Key

type Key struct {
	Private PrivateKey `bson:"private" json:"private"`
	Public  PublicKey  `bson:"public" json:"public"`
	// contains filtered or unexported fields
}

func NewKey

func NewKey() (*Key, *errors.Error)

func (*Key) Address

func (k *Key) Address() Address

type NineoraID

type NineoraID string

func NineoraIdFromUint64

func NineoraIdFromUint64(idUint64 uint64) NineoraID

func (NineoraID) IsValid

func (n NineoraID) IsValid() bool

type PrivateKey

type PrivateKey []byte

func PrivateKeyFromBase58

func PrivateKeyFromBase58(pri string) (PrivateKey, *errors.Error)

func (PrivateKey) PublicKey

func (k PrivateKey) PublicKey() PublicKey

func (PrivateKey) Sign

func (k PrivateKey) Sign(payload []byte) (Signature, *errors.Error)

func (PrivateKey) ToBase58

func (k PrivateKey) ToBase58() string

func (PrivateKey) Validate

func (k PrivateKey) Validate() *errors.Error

type PublicKey

type PublicKey [PublicKeyLength]byte

func PublicKeyFromBase58

func PublicKeyFromBase58(in string) (out PublicKey, err *errors.Error)

func PublicKeyFromBytes

func PublicKeyFromBytes(in []byte) (out PublicKey, err *errors.Error)

func (PublicKey) Address

func (p PublicKey) Address() Address

func (PublicKey) ToBase58

func (p PublicKey) ToBase58() string

func (PublicKey) Verify

func (p PublicKey) Verify(message []byte, signature Signature) bool

type Signature

type Signature [64]byte

func (*Signature) HexEncode

func (s *Signature) HexEncode() SignatureBase58

type SignatureBase58

type SignatureBase58 string

func (*SignatureBase58) Decode

func (s *SignatureBase58) Decode() (*Signature, *errors.Error)

type Signer

type Signer struct {
	PrivateKey PrivateKey `bson:"private_key" json:"private_key"`
}

type Wallet

type Wallet struct {
	PrivateKey PrivateKey `bson:"private_key" json:"private_key"`
}

Jump to

Keyboard shortcuts

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