Documentation ¶
Index ¶
- func CertTemplate(signAlgo x509.SignatureAlgorithm) (*x509.Certificate, error)
- func ClientTLSCRT(rootCert *x509.Certificate, rootKey interface{}, ...) (*tls.Certificate, []byte, interface{}, error)
- func CreateCert(template, parent *x509.Certificate, pub interface{}, parentPriv interface{}) (cert *x509.Certificate, certPEM []byte, err error)
- func NewTLSCommunication(handler http.Handler) (TestTLSServer, TestTLSClient, error)
- func NewTestTLSClient(certPool *x509.CertPool, clientTLSCert *tls.Certificate) *http.Client
- func NewUnstartedTestTLSServer(certPool *x509.CertPool, servTLSCert *tls.Certificate, handler http.Handler) *httptest.Server
- func RootTLSCRT(rootCertTmpl *x509.Certificate) (*x509.Certificate, []byte, interface{}, error)
- func ServerTLSCRT(rootCert *x509.Certificate, rootKey interface{}, ...) (*tls.Certificate, []byte, interface{}, error)
- type TestTLSClient
- type TestTLSServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CertTemplate ¶
func CertTemplate(signAlgo x509.SignatureAlgorithm) (*x509.Certificate, error)
Suported SignatureAlgorithm: x509.SHA256WithRSA, SignatureAlgorithm: x509.ECDSAWithSHA256,
func ClientTLSCRT ¶
func ClientTLSCRT(rootCert *x509.Certificate, rootKey interface{}, clientCertTmpl *x509.Certificate) (*tls.Certificate, []byte, interface{}, error)
Optional cert template
func CreateCert ¶
func CreateCert(template, parent *x509.Certificate, pub interface{}, parentPriv interface{}) ( cert *x509.Certificate, certPEM []byte, err error)
func NewTLSCommunication ¶
func NewTLSCommunication(handler http.Handler) (TestTLSServer, TestTLSClient, error)
defer ts.Close() on succeess
func NewTestTLSClient ¶
func NewUnstartedTestTLSServer ¶
func NewUnstartedTestTLSServer(certPool *x509.CertPool, servTLSCert *tls.Certificate, handler http.Handler) *httptest.Server
return a tls httptest.NewUnstartedServer defer ts.Close()
func RootTLSCRT ¶
func RootTLSCRT(rootCertTmpl *x509.Certificate) (*x509.Certificate, []byte, interface{}, error)
Optional cert template returns rootCRT: to generate the client crt RootCRTPEM: to generate the trusted cert pool Rootkey: to generate the client crt error
func ServerTLSCRT ¶
func ServerTLSCRT(rootCert *x509.Certificate, rootKey interface{}, servCertTmpl *x509.Certificate) (*tls.Certificate, []byte, interface{}, error)
Optional cert template
Types ¶
type TestTLSClient ¶
type TestTLSServer ¶
Click to show internal directories.
Click to hide internal directories.