keystorev4

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: Apache-2.0 Imports: 13 Imported by: 129

README

go-eth2-wallet-encryptor-keystorev4

Tag License GoDoc Travis CI codecov.io Go Report Card

Keystore version 4-compliant encryptor for the Ethereum 2 wallet.

Table of Contents

Install

go-eth2-wallet-encryptor-keystorev4 is a standard Go module which can be installed with:

go get github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4

Usage

In normal operation this module should not be used directly. Instead, it should be configured to be used as part of go-eth2-wallet.

Maintainers

Jim McDonald: @mcdee.

Contribute

Contributions welcome. Please check out the issues.

License

Apache-2.0 © 2019 Weald Technology Trading Ltd

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encryptor

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

Encryptor is an encryptor that follows the Ethereum keystore V4 specification.

func New

func New(opts ...Option) *Encryptor

New creates a new keystore V4 encryptor. This takes the following options: - cipher: the cipher to use when encrypting the secret, can be either "pbkdf2" (default) or "scrypt"

func (*Encryptor) Decrypt

func (e *Encryptor) Decrypt(data map[string]interface{}, passphrase string) ([]byte, error)

Decrypt decrypts the data provided, returning the secret.

func (*Encryptor) Encrypt

func (e *Encryptor) Encrypt(secret []byte, passphrase string) (map[string]interface{}, error)

Encrypt encrypts data.

func (*Encryptor) Name

func (e *Encryptor) Name() string

Name returns the name of this encryptor

func (*Encryptor) Version

func (e *Encryptor) Version() uint

Version returns the version of this encryptor

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option gives options to New

func WithCipher

func WithCipher(cipher string) Option

WithCipher sets the cipher for the encryptor.

Jump to

Keyboard shortcuts

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