certutil

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

* * Copyright (c) 2020 Ameya Lokare

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCertificate

func GenerateCertificate(hostname string, organizationName string, key crypto.PrivateKey, notBefore time.Time, notAfter time.Time, issuerCertificate *x509.Certificate, issuerPrivateKey crypto.PrivateKey, isClientCert bool, isCA bool) ([]byte, error)

func GenerateKeyPair

func GenerateKeyPair() (crypto.PrivateKey, error)

func GenerateLeafCert

func GenerateLeafCert(hostname string, organizationName string, issuerCert *x509.Certificate, issuerKey crypto.PrivateKey, isClient bool) (*tls.Certificate, error)

func GenerateRootCACert

func GenerateRootCACert() (crypto.PrivateKey, *x509.Certificate, error)

func X509ToTLSCertificate

func X509ToTLSCertificate(x509Cert *x509.Certificate, privateKey crypto.PrivateKey) (*tls.Certificate, error)

Types

type CertificateFixtures

type CertificateFixtures struct {
	RootCAs                   *x509.CertPool
	RootCAPrivateKey          crypto.PrivateKey
	RootCACert                *tls.Certificate
	ProxyCert                 *tls.Certificate
	ServerCert                *tls.Certificate
	InvalidHostnameServerCert *tls.Certificate
	ClientCert                *tls.Certificate
}

func NewCertificateFixtures

func NewCertificateFixtures(t *testing.T) *CertificateFixtures

Jump to

Keyboard shortcuts

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