Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyProvider ¶
type KeyProvider struct {
// contains filtered or unexported fields
}
func NewFileKeyProvider ¶
func NewFileKeyProvider(ctx context.Context, path string) (*KeyProvider, error)
NewFileKeyProvider reads keys from a given filesystem path
func NewKeyProvider ¶
func NewKeyProvider(ctx context.Context) (*KeyProvider, error)
NewKeyProvider creates keys and holds them in-memory
func (*KeyProvider) GetPublicKey ¶
func (kp *KeyProvider) GetPublicKey() *ed25519.PublicKey
GetPublicKey returns the stored public key
func (*KeyProvider) GetPublicKeyHash ¶ added in v0.1.6
func (kp *KeyProvider) GetPublicKeyHash() string
GetPublicKeyHash returns the hash value of the stored public key
func (*KeyProvider) Sign ¶
func (kp *KeyProvider) Sign(message []byte) ([]byte, error)
Sign signs the given message with priv. Ed25519 performs two passes over messages to be signed and therefore cannot handle pre-hashed messages. Thus opts.HashFunc() must return zero to indicate the message hasn't been hashed. This can be achieved by passing crypto.Hash(0) as the value for opts.
func (*KeyProvider) ToString ¶
func (kp *KeyProvider) ToString() (string, error)
ToString returns the stored public key as a string
Click to show internal directories.
Click to hide internal directories.