xor

package
v1.9.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

README

XOR-based dual-custody key provider

This key provider combines two keys to create a dual-custody encryption key using XOR. This provider is meant for testing purposes only.

[!WARNING] This file is not an end-user documentation, it is intended for developers. Please follow the user documentation on the OpenTofu website unless you want to work on the encryption code.

Configuration

You can configure the key provider as follows. Note, the input keys must have the same length.

terraform {
    encryption {
        key_provider "pbkdf2" "a" {
            passphrase = "This is passphrase 1"
        }
        key_provider "pbkdf2" "b" {
            passphrase = "This is passphrase 2"
        }
        key_provider "xor" "myprovider" {
            a = key_provider.pbkdf2.a
            b = key_provider.pbkdf2.b
        }
    }
}

Documentation

Overview

Package xor contains a key provider that combines two other keys.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	A keyprovider.Output `hcl:"a"`
	B keyprovider.Output `hcl:"b"`
}

Config contains the configuration for this key provider supplied by the user. This struct must have hcl tags in order to function.

func (Config) Build

Build will create the usable key provider.

type Descriptor

type Descriptor interface {
	keyprovider.Descriptor
}

Descriptor is an additional interface to allow for providing custom methods.

func New

func New() Descriptor

Jump to

Keyboard shortcuts

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