external_interfaces

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2021 License: Apache-2.0 Imports: 7 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(
		useOAEP bool,
		publicKey *stdRsa.PublicKey,
		passphrase *passphrase.Passphrase,
	) (*passphrase.EncryptedPassphrase, error)
	Decrypt(
		kmsKeyID string,
		privateKey *stdRsa.PrivateKey,
		encryptedPassphrase *passphrase.EncryptedPassphrase,
	) (*passphrase.Passphrase, error)
}

type EncryptedPayloadService

type EncryptedPayloadService interface {
	Encrypt(useOAEP bool, publicKey *stdRsa.PublicKey, payload *payload.Payload) (*payload.EncryptedPayload, error)
	Decrypt(kmsKeyID string, 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.Parser
}

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)
	EncryptOAEP(hash hash.Hash, random io.Reader, pub *stdRsa.PublicKey, msg []byte, label []byte) ([]byte, error)
}

Jump to

Keyboard shortcuts

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