Documentation ¶
Index ¶
- func DecryptKey(serviceKey, encryptedKey []byte) ([]byte, error)
- func EncryptKey(serviceKey, key []byte) ([]byte, error)
- func GenerateServiceKey(skPassword string) (key, salt string, err error)
- type GetKeyDetailsRequest
- type GetKeyDetailsResponse
- type GetKeyRequest
- type GetKeyResponse
- type KeyDetails
- type Service
- func (s Service) Config() config.KeyStoreServiceConfig
- func (s Service) GetKey(request GetKeyRequest) (*GetKeyResponse, error)
- func (s Service) GetKeyDetails(request GetKeyDetailsRequest) (*GetKeyDetailsResponse, error)
- func (s Service) Status() framework.Status
- func (s Service) StoreKey(request StoreKeyRequest) error
- func (s Service) Type() framework.Type
- type ServiceKey
- type Storage
- type StoreKeyRequest
- type StoredKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptKey ¶
DecryptKey encrypts another key with the service key using xchacha20-poly1305
func EncryptKey ¶
EncryptKey encrypts another key with the service key using xchacha20-poly1305
func GenerateServiceKey ¶
GenerateServiceKey using argon2 for key derivation generate a service key and corresponding salt, base58 encoding both values.
Types ¶
type GetKeyDetailsRequest ¶
type GetKeyDetailsRequest struct {
ID string
}
type GetKeyDetailsResponse ¶
type GetKeyRequest ¶
type GetKeyRequest struct {
ID string
}
type GetKeyResponse ¶
type KeyDetails ¶
type KeyDetails struct { ID string `json:"id"` Controller string `json:"controller"` KeyType crypto.KeyType `json:"keyType"` CreatedAt string `json:"createdAt"` }
KeyDetails represents a common data model to get information about a key, without revealing the key itself
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewKeyStoreService ¶
func NewKeyStoreService(config config.KeyStoreServiceConfig, s storage.ServiceStorage) (*Service, error)
func (Service) Config ¶
func (s Service) Config() config.KeyStoreServiceConfig
func (Service) GetKey ¶
func (s Service) GetKey(request GetKeyRequest) (*GetKeyResponse, error)
func (Service) GetKeyDetails ¶
func (s Service) GetKeyDetails(request GetKeyDetailsRequest) (*GetKeyDetailsResponse, error)
func (Service) StoreKey ¶
func (s Service) StoreKey(request StoreKeyRequest) error
type ServiceKey ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewKeyStoreStorage ¶
func NewKeyStoreStorage(db storage.ServiceStorage, key ServiceKey) (*Storage, error)
func (*Storage) GetKeyDetails ¶
func (kss *Storage) GetKeyDetails(id string) (*KeyDetails, error)
type StoreKeyRequest ¶
Click to show internal directories.
Click to hide internal directories.