Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // AllocCounter is used to track secret allocations. // nolint - Needs to be global to track allocations AllocCounter = metrics.GetOrRegisterCounter("secret.allocated", nil) )
Functions ¶
This section is empty.
Types ¶
type Secret ¶
type Secret interface { // WithBytes makes the underlying bytes readable and passes them to the function provided. // A reference MUST not be kept to the bytes passed to the function as the underlying array will no // longer be readable after the function exits. WithBytes(action func([]byte) error) error // WithBytes makes the underlying bytes readable and passes them to the function provided. // A reference MUST not be kept to the bytes passed to the function as the underlying array will no // longer be readable after the function exits. WithBytesFunc(action func([]byte) ([]byte, error)) ([]byte, error) // IsClosed returns true if the underlying data container has already been closed. IsClosed() bool // Close closes the data container and frees any associated memory. Close() error }
Secret contains sensitive memory and stores data in protected page(s) in memory. Always call close after use to avoid memory leaks.
type SecretFactory ¶
type SecretFactory interface { // New takes in a byte slice and returns a Secret containing that data. New(b []byte) (Secret, error) // CreateRandom returns a Secret that contains a random byte slice of the specified size. CreateRandom(size int) (Secret, error) }
SecretFactory is the interface for creating specific implementations of a Secret.
Click to show internal directories.
Click to hide internal directories.