mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
util: introduce VolumeEncryption type
Prepare for grouping encryption related functions together. The main rbdVolume object should not be cluttered with KMS or DEK procedures. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
aa52afff09
commit
d4076d6216
@ -51,6 +51,22 @@ const (
|
||||
defaultConfigMapToRead = "csi-kms-connection-details"
|
||||
)
|
||||
|
||||
type VolumeEncryption struct {
|
||||
KMS EncryptionKMS
|
||||
}
|
||||
|
||||
// NewVolumeEncryption creates a new instance of VolumeEncryption.
|
||||
func NewVolumeEncryption(kms EncryptionKMS) (*VolumeEncryption, error) {
|
||||
ve := &VolumeEncryption{KMS: kms}
|
||||
|
||||
return ve, nil
|
||||
}
|
||||
|
||||
// Destroy frees any resources that the VolumeEncryption instance allocated.
|
||||
func (ve *VolumeEncryption) Destroy() {
|
||||
ve.KMS.Destroy()
|
||||
}
|
||||
|
||||
// EncryptionKMS provides external Key Management System for encryption
|
||||
// passphrases storage.
|
||||
type EncryptionKMS interface {
|
||||
|
Reference in New Issue
Block a user