utils

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidEDCSABits = map[int]elliptic.Curve{
	224: elliptic.P224(),
	256: elliptic.P256(),
	384: elliptic.P384(),
	521: elliptic.P521(),
}
View Source
var ValidRSABits = map[int]*bool{
	521:  nil,
	1024: nil,
	2048: nil,
	4096: nil,
}

Functions

func GenFilePath

func GenFilePath(filePath string, name string, extension string) string

func GenerateRandomThreeBytesSN

func GenerateRandomThreeBytesSN() (*big.Int, error)

func GenerateUserRequestedKey added in v0.3.0

func GenerateUserRequestedKey(e EncryptionAlgorithm) (privateKey any, publicKey any, err error)

func InputPrompt

func InputPrompt(label string) string

Types

type CertGenConfig added in v0.3.0

type CertGenConfig struct {
	CertificateMetadata CertificateMetadata
	EncryptionAlgorithm EncryptionAlgorithm
}

func ParseCertGenConfig added in v0.3.0

func ParseCertGenConfig(path string) (*CertGenConfig, error)

type CertificateMetadata added in v0.3.0

type CertificateMetadata struct {
	OrganizationName  string
	SubjectCommonName string
	DnsNames          []string
	IPAddresses       []net.IP
}

type EncryptionAlgorithm added in v0.3.0

type EncryptionAlgorithm struct {
	EncAlgorithm string
	EncBits      int
}

func (*EncryptionAlgorithm) ParseSupportedEnc added in v0.3.0

func (em *EncryptionAlgorithm) ParseSupportedEnc() SupportedEnc

func (*EncryptionAlgorithm) ValidateEncryptionBitsRequested added in v0.3.0

func (em *EncryptionAlgorithm) ValidateEncryptionBitsRequested() error

type SupportedEnc added in v0.3.0

type SupportedEnc string
const (
	Undefined SupportedEnc = "Undefined"
	RSA       SupportedEnc = "RSA"
	EDCSA     SupportedEnc = "EDCSA"
)

Jump to

Keyboard shortcuts

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