certs

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Overview

Package certs provides utility functions for managing certificates.

Index

Constants

View Source
const PemStringDhparams = "DH PARAMETERS"
View Source
const PemStringDsaparams = "DSA PARAMETERS"
View Source
const PemStringEcdsaPublic = "ECDSA PUBLIC KEY"
View Source
const PemStringEcparameters = "EC PARAMETERS"
View Source
const PemStringEcprivatekey = "EC PRIVATE KEY"
View Source
const PemStringEvpPkey = "ANY PRIVATE KEY"
View Source
const PemStringParameters = "PARAMETERS"
View Source
const PemStringPkcs7 = "PKCS7"
View Source
const PemStringPkcs8 = "ENCRYPTED PRIVATE KEY"
View Source
const PemStringPkcs8inf = "PRIVATE KEY"
View Source
const PemStringPublic = "PUBLIC KEY"
View Source
const PemStringRsa = "RSA PRIVATE KEY"
View Source
const PemStringRsaPublic = "RSA PUBLIC KEY"
View Source
const PemStringSslSession = "SSL SESSION PARAMETERS"
View Source
const PemStringX509 = "CERTIFICATE"
View Source
const PemStringX509Crl = "X509 CRL"
View Source
const PemStringX509Old = "X509 CERTIFICATE"
View Source
const PemStringX509Req = "CERTIFICATE REQUEST"

Variables

This section is empty.

Functions

func GenCSR

func GenCSR(commonName string, pk ed25519.PublicKey, sk ed25519.PrivateKey) ([]byte, error)

GenCSR generates a test certificate signing request.

func PEMEncode

func PEMEncode(bu []byte, blockType string) (*bytes.Buffer, error)

PEMEncode encodes bu as a PEM blob given the block type.

func ParseCert

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

func ParsePk

func ParsePk(pkBytes []byte) (crypto.PublicKey, error)

func ParseSk

func ParseSk(skBytes []byte) (crypto.PrivateKey, error)

func ReadPEM

func ReadPEM(data []byte) (any, error)

ReadPEM decodes data as a PEM object and returns it.

func ToPEM

func ToPEM(obj any) ([]byte, error)

ToPEM returns as a PEM-encoded []byte representation

func X509ToTLS

func X509ToTLS(cert *x509.Certificate, sk ed25519.PrivateKey) tls.Certificate

Types

This section is empty.

Jump to

Keyboard shortcuts

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