common

package
v1.0.39 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TypePublicKey   = "PUBLIC KEY"
	TypeCertificate = "CERTIFICATE"
)

Variables

View Source
var (
	// name of the environment variable carrying the openSSL binary
	KeyEnvOpenSSL = "OPENSSL_BIN"

	// default name of the openSSL binary
	DefaultOpenSSL = "openssl"

	GetPath    = T.First[string, string]
	GetVersion = T.Second[string, string]

	// tests if a string contains "OpenSSL"
	IncludesOpenSSL = S.Includes("OpenSSL")

	// name of the open SSL binary either from the environment or a fallback
	OpenSSLBinary = F.Pipe2(
		KeyEnvOpenSSL,
		CIOO.LookupEnv,
		IOO.Fold(L.Of(IO.Of(DefaultOpenSSL)), IO.Of[string]),
	)
)
View Source
var (
	GetPwd   = T.First[string, string]
	GetToken = T.Second[string, string]

	// IsHyperProtectBasic tests if a string is a hyper protect token
	IsHyperProtectBasic = tokenRe.MatchString
)

Functions

func GetTypeFromBlock

func GetTypeFromBlock(block *pem.Block) string

func PemDecodeAll

func PemDecodeAll(data []byte) []*pem.Block

PemDecodeAll will decode the complete PEM structure

func SplitHyperProtectToken

func SplitHyperProtectToken(token string) E.Either[error, SplitToken]

Types

type OpenSSLVersion

type OpenSSLVersion = T.Tuple2[string, string]

OpenSSLVersion represents the openSSL version, including the path to the binary

type SplitToken

type SplitToken = T.Tuple2[string, string]

Jump to

Keyboard shortcuts

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