Documentation ¶
Index ¶
- Variables
- type Config
- type KeyInfo
- type KeyInfos
- type SecretsService
- type Service
- func (s *Service) DecryptPassphrase(ctx context.Context, keyID int, encryptedPassphrase []byte) ([]byte, error)
- func (s *Service) EncryptPassphrase(ctx context.Context, passphrase []byte) (_ []byte, keyID int, err error)
- func (s *Service) GenerateEncryptedPassphrase(ctx context.Context) (_ []byte, keyID int, err error)
- func (s *Service) Initialize(ctx context.Context) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MockChecksumMismatch can be used as a key info version to signal to mockGsmClient to return a checksum that does not match. MockChecksumMismatch = "mock-checksum-mismatch" // MockAccessSecretVersionError can be used as a key info version to signal to mockGsmClient to return an error from AccessSecretVersion method. MockAccessSecretVersionError = "mock-access-secret-version-error" // MockKeyNotFound can be used as a key info version to signal to mockGsmClient to return no payload data from AccessSecretVersion. MockKeyNotFound = "mock-key-not-found" )
View Source
var ( // Error is the default error class for the package. Error = errs.Class("kms") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { KeyInfos KeyInfos `help:"semicolon-separated key-id:version,checksum." default:""` DefaultMasterKey int `help:"the key ID to use for passphrase encryption." default:"1"` TestMasterKey string `` /* 193-byte string literal not displayed */ MockClient bool `` /* 132-byte string literal not displayed */ }
Config is a configuration struct for secret management Service.
type KeyInfos ¶ added in v1.108.1
KeyInfos is a map of key IDs to key infos.
type SecretsService ¶
type SecretsService interface { // GetKey gets a key from the secret service. GetKey(ctx context.Context, keyInfo KeyInfo) (*storj.Key, error) // Close closes the service. Close() error }
SecretsService is a service for retrieving keys.
architecture: Service
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a service for encrypting/decrypting project passphrases.
architecture: Service
func (*Service) DecryptPassphrase ¶
func (s *Service) DecryptPassphrase(ctx context.Context, keyID int, encryptedPassphrase []byte) ([]byte, error)
DecryptPassphrase decrypts the provided encrypted passphrase using the masterKey.
func (*Service) EncryptPassphrase ¶
func (s *Service) EncryptPassphrase(ctx context.Context, passphrase []byte) (_ []byte, keyID int, err error)
EncryptPassphrase encrypts the provided passphrase using the masterKey in an XSalsa20 and Poly1305 encryption.
func (*Service) GenerateEncryptedPassphrase ¶
GenerateEncryptedPassphrase generates a cryptographically random passphrase, returning its encrypted form and the id of the encryption key.
Click to show internal directories.
Click to hide internal directories.