crypto

package
v0.0.0-...-3674750 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncryptedPrivateKey

type EncryptedPrivateKey struct {
	keystore.CryptoJSON
}

func NewEncryptedPrivateKey

func NewEncryptedPrivateKey(data []byte, passphrase string, scryptParams utils.ScryptParams) (*EncryptedPrivateKey, error)

func (EncryptedPrivateKey) Decrypt

func (k EncryptedPrivateKey) Decrypt(passphrase string) (privkey []byte, err error)

Decrypt returns the PrivateKey decrypted via auth, or an error

func (*EncryptedPrivateKey) Scan

func (k *EncryptedPrivateKey) Scan(value interface{}) error

func (EncryptedPrivateKey) Value

func (k EncryptedPrivateKey) Value() (driver.Value, error)

type PublicKey

type PublicKey []byte

PublicKey defines a type which can be used for JSON and SQL.

func PublicKeyFromHex

func PublicKeyFromHex(hexStr string) (*PublicKey, error)

PublicKeyFromHex generates a public key from a hex string

func (PublicKey) MarshalJSON

func (k PublicKey) MarshalJSON() ([]byte, error)

func (*PublicKey) Scan

func (k *PublicKey) Scan(value interface{}) error

func (PublicKey) String

func (k PublicKey) String() string

func (*PublicKey) UnmarshalJSON

func (k *PublicKey) UnmarshalJSON(in []byte) error

func (PublicKey) Value

func (k PublicKey) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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