Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyPair ¶
type KeyPair struct { PublicKey crypto.PublicKey `json:"pubkey"` PrivKeyArmor string `json:"privkey.armor"` }
KeyPair is the public information about a locally stored key
func NewKeyPair ¶
NewKeyPair with the given public key and priv armor key
func (KeyPair) GetAddress ¶
GetAddress for the given KeyPair
type Keybase ¶
type Keybase interface { // CRUD on the keystore List() ([]KeyPair, error) Get(address types.Address) (KeyPair, error) Delete(address types.Address, passphrase string) error Update(address types.Address, oldpass string, newpass string) error GetCoinbase() (KeyPair, error) SetCoinbase(address types.Address) error // Sign some bytes, looking up the private key to use Sign(address types.Address, passphrase string, msg []byte) ([]byte, crypto.PublicKey, error) // Create a new KeyPair and encrypt it to disk using encryptPassphrase Create(encryptPassphrase string) (KeyPair, error) // ImportPrivKey using Armored private key string. Decrypts armor with decryptPassphrase, and stores locally using encryptPassphrase ImportPrivKey(armor, decryptPassphrase, encryptPassphrase string) (KeyPair, error) // ExportPrivKeyArmor using Armored private key string. Decrypts armor with decryptPassphrase, and encrypts result armor using the encryptPassphrase ExportPrivKeyEncryptedArmor(address types.Address, decryptPassphrase, encryptPassphrase string) (armor string, err error) // ImportPrivateKeyObject using the raw unencrypted privateKey string and encrypts it to disk using encryptPassphrase ImportPrivateKeyObject(privateKey [64]byte, encryptPassphrase string) (KeyPair, error) // ExportPrivateKeyObject exports raw PrivKey object. ExportPrivateKeyObject(address types.Address, passphrase string) (crypto.PrivateKey, error) // CloseDB closes the database. CloseDB() }
Keybase exposes operations on a generic keystore Keybase only supports Ed25519 key pairs Optimization: Merge Keybase interface with LazyKeybase and Keybase impl into a single type
func NewInMemory ¶
func NewInMemory() Keybase
NewInMemory creates a transient keybase on top of in-memory storage instance useful for testing purposes and on-the-fly key generation.
type SigningAlgo ¶
type SigningAlgo string
SigningAlgo defines an algorithm to derive key-pairs which can be used for cryptographic signing.
Click to show internal directories.
Click to hide internal directories.