internal

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(elem string, list []string) bool

func ExtendSha256 added in v0.8.0

func ExtendSha256(hash []byte, data []byte) []byte

ExtendSha256 performs the extend operation Digest = HASH(Digest | Data) using the SHA256 hashing algorithm, as performed e.g. by Trusted Platform Modules (TPMs)

func ExtendSha384 added in v0.8.0

func ExtendSha384(hash []byte, data []byte) []byte

ExtendSha256 performs the extend operation Digest = HASH(Digest | Data) using the SHA256 hashing algorithm, as performed e.g. by Trusted Platform Modules (TPMs)

func FileExists added in v0.6.0

func FileExists(f string) bool

func FlagPassed added in v0.6.0

func FlagPassed(name string) bool

func GetNetworkAndAddr added in v0.8.0

func GetNetworkAndAddr(addr string) (string, string, error)

Tests if the address is a network address in the form ip:port. In this case, returns "tcp" to be used as the transport layer, otherwise assumes that the address is a unix domain socket

func ParseCert added in v0.6.0

func ParseCert(data []byte) (*x509.Certificate, error)

ParseCert parses a certificate from PEM or DER encoded data into an X.509 certificate

func ParseCertsDer added in v0.6.0

func ParseCertsDer(data any) ([]*x509.Certificate, error)

ParseCertsDer parses DER encoded certificates

func ParseCertsPem added in v0.6.0

func ParseCertsPem(data any) ([]*x509.Certificate, error)

ParseCertsPem parses certificates in a single PEM encoded blob or a list of PEM encoded blobs into a list of X.509 certificates

func PrintTlsConfig

func PrintTlsConfig(conf *tls.Config, roots []byte) error

func VerifyCertChain added in v0.6.0

func VerifyCertChain(certs []*x509.Certificate, cas []*x509.Certificate) ([][]*x509.Certificate, error)

verifyCertChain tries to verify the certificate chain certs with leaf certificate first up to one of the root certificates in cas

func WriteCertPem added in v0.6.0

func WriteCertPem(cert *x509.Certificate) []byte

func WriteCertsDer added in v0.6.0

func WriteCertsDer(certs []*x509.Certificate) [][]byte

func WriteCertsPem added in v0.6.0

func WriteCertsPem(certs []*x509.Certificate) [][]byte

func WritePublicKeyPem added in v0.6.0

func WritePublicKeyPem(key crypto.PublicKey) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳