Documentation ¶
Index ¶
- Constants
- type AESSIVLayerBlockCipher
- func (bc *AESSIVLayerBlockCipher) Decrypt(encDataReader io.Reader, opt LayerBlockCipherOptions) (io.Reader, LayerBlockCipherOptions, error)
- func (bc *AESSIVLayerBlockCipher) Encrypt(plainDataReader io.Reader, opt LayerBlockCipherOptions) (io.Reader, LayerBlockCipherOptions, error)
- func (bc *AESSIVLayerBlockCipher) GenerateKey() []byte
- type LayerBlockCipher
- type LayerBlockCipherHandler
- type LayerBlockCipherOptions
- type LayerCipherType
Constants ¶
const ( AESSIVCMAC256 LayerCipherType = "AEAD_AES_SIV_CMAC_STREAM_256" AESSIVCMAC512 LayerCipherType = "AEAD_AES_SIV_CMAC_STREAM_512" CipherTypeOpt string = "type" )
TODO: Should be obtained from OCI spec once included
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AESSIVLayerBlockCipher ¶
type AESSIVLayerBlockCipher struct {
// contains filtered or unexported fields
}
AESSIVLayerBlockCipher implements the AES SIV block cipher
func (*AESSIVLayerBlockCipher) Decrypt ¶
func (bc *AESSIVLayerBlockCipher) Decrypt(encDataReader io.Reader, opt LayerBlockCipherOptions) (io.Reader, LayerBlockCipherOptions, error)
Decrypt takes in layer ciphertext data and returns the plaintext and relevant LayerBlockCipherOptions
func (*AESSIVLayerBlockCipher) Encrypt ¶
func (bc *AESSIVLayerBlockCipher) Encrypt(plainDataReader io.Reader, opt LayerBlockCipherOptions) (io.Reader, LayerBlockCipherOptions, error)
Encrypt takes in layer data and returns the ciphertext and relevant LayerBlockCipherOptions
func (*AESSIVLayerBlockCipher) GenerateKey ¶
func (bc *AESSIVLayerBlockCipher) GenerateKey() []byte
GenerateKey creates a synmmetric key
type LayerBlockCipher ¶
type LayerBlockCipher interface { // GenerateKey creates a symmetric key GenerateKey() []byte // Encrypt takes in layer data and returns the ciphertext and relevant LayerBlockCipherOptions Encrypt(layerDataReader io.Reader, opt LayerBlockCipherOptions) (io.Reader, LayerBlockCipherOptions, error) // Decrypt takes in layer ciphertext data and returns the plaintext and relevant LayerBlockCipherOptions Decrypt(layerDataReader io.Reader, opt LayerBlockCipherOptions) (io.Reader, LayerBlockCipherOptions, error) }
LayerBlockCipher returns a provider for encrypt/decrypt functionality for handling the layer data for a specific algorithm
func NewAESSIVLayerBlockCipher ¶
func NewAESSIVLayerBlockCipher(bits int) (LayerBlockCipher, error)
NewAESSIVLayerBlockCipher returns a new AES SIV block cipher of 256 or 512 bits
type LayerBlockCipherHandler ¶
type LayerBlockCipherHandler struct {
// contains filtered or unexported fields
}
LayerBlockCipherHandler is the handler for encrypt/decrypt for layers
func NewLayerBlockCipherHandler ¶
func NewLayerBlockCipherHandler() (*LayerBlockCipherHandler, error)
NewLayerBlockCipherHandler returns a new default handler
func (*LayerBlockCipherHandler) Decrypt ¶
func (h *LayerBlockCipherHandler) Decrypt(encDataReader io.Reader, opt LayerBlockCipherOptions) (io.Reader, LayerBlockCipherOptions, error)
Decrypt is the handler for the layer decryption routine
func (*LayerBlockCipherHandler) Encrypt ¶
func (h *LayerBlockCipherHandler) Encrypt(plainDataReader io.Reader, typ LayerCipherType) (io.Reader, LayerBlockCipherOptions, error)
Encrypt is the handler for the layer decryption routine
type LayerBlockCipherOptions ¶
type LayerBlockCipherOptions struct { // SymmetricKey represents the symmetric key used for encryption/decryption // This field should be populated by Encrypt/Decrypt calls SymmetricKey []byte `json:"symkey"` // Digest is the digest of the original data for verification. // This is NOT populated by Encrypt/Decrypt calls Digest digest.Digest `json:"digest"` // CipherOptions contains the cipher metadata used for encryption/decryption // This field should be populated by Encrypt/Decrypt calls CipherOptions map[string][]byte `json:"cipheroptions"` }
LayerBlockCipherOptions includes the information required to encrypt/decrypt an image
type LayerCipherType ¶
type LayerCipherType string
LayerCipherType is the ciphertype as specified in the layer metadata