Documentation ¶
Index ¶
Constants ¶
View Source
const PrivateKeyStoreKey = "private_key"
View Source
const PublicKeyStoreKey = "public_key"
Variables ¶
View Source
var (
ErrKeyPairNotFound = errors.New("No key pair found in the local db.")
)
Functions ¶
This section is empty.
Types ¶
type Keychain ¶
type Keychain struct {
// contains filtered or unexported fields
}
func (*Keychain) GenerateKeyPair ¶
Generates a public/private key pair using ed25519 algorithm. It stores it in the local db and returns the key pair key. If there's already a key pair stored, it returns an error. Use GenerateKeyPairWithForce if you want to override existing keys
func (*Keychain) GenerateKeyPairWithForce ¶
Generates a public/private key pair using ed25519 algorithm. It stores it in the local db and returns the key pair. Warning: If there's already a key pair stored, it overrides it.
func (*Keychain) GetStoredKeyPairInLibP2PFormat ¶
Returns the stored key pair using the same signature than libp2p's GenerateEd25519Key function
Click to show internal directories.
Click to hide internal directories.