certs

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Certificate     = "CERTIFICATE"
	ECPrivateKey    = "EC PRIVATE KEY"
	RSAPrivateKey   = "RSA PRIVATE KEY"
	PKCS8PrivateKey = "PRIVATE KEY"
)
View Source
const (
	// KubeScrtName is the name of the kubernetes secret that holds the trust bundle.
	KubeScrtName = "dapr-trust-bundle"
	// TrustAnchorsEnvVar is the environment variable name for the trust anchors in the sidecar.
	TrustAnchorsEnvVar = "DAPR_TRUST_ANCHORS"
	CertChainEnvVar    = "DAPR_CERT_CHAIN"
	CertKeyEnvVar      = "DAPR_CERT_KEY"
)

Variables

This section is empty.

Functions

func CertPoolFromPEM

func CertPoolFromPEM(certPem []byte) (*x509.CertPool, error)

CertPoolFromPEMString returns a CertPool from a PEM encoded certificates string.

func CredentialsExist added in v0.11.1

func CredentialsExist(conf config.SentryConfig) (bool, error)

CredentialsExist checks root and issuer credentials exist on a hosting platform.

func DecodePEMCertificates

func DecodePEMCertificates(crtb []byte) ([]*x509.Certificate, error)

DecodePEMCertificates takes a PEM encoded x509 certificates byte array and returns A x509 certificate and the block byte array.

func GenerateECPrivateKey

func GenerateECPrivateKey() (*ecdsa.PrivateKey, error)

GenerateECPrivateKey returns a new EC Private Key.

func ParsePemCSR

func ParsePemCSR(csrPem []byte) (*x509.CertificateRequest, error)

ParsePemCSR constructs a x509 Certificate Request using the given PEM-encoded certificate signing request.

func StoreCredentials

func StoreCredentials(conf config.SentryConfig, rootCertPem, issuerCertPem, issuerKeyPem []byte) error

StoreCredentials saves the trust bundle in a Kubernetes secret store or locally on disk, depending on the hosting platform.

Types

type Credentials

type Credentials struct {
	PrivateKey  *PrivateKey
	Certificate *x509.Certificate
}

Credentials holds a certificate, private key and trust chain.

func PEMCredentialsFromFiles

func PEMCredentialsFromFiles(certPem, keyPem []byte) (*Credentials, error)

PEMCredentialsFromFiles takes a path for a key/cert pair and returns a validated Credentials wrapper with a trust chain.

type PrivateKey

type PrivateKey struct {
	Type string
	Key  interface{}
}

PrivateKey wraps a EC or RSA private key.

func DecodePEMKey

func DecodePEMKey(key []byte) (*PrivateKey, error)

DecodePEMKey takes a key PEM byte array and returns a PrivateKey that represents Either an RSA or EC private key.

Jump to

Keyboard shortcuts

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