crypto

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveSecurityContext

func SaveSecurityContext(ctx *StoredSecurityContext, path string, logger *zap.SugaredLogger) error

SaveSecurityContext saves the context as JSON to the specified path.

Types

type StoredSecurityContext

type StoredSecurityContext struct {
	PrivateKey      string `json:"privateKey"`
	Certificate     string `json:"certificate"`
	CertificateHash string `json:"certificateHash"`
}

StoredSecurityContext holds PEM-encoded cert/key for config/server and a fingerprint for discovery. Matches Dart model.

func GenerateSecurityContext

func GenerateSecurityContext(alias string, logger *zap.SugaredLogger) (*StoredSecurityContext, error)

GenerateSecurityContext creates a new security context with keys and a self-signed certificate.

func LoadSecurityContext

func LoadSecurityContext(path string, logger *zap.SugaredLogger) (*StoredSecurityContext, error)

LoadSecurityContext loads the context from JSON from the specified path.

Jump to

Keyboard shortcuts

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