Documentation ¶
Index ¶
- func SortKeyEntries(entries []*KeyEntry)
- type Base
- func (m *Base) GenerateKey(ctx context.Context, req *keymanagerv1.GenerateKeyRequest) (*keymanagerv1.GenerateKeyResponse, error)
- func (m *Base) GetPublicKey(ctx context.Context, req *keymanagerv1.GetPublicKeyRequest) (*keymanagerv1.GetPublicKeyResponse, error)
- func (m *Base) GetPublicKeys(ctx context.Context, req *keymanagerv1.GetPublicKeysRequest) (*keymanagerv1.GetPublicKeysResponse, error)
- func (m *Base) SetEntries(entries []*KeyEntry)
- func (m *Base) SignData(ctx context.Context, req *keymanagerv1.SignDataRequest) (*keymanagerv1.SignDataResponse, error)
- type Funcs
- type KeyEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortKeyEntries ¶
func SortKeyEntries(entries []*KeyEntry)
Types ¶
type Base ¶
type Base struct { keymanagerv1.UnsafeKeyManagerServer // contains filtered or unexported fields }
Base is the base KeyManager implementation
func New ¶
New creates a new base key manager using the provided Funcs. Default implementations are provided for any that aren't set.
func (*Base) GenerateKey ¶
func (m *Base) GenerateKey(ctx context.Context, req *keymanagerv1.GenerateKeyRequest) (*keymanagerv1.GenerateKeyResponse, error)
GenerateKey implements the KeyManager RPC of the same name.
func (*Base) GetPublicKey ¶
func (m *Base) GetPublicKey(ctx context.Context, req *keymanagerv1.GetPublicKeyRequest) (*keymanagerv1.GetPublicKeyResponse, error)
GetPublicKey implements the KeyManager RPC of the same name.
func (*Base) GetPublicKeys ¶
func (m *Base) GetPublicKeys(ctx context.Context, req *keymanagerv1.GetPublicKeysRequest) (*keymanagerv1.GetPublicKeysResponse, error)
GetPublicKeys implements the KeyManager RPC of the same name.
func (*Base) SetEntries ¶
SetEntries is used to replace the set of managed entries. This is generally called by implementations when they are first loaded to set the initial set of entries.
func (*Base) SignData ¶
func (m *Base) SignData(ctx context.Context, req *keymanagerv1.SignDataRequest) (*keymanagerv1.SignDataResponse, error)
SignData implements the KeyManager RPC of the same name.
type Funcs ¶
type Funcs struct { WriteEntries func(ctx context.Context, allEntries []*KeyEntry, newEntry *KeyEntry) error GenerateRSA2048Key func() (*rsa.PrivateKey, error) GenerateRSA4096Key func() (*rsa.PrivateKey, error) GenerateEC256Key func() (*ecdsa.PrivateKey, error) GenerateEC384Key func() (*ecdsa.PrivateKey, error) }
Funcs is a collection of optional callbacks. Default implementations will be used when not provided.
type KeyEntry ¶
type KeyEntry struct { PrivateKey crypto.Signer *keymanagerv1.PublicKey }
KeyEntry is an entry maintained by the key manager
func MakeKeyEntryFromKey ¶
func MakeKeyEntryFromKey(id string, privateKey crypto.PrivateKey) (*KeyEntry, error)