util

package
v0.0.0-...-9a5f050 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertificateRequestFailed

func CertificateRequestFailed(cr *cmapi.CertificateRequest) (string, bool)

func CertificateRequestReady

func CertificateRequestReady(cr *cmapi.CertificateRequest) bool

func DefaultCertDuration

func DefaultCertDuration(d string) (*metav1.Duration, error)

func DefaultGenerateObjectMeta

func DefaultGenerateObjectMeta(opts options.Object) metav1.ObjectMeta

func EncodeCSR

func EncodeCSR(csr *x509.CertificateRequest, key crypto.Signer) ([]byte, error)

EncodeCSR calls x509.CreateCertificateRequest to sign the given CSR. It returns a PEM encoded signed CSR.

func FileExists

func FileExists(path string) (bool, error)

func ParseIPAddresses

func ParseIPAddresses(ipsS []string) []net.IP

func ParseURIs

func ParseURIs(urisS []string) ([]*url.URL, error)

func WriteCertificateFile

func WriteCertificateFile(path string, b []byte) error

func WriteFile

func WriteFile(path string, b []byte, perm os.FileMode) error

Types

type KeyBundle

type KeyBundle struct {
	PrivateKey         crypto.Signer
	SignatureAlgorithm x509.SignatureAlgorithm
	PublicKeyAlgorithm x509.PublicKeyAlgorithm
}

func DecodePrivateKeyBytes

func DecodePrivateKeyBytes(keyBytes []byte) (*KeyBundle, error)

DecodePrivateKeyBytes will decode a PEM encoded private key into a crypto.Signer. It supports ECDSA and RSA private keys only. All other types will return err.

func ParsePrivateKeyFile

func ParsePrivateKeyFile(path string) (*KeyBundle, error)

Jump to

Keyboard shortcuts

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