Documentation ¶
Overview ¶
Package util is originated from https://github.com/yahoo/k8s-athenz-identity/tree/ae7c7ef/pkg/util
Index ¶
- func CertificateFromPEMBytes(pemBytes []byte) (*x509.Certificate, error)
- func GenerateCSR(signer crypto.Signer, opts CSROptions) (csrPEM []byte, err error)
- func GenerateKeyAndCSR(opts CSROptions) (keyPEM, csrPEM []byte, err error)
- func MarshalSANs(sans SubjectAlternateNames) (pkix.Extension, error)
- func PublicKeyFromPEMBytes(pemBytes []byte) (crypto.PublicKey, error)
- type CSROptions
- type KeyType
- type SubjectAlternateNames
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CertificateFromPEMBytes ¶
func CertificateFromPEMBytes(pemBytes []byte) (*x509.Certificate, error)
CertificateFromPEMBytes returns an X.509 certificate from its supplied PEM representation.
func GenerateCSR ¶
func GenerateCSR(signer crypto.Signer, opts CSROptions) (csrPEM []byte, err error)
GenerateCSR generates a CSR using the supplied key, common name and options.
func GenerateKeyAndCSR ¶
func GenerateKeyAndCSR(opts CSROptions) (keyPEM, csrPEM []byte, err error)
GenerateKeyAndCSR generates a private key and returns the key and CSR PEMs.
func MarshalSANs ¶
func MarshalSANs(sans SubjectAlternateNames) (pkix.Extension, error)
Types ¶
type CSROptions ¶
type CSROptions struct { Subject pkix.Name SANs SubjectAlternateNames }
CSROptions has optional config for creating a CSR request
type KeyType ¶
type KeyType int
KeyType is the type of private key.
const ( RSA KeyType ECDSA )
supported key types
type SubjectAlternateNames ¶
type SubjectAlternateNames struct { DNSNames []string IPAddresses []net.IP URIs []url.URL EmailAddresses []string }
SubjectAlternateNames contains the SAN entities in a cert.
func UnmarshalSANs ¶
func UnmarshalSANs(extensions []pkix.Extension) (sans SubjectAlternateNames, err error)
func (*SubjectAlternateNames) IsEmpty ¶
func (s *SubjectAlternateNames) IsEmpty() bool
func (SubjectAlternateNames) String ¶
func (s SubjectAlternateNames) String() string
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer writes multiple files with modified suffixes and renames all of them to their final names on save.
Click to show internal directories.
Click to hide internal directories.