secrets

package
v0.0.0-...-6f43059 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainSecretMinLength = 16
)
View Source
const (
	Salt = "idmsvc-backend"
)

Variables

View Source
var (
	// MAC key for domain registration token
	DomainRegKeyInfo = HkdfInfo{[]byte("domain registration key"), 32}
	// hex string to identify AES encryption keys for encrypted private JWKs
	HostconfEncryptionIdInfo = HkdfInfo{[]byte("hostconf JWK encryption id"), 8}
	// AES-GCM encryption keys for private JWKs
	HostconfEncryptionKeyInfo = HkdfInfo{[]byte("hostconf JWK encryption key"), 16}
)

Functions

func GenerateRandomMainSecret

func GenerateRandomMainSecret() string

Generate random value for main secret, used in tests

func HkdfExpand

func HkdfExpand(prk PRK, hi HkdfInfo) (secret []byte, err error)

Expand pseudo random key into a secret

Types

type AppSecrets

type AppSecrets struct {
	DomainRegKey          []byte
	HostconfEncryptionId  string
	HostConfEncryptionKey []byte
}

func NewAppSecrets

func NewAppSecrets(mainSecret string) (sec *AppSecrets, err error)

Parse main secret and get sub secrets

type HkdfInfo

type HkdfInfo struct {
	Info   []byte
	Length int
}

type PRK

type PRK []byte

func HkdfExtract

func HkdfExtract(mainSecret []byte) PRK

Extract pseudo random key from a secret

Jump to

Keyboard shortcuts

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