Documentation
¶
Index ¶
- func ECDSAPrivateKeyToPrivKey(privateKey *ecdsa.PrivateKey) crypto.PrivKey
- func Ed25519PrivateKeyToPrivKey(privateKey *ed25519.PrivateKey) crypto.PrivKey
- func PrivKeyToECDSAPrivateKey(privKey crypto.PrivKey) *ecdsa.PrivateKey
- func PrivKeyToEd25519PrivateKey(privKey crypto.PrivKey) *ed25519.PrivateKey
- func PrivKeyToRSAPrivateKey(privKey crypto.PrivKey) *rsa.PrivateKey
- func RSAPrivateKeyToPrivKey(privateKey *rsa.PrivateKey) crypto.PrivKey
- type Keystore
- func (ks *Keystore) Close() error
- func (ks *Keystore) Delete(s string) error
- func (ks *Keystore) Export(path string) error
- func (ks *Keystore) Get(s string) (ci.PrivKey, error)
- func (ks *Keystore) Has(s string) (bool, error)
- func (ks *Keystore) List() ([]string, error)
- func (ks *Keystore) Open() error
- func (ks *Keystore) Put(s string, key ci.PrivKey) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ECDSAPrivateKeyToPrivKey ¶
func ECDSAPrivateKeyToPrivKey(privateKey *ecdsa.PrivateKey) crypto.PrivKey
ECDSAPrivateKeyToPrivKey converts standard library ecdsa private keys to libp2p/go-libp2p-core/crypto private keys.
func Ed25519PrivateKeyToPrivKey ¶
func Ed25519PrivateKeyToPrivKey(privateKey *ed25519.PrivateKey) crypto.PrivKey
Ed25519PrivateKeyToPrivKey converts ed25519 private keys to libp2p/go-libp2p-core/crypto private keys.
func PrivKeyToECDSAPrivateKey ¶
func PrivKeyToECDSAPrivateKey(privKey crypto.PrivKey) *ecdsa.PrivateKey
PrivKeyToECDSAPrivateKey converts libp2p/go-libp2p-core/crypto private keys to new standard library ecdsa private keys.
func PrivKeyToEd25519PrivateKey ¶
func PrivKeyToEd25519PrivateKey(privKey crypto.PrivKey) *ed25519.PrivateKey
PrivKeyToEd25519PrivateKey converts libp2p/go-libp2p-core/crypto private keys to ed25519 private keys.
func PrivKeyToRSAPrivateKey ¶
func PrivKeyToRSAPrivateKey(privKey crypto.PrivKey) *rsa.PrivateKey
PrivKeyToRSAPrivateKey converts libp2p/go-libp2p-core/crypto private keys to standard library rsa private keys.
func RSAPrivateKeyToPrivKey ¶
func RSAPrivateKeyToPrivKey(privateKey *rsa.PrivateKey) crypto.PrivKey
RSAPrivateKeyToPrivKey converts standard library rsa private keys to libp2p/go-libp2p-core/crypto private keys.
Types ¶
type Keystore ¶
type Keystore struct {
// contains filtered or unexported fields
}
Keystore is used to manage an encrypted IPFS-compliant keystore.
func NewKeystore ¶
func NewKeystore(store storage.Storage, opt ...chestnut.ChestOption) *Keystore
NewKeystore is used to create a new chestnut ipfs-compliant keystore. Suggest using using this with AES256-CTR encryption based in part on this helpful analysis from Shawn Wang, PostgreSQL Database Core: https://www.highgo.ca/2019/08/08/the-difference-in-five-modes-in-the-aes-encryption-algorithm/
func (*Keystore) Delete ¶
Delete removes a key from the Keystore
func (*Keystore) Get ¶
Get retrieves a key from the Keystore if it exists, and returns ErrNoSuchKey otherwise.
func (*Keystore) Has ¶
Has returns whether or not a key exists in the Keystore
func (*Keystore) List ¶
List returns a list of key identifier