p2pkey

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 17 Imported by: 37

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncryptedP2PKeyExport

type EncryptedP2PKeyExport struct {
	KeyType   string              `json:"keyType"`
	PublicKey string              `json:"publicKey"`
	PeerID    PeerID              `json:"peerID"`
	Crypto    keystore.CryptoJSON `json:"crypto"`
}

func (EncryptedP2PKeyExport) GetCrypto

type KeyV2

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

func FromEncryptedJSON

func FromEncryptedJSON(keyJSON []byte, password string) (KeyV2, error)

func KeyFor

func KeyFor(raw internal.Raw) KeyV2

func MustNewV2XXXTestingOnly

func MustNewV2XXXTestingOnly(k *big.Int) KeyV2

func NewV2

func NewV2() (KeyV2, error)

func (KeyV2) ID

func (key KeyV2) ID() string

func (KeyV2) PeerID

func (key KeyV2) PeerID() PeerID

func (KeyV2) Public

func (key KeyV2) Public() crypto.PublicKey

func (KeyV2) PublicKeyHex

func (key KeyV2) PublicKeyHex() string

func (KeyV2) Raw

func (key KeyV2) Raw() internal.Raw

func (KeyV2) Sign

func (key KeyV2) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error)

func (KeyV2) ToEncryptedJSON

func (key KeyV2) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error)

type PeerID

type PeerID types.PeerID

func MakePeerID

func MakePeerID(s string) (PeerID, error)

func (PeerID) MarshalJSON

func (p PeerID) MarshalJSON() ([]byte, error)

func (*PeerID) MarshalText

func (p *PeerID) MarshalText() ([]byte, error)

func (PeerID) Raw

func (p PeerID) Raw() string

func (*PeerID) Scan

func (p *PeerID) Scan(value any) error

func (PeerID) String

func (p PeerID) String() string

func (*PeerID) UnmarshalJSON

func (p *PeerID) UnmarshalJSON(input []byte) error

func (*PeerID) UnmarshalString

func (p *PeerID) UnmarshalString(s string) error

func (*PeerID) UnmarshalText

func (p *PeerID) UnmarshalText(bs []byte) error

func (PeerID) Value

func (p PeerID) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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