Documentation ¶
Index ¶
- func DecodeObjFromPemBlock(p *pem.Block) (obj interface{}, errMsg string)
- func DecodeOneCertFromPemContent(content []byte) (cert *x509.Certificate, errMsg string)
- func DecodeOneObjFromPemContent(content []byte) (obj interface{}, errMsg string)
- func DecodePemContentCallback(content []byte, cb func(obj interface{})) (errMsg string)
- func EnableTlsVersion13()
- func EncodeObjToPemBlock(objI interface{}) (block *pem.Block, errMsg string)
- func GetClientTlsConfigFromServerX509Cert(cert *x509.Certificate) (config *tls.Config, errMsg string)
- func GetClientTlsConfigServerCertPem(serverCertPem string) (config *tls.Config, errMsg string)
- func GetX509CertFromTlsCert(tlsCert *tls.Certificate) (cert *x509.Certificate, errMsg string)
- func HashChk(b []byte) string
- func IsChkValid(chk string) bool
- func MustEncodeObjToPemString(obj interface{}) (pemContent string)
- func MustHashChkFromTlsCert(tlsCert *tls.Certificate) string
- func MustNewTlsCertSimple(isClient bool) (cert tls.Certificate)
- func NewClientTlsConfigWithChk(req NewClientTlsConfigWithChkReq) (config *tls.Config, errMsg string)
- func NewServerTlsConfigWithChk(req NewServerTlsConfigWithChkReq) (config *tls.Config, errMsg string)
- type NewClientTlsConfigWithChkReq
- type NewServerTlsConfigWithChkReq
- type NewTlsCertResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeObjFromPemBlock ¶
possible return type: *rsa.PrivateKey *ecdsa.PrivateKey *x509.Certificate *x509.CertificateRequest
func DecodeOneCertFromPemContent ¶
func DecodeOneCertFromPemContent(content []byte) (cert *x509.Certificate, errMsg string)
func EnableTlsVersion13 ¶
func EnableTlsVersion13()
func EncodeObjToPemBlock ¶
func GetClientTlsConfigFromServerX509Cert ¶
func GetClientTlsConfigFromServerX509Cert(cert *x509.Certificate) (config *tls.Config, errMsg string)
func GetX509CertFromTlsCert ¶
func GetX509CertFromTlsCert(tlsCert *tls.Certificate) (cert *x509.Certificate, errMsg string)
func IsChkValid ¶
func MustEncodeObjToPemString ¶
func MustEncodeObjToPemString(obj interface{}) (pemContent string)
func MustHashChkFromTlsCert ¶
func MustHashChkFromTlsCert(tlsCert *tls.Certificate) string
func MustNewTlsCertSimple ¶
func MustNewTlsCertSimple(isClient bool) (cert tls.Certificate)
func NewClientTlsConfigWithChk ¶
func NewClientTlsConfigWithChk(req NewClientTlsConfigWithChkReq) (config *tls.Config, errMsg string)
func NewServerTlsConfigWithChk ¶
func NewServerTlsConfigWithChk(req NewServerTlsConfigWithChkReq) (config *tls.Config, errMsg string)
Types ¶
type NewClientTlsConfigWithChkReq ¶
type NewClientTlsConfigWithChkReq struct { ServerChk string // must have ClientCert tls.Certificate // can be nil }
type NewServerTlsConfigWithChkReq ¶
type NewServerTlsConfigWithChkReq struct { ClientChk string // can be nil ServerCert tls.Certificate // must have }
type NewTlsCertResp ¶
type NewTlsCertResp struct { TlsCert tls.Certificate CertPem string PkPem string }
func MustNewTlsCert ¶
func MustNewTlsCert(isClient bool) (resp NewTlsCertResp)
can not crash by user
Click to show internal directories.
Click to hide internal directories.