Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultCertificates ¶
func DefaultCertificates() (*CertificateInfo, *CertificateInfo, *CertificateInfo)
DefaultCertificates returns an initially generated CA, server, and client certificate
func RandomString ¶
func RandomString() string
Types ¶
type CertificateInfo ¶
type CertificateInfo struct { Cert *x509.Certificate CertBytes []byte PrivateKey *rsa.PrivateKey PrivateKeyBytes []byte X509 tls.Certificate // contains filtered or unexported fields }
CertificateInfo wraps all of the information needed to describe a generated certificate
var ( DefaultTestCA *CertificateInfo DefaultTestServerCertificate *CertificateInfo DefaultTestClientCertificate *CertificateInfo )
func GenerateSignedCertificate ¶
func GenerateSignedCertificate(options GenerateCertificateOptions) (*CertificateInfo, error)
GenerateSignedCertificate generates a certificate with the given options
type GenerateCertificateOptions ¶
type GenerateCertificateOptions struct { CA *CertificateInfo IsCA bool ServiceName string SPIFFEHostOverride string SPIFFEPathOverride string ExtraSANs []string ExtraIPs []net.IP Expiration time.Time Bits int }
GenerateCertificateOptions describe how he want to generate a certificate
Click to show internal directories.
Click to hide internal directories.