crypto

package
v0.6.13 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: Apache-2.0 Imports: 17 Imported by: 21

Documentation

Index

Constants

View Source
const (
	ContextClientSecretKey = key("client-secret-key")
)

Variables

View Source
var ErrInvalidClientSecret = errors.New("invalid client secret")
View Source
var ErrInvalidCredentialOptions = errors.New("unknown credential options")
View Source
var ErrInvalidPasswordLength = errors.New("invalid password length")

Functions

func ConvertCredentialOptions added in v0.4.0

func ConvertCredentialOptions(ctx context.Context, clientSecret *jose.JSONWebKey, opts *v2.CredentialOptions, encryptionConfigs []*v2.EncryptionConfig) (*v2.LocalCredentialOptions, error)

func GeneratePassword

func GeneratePassword(ctx context.Context, credentialOptions *v2.LocalCredentialOptions) (string, error)

func GenerateRandomPassword

func GenerateRandomPassword(randomPassword *v2.LocalCredentialOptions_RandomPassword) (string, error)

func ParseClientSecret added in v0.4.0

func ParseClientSecret(input []byte, setKeyID bool) (*jose.JSONWebKey, error)

Types

type EncryptionManager

type EncryptionManager struct {
	// contains filtered or unexported fields
}

func NewEncryptionManager added in v0.1.19

func NewEncryptionManager(co *v2.CredentialOptions, ec []*v2.EncryptionConfig) (*EncryptionManager, error)

func (*EncryptionManager) Encrypt

func (pkem *EncryptionManager) Encrypt(ctx context.Context, cred *v2.PlaintextData) ([]*v2.EncryptedData, error)

FIXME(morgabra) Be tolerant of failures here and return the encryptions that succeeded. We've likely already done things to generate the credentials we want to encrypt, so we should still return the created objects even if your encryption provider is misconfigured.

type PlaintextCredential

type PlaintextCredential struct {
	Name        string
	Description string
	Schema      string
	Bytes       []byte
}

Directories

Path Synopsis
jwk

Jump to

Keyboard shortcuts

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