crypto

package
v0.0.0-...-4f54193 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 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) 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) (*StoredSecurityContext, error)

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

func LoadSecurityContext

func LoadSecurityContext(path string) (*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