2022-03-22 11:03:15 -04:00
|
|
|
package kms
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
)
|
|
|
|
|
|
|
|
// staticKMS is a KMS only returning keys containing of 0x41 bytes for every request.
|
|
|
|
// Use for testing ONLY.
|
|
|
|
type staticKMS struct{}
|
|
|
|
|
|
|
|
// NewStaticKMS creates a new StaticKMS.
|
|
|
|
// Use for testing ONLY.
|
|
|
|
func NewStaticKMS() *staticKMS {
|
|
|
|
return &staticKMS{}
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetDEK returns the key of staticKMS.
|
2022-03-24 10:21:19 -04:00
|
|
|
func (k *staticKMS) GetDEK(ctx context.Context, dekID string, dekSize int) ([]byte, error) {
|
2022-03-22 11:03:15 -04:00
|
|
|
key := make([]byte, dekSize)
|
|
|
|
for i := range key {
|
|
|
|
key[i] = 0x41
|
|
|
|
}
|
|
|
|
return key, nil
|
|
|
|
}
|