Documentation ¶
Index ¶
- Constants
- func CertPoolFromPEM(certPem []byte) (*x509.CertPool, error)
- func CredentialsExist(conf config.SentryConfig) (bool, error)
- func DecodePEMCertificates(crtb []byte) ([]*x509.Certificate, error)
- func DecodePEMKey(key []byte) (interface{}, error)
- func GenerateECPrivateKey() (*ecdsa.PrivateKey, error)
- func ParsePemCSR(csrPem []byte) (*x509.CertificateRequest, error)
- func StoreCredentials(conf config.SentryConfig, rootCertPem, issuerCertPem, issuerKeyPem []byte) error
- type Credentials
Constants ¶
const ( BlockTypeCertificate = "CERTIFICATE" BlockTypeECPrivateKey = "EC PRIVATE KEY" BlockTypePKCS1PrivateKey = "RSA PRIVATE KEY" BlockTypePKCS8PrivateKey = "PRIVATE KEY" )
Variables ¶
This section is empty.
Functions ¶
func CertPoolFromPEM ¶
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 all certificates in a slice of x509.Certificate objects.
func DecodePEMKey ¶
DecodePEMKey takes a key PEM byte array and returns an object that represents either an RSA or EC private key.
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 interface{} Certificate *x509.Certificate }
Credentials holds a certificate and private key.
func PEMCredentialsFromFiles ¶
func PEMCredentialsFromFiles(certPem, keyPem []byte) (*Credentials, error)
PEMCredentialsFromFiles takes a path for a key/cert pair and returns a validated Credentials wrapper.