Documentation ¶
Index ¶
Constants ¶
const ( // NOOP represents no crypto NOOP = "NOOP" // AES256 represents AES256 encryption AES256 = "AES256" )
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶ added in v0.12.0
Decrypt decrypts the provided bytes using the globally configured codec
func Encrypt ¶ added in v0.12.0
Encrypt encrypts the provided bytes using the globally configured codec
func InitializeGlobalCodec ¶ added in v0.12.0
InitializeGlobalCodec may be called once and only once to inject an object that implements the Codec interface into a "global" (package-scoped) variable. Additional invocations of this function will return an error.
Types ¶
type Codec ¶
Codec is an interface to be implemented by any type that can encrypt and decrypt values
type Config ¶ added in v0.12.0
type Config struct {
EncryptionScheme string `envconfig:"ENCRYPTION_SCHEME" default:"AES256"`
}
Config represents configuration options for the global codec
func GetConfigFromEnvironment ¶ added in v0.12.0
GetConfigFromEnvironment returns configuration derived from environment variables
func NewConfigWithDefaults ¶ added in v0.12.0
func NewConfigWithDefaults() Config
NewConfigWithDefaults returns a Config object with default values already applied. Callers are then free to set custom values for the remaining fields and/or override default values.