Versions in this module Expand all Collapse all v0 v0.1.0 Mar 28, 2021 Changes in this version + const SecretSize + var CannotSignError = errors.New("key cannot be used to sign") + var InvalidChecksumError = errors.New("checksum is invalid") + var InvalidEncodingError = errors.New("invalid key encoding") + var InvalidKeyPrefixError = errors.New("invalid key prefix byte") + var InvalidPublicKeyError = errors.New("invalid public key") + var InvalidSecretError = errors.New("invalid secret") + var InvalidSecretLengthError = errors.New("invalid secret size") + var InvalidSignatureError = errors.New("invalid signature") + var PublicKeyKnownOnlyError = errors.New("only public key is known") + func IsInvalidSignature(err error) bool + func IsKey(src []byte) bool + func IsPublicKey(src string) bool + type Key interface + PublicKey func() (string, error) + Reset func() + Secret func() (string, error) + Sign func(input []byte) ([]byte, error) + Verify func(input []byte, sig []byte) error + func FromPublicKey(public string) (Key, error) + func FromRawSecret(prefix KeyPrefix, rawSecret []byte) (Key, error) + func FromSecret(secret string) (Key, error) + func NewKey(prefix KeyPrefix) (Key, error) + type KeyPrefix byte + const PrivateKeyPrefix + const SecretKeyPrefix + const UnknownKeyPrefix + const UserKeyPrefix + func KeyType(src string) KeyPrefix + func (p KeyPrefix) String() string