external_interfaces

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AesService

type AesService interface {
	EncryptCBC(key []byte, plaintext []byte) ([]byte, error)
	DecryptCBC(key []byte, ciphertext []byte) ([]byte, error)
	EncryptGCM(key []byte, plaintext []byte) ([]byte, error)
	DecryptGCM(key []byte, ciphertext []byte) ([]byte, error)
}

type Base64Service

type Base64Service interface {
	Serialize(raw []byte) ([]byte, error)
	Deserialize(encoded []byte) ([]byte, error)
}

type EncryptedContentService

type EncryptedContentService interface {
	Serialize(encryptedContent *content.EncryptedContent) ([]byte, error)
	Deserialize(encoded []byte) (*content.EncryptedContent, error)
	Encrypt(
		passphrase *passphrase.Passphrase,
		content *content.Content,
	) (*content.EncryptedContent, error)
	Decrypt(
		passphrase *passphrase.Passphrase,
		encryptedContent *content.EncryptedContent,
	) (*content.Content, error)
}

type EncryptedPassphraseService

type EncryptedPassphraseService interface {
	GeneratePassphrase(length int) (*passphrase.Passphrase, error)
	Serialize(encryptedPassphrase *passphrase.EncryptedPassphrase) ([]byte, error)
	Deserialize(encoded []byte) (*passphrase.EncryptedPassphrase, error)
	Encrypt(publicKey *stdRsa.PublicKey, passphrase *passphrase.Passphrase) (*passphrase.EncryptedPassphrase, error)
	Decrypt(
		privateKey *stdRsa.PrivateKey,
		encryptedPassphrase *passphrase.EncryptedPassphrase,
	) (*passphrase.Passphrase, error)
}

type EncryptedPayloadService

type EncryptedPayloadService interface {
	Encrypt(publicKey *stdRsa.PublicKey, payload *payload.Payload) (*payload.EncryptedPayload, error)
	Decrypt(privateKey *stdRsa.PrivateKey, encryptedPayload *payload.EncryptedPayload) (*payload.Payload, error)
	Serialize(encryptedPayload *payload.EncryptedPayload) ([]byte, error)
	Deserialize(encodedContent []byte) (*payload.EncryptedPayload, error)
}

type HclService

type HclService interface {
	hcl.Printer
	hcl.Parser
}

type IniService

type IniService interface {
	ReadIniAtPath(path string) (*goIni.File, error)
	ParseIniFileContents(file *goIni.File) *ini.Content
}

type RsaService

type RsaService interface {
	ReadPublicKeyFromPath(publicKeyPath string) (*stdRsa.PublicKey, error)
	ReadPrivateKeyFromPath(privateKeyPath string) (*stdRsa.PrivateKey, error)
	DecryptPKCS1v15(rand io.Reader, priv *stdRsa.PrivateKey, ciphertext []byte) ([]byte, error)
	EncryptPKCS1v15(rand io.Reader, pub *stdRsa.PublicKey, msg []byte) ([]byte, error)
}

type TerraformEncryptionMigrationService

type TerraformEncryptionMigrationService interface {
	ConvertIniContentToLegacyTerraformContent(
		passphraseLength int,
		iniContent *ini.Content,
		pubKey *stdRsa.PublicKey,
		encryptedPassphraseSvc terraform_encryption_migration.EncryptedPassphraseService,
		encryptedContentSvc terraform_encryption_migration.EncryptedContentService,
	) (*terraform.Content, error)
	ConvertIniContentToV1TerraformContent(
		passphraseLength int,
		iniContent *ini.Content,
		pubKey *stdRsa.PublicKey,
		encryptedPassphraseSvc terraform_encryption_migration.EncryptedPassphraseService,
		encryptedPayloadSvc terraform_encryption_migration.EncryptedPayloadService,
	) (*terraform.Content, error)
	MigrateEncryptedTerraformResourceHcl(
		hclParser hcl.Parser,
		hclBytes []byte,
		privKey *stdRsa.PrivateKey,
		pubKey *stdRsa.PublicKey,
		legacyEncryptedContentSvc terraform_encryption_migration.EncryptedContentService,
		encryptedPassphraseSvc terraform_encryption_migration.EncryptedPassphraseService,
		encryptedPayloadSvc terraform_encryption_migration.EncryptedPayloadService,
	) (*ast.File, error)
	RotateOrRekeyEncryptedTerraformResourceHcl(
		hclParser hcl.Parser,
		hclBytes []byte,
		privKey *stdRsa.PrivateKey,
		pubKey *stdRsa.PublicKey,
		encryptedPassphraseSvc terraform_encryption_migration.EncryptedPassphraseService,
		encryptedPayloadSvc terraform_encryption_migration.EncryptedPayloadService,
	) (*ast.File, error)
}

type TerraformService

type TerraformService interface {
	TerraformContentToHCLfile(hclParser hcl.Parser, terraformContent *terraform.Content) (*ast.File, error)
	WriteHCLfile(hclPrinter hcl.Printer, hclFile *ast.File, output io.Writer) error
	TerraformResourceToHCLfile(hclParser hcl.Parser, resource terraform.Resource) (*ast.File, error)
}

Jump to

Keyboard shortcuts

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