edit

package
v0.0.33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptCipherDataKey added in v0.0.33

func DecryptCipherDataKey(kmsService kmsiface.KMSAPI, cipherDataKey []byte) (*[32]byte, error)

func FindKeyId

func FindKeyId(manifestPath string) (string, error)

func GenerateDataKey added in v0.0.33

func GenerateDataKey(kmsService kmsiface.KMSAPI, keyId string) (*[32]byte, []byte, error)

Types

type KeysLocation

type KeysLocation struct {
	TextLocation
	Key string
}

type Manifest

type Manifest []*Object

func NewManifest

func NewManifest(in io.Reader) (Manifest, error)

func (Manifest) CorrelateWith

func (m Manifest) CorrelateWith(origManifest Manifest) error

func (Manifest) Decrypt

func (m Manifest) Decrypt(kmsService kmsiface.KMSAPI) error

func (Manifest) Encrypt

func (m Manifest) Encrypt(kmsService kmsiface.KMSAPI, defaultKeyId string, forceKeyId bool, reEncrypt bool) error

func (Manifest) Serialize

func (m Manifest) Serialize(out io.Writer) error

type Object

type Object struct {
	// The original text as parsed by NewYAMLOrJSONDecoder.
	Raw []byte
	// The original object as decoded by UniversalDeserializer.
	Object runtime.Object
	Meta   metav1.Object

	// Tracking for the various stages of encryption and decryption.
	OrigEnc  *secretsv1beta1.EncryptedSecret
	OrigDec  *hacksecretsv1beta1.DecryptedSecret
	AfterDec *hacksecretsv1beta1.DecryptedSecret
	AfterEnc *secretsv1beta1.EncryptedSecret
	Kind     string
	Data     map[string]string

	// The KMS KeyId used for this object, if known. If nil, it might be a new
	// object.
	KeyId string

	// Byte coordinates for areas of the raw text we need to edit when re-serializing.
	KindLoc TextLocation
	DataLoc TextLocation
	KeyLocs []KeysLocation
}

func NewObject

func NewObject(raw []byte) (*Object, error)

func (*Object) Decrypt

func (o *Object) Decrypt(kmsService kmsiface.KMSAPI) error

func (*Object) Encrypt

func (o *Object) Encrypt(kmsService kmsiface.KMSAPI, defaultKeyId string, forceKeyId bool, reEncrypt bool) error

func (*Object) Serialize

func (o *Object) Serialize(out io.Writer) error

type Payload added in v0.0.33

type Payload struct {
	Key     []byte
	Nonce   *[nonceLength]byte
	Message []byte
}

type TextLocation

type TextLocation struct {
	Start int
	End   int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL