Documentation ¶
Index ¶
- Constants
- func Decrypt(contents []byte) ([]byte, error)
- func Encrypt(contents []byte) ([]byte, error)
- func FormatASTFile(file *ast.File) ([]byte, error)
- func Read(url string) ([]byte, error)
- type AwsKeyService
- type DevKeyService
- type EncryptionKey
- type Header
- type KeyService
- type ServiceParams
- type Wrapper
Constants ¶
const ( // A256GCM identifies the encryption algorithm A256GCM = "A256GCM" // B5JWKJSON identifies content type B5JWKJSON = "b5+jwk+json" )
Variables ¶
This section is empty.
Functions ¶
func FormatASTFile ¶
FormatASTFile returns formatted text representation of the file
Types ¶
type AwsKeyService ¶
type AwsKeyService struct {
// contains filtered or unexported fields
}
AwsKeyService represents connection to Amazon Web Services KMS
func NewAwsKeyService ¶
func NewAwsKeyService(region string, masterKeyID string) *AwsKeyService
NewAwsKeyService creates a new AwsKeyService in given AWS region and with the given masterKey identifier.
func (*AwsKeyService) DecryptKey ¶
func (s *AwsKeyService) DecryptKey(key *EncryptionKey) error
DecryptKey decrypts an existing ServerKey.
func (*AwsKeyService) GenerateKey ¶
func (s *AwsKeyService) GenerateKey(kid string) (*EncryptionKey, error)
GenerateKey generates a brand new ServerKey.
type DevKeyService ¶
type DevKeyService struct {
// contains filtered or unexported fields
}
DevKeyService contains DevKeyService information
func NewDevKeyService ¶
func NewDevKeyService() *DevKeyService
NewDevKeyService returns an empty DevKeyService object
func (*DevKeyService) DecryptKey ¶
func (s *DevKeyService) DecryptKey(key *EncryptionKey) error
DecryptKey decrypts the dev key
func (*DevKeyService) GenerateKey ¶
func (s *DevKeyService) GenerateKey(kid string) (*EncryptionKey, error)
GenerateKey generates a new server key
type EncryptionKey ¶
type EncryptionKey struct { KID string `json:"kid"` Enc string `json:"enc"` EncKey string `json:"encKey"` RawKey []byte `json:"-"` }
EncryptionKey contians server key information
type Header ¶
type Header struct { Encrypted bool Key string Service ServiceParams Protect []string Include []string }
Header is a special entry in the .hcl file that defines encryption parameters
type KeyService ¶
type KeyService interface { GenerateKey(kid string) (*EncryptionKey, error) DecryptKey(key *EncryptionKey) error }
KeyService defines key methods
type ServiceParams ¶
ServiceParams is a part of the header entry with crypto service type and parameters