mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-26 16:09:45 -05:00
5660f813f0
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
25 lines
518 B
Go
25 lines
518 B
Go
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.
|
|
func (k *staticKMS) GetDEK(ctx context.Context, dekID string, dekSize int) ([]byte, error) {
|
|
key := make([]byte, dekSize)
|
|
for i := range key {
|
|
key[i] = 0x41
|
|
}
|
|
return key, nil
|
|
}
|