tyTls

package
v0.0.0-...-f254aa5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeObjFromPemBlock

func DecodeObjFromPemBlock(p *pem.Block) (obj interface{}, errMsg string)

possible return type: *rsa.PrivateKey *ecdsa.PrivateKey *x509.Certificate *x509.CertificateRequest

func DecodeOneCertFromPemContent

func DecodeOneCertFromPemContent(content []byte) (cert *x509.Certificate, errMsg string)

func DecodeOneObjFromPemContent

func DecodeOneObjFromPemContent(content []byte) (obj interface{}, errMsg string)

func DecodePemContentCallback

func DecodePemContentCallback(content []byte, cb func(obj interface{})) (errMsg string)

func EnableTlsVersion13

func EnableTlsVersion13()

func EncodeObjToPemBlock

func EncodeObjToPemBlock(objI interface{}) (block *pem.Block, errMsg string)

func GetClientTlsConfigFromServerX509Cert

func GetClientTlsConfigFromServerX509Cert(cert *x509.Certificate) (config *tls.Config, errMsg string)

func GetClientTlsConfigServerCertPem

func GetClientTlsConfigServerCertPem(serverCertPem string) (config *tls.Config, errMsg string)

func GetX509CertFromTlsCert

func GetX509CertFromTlsCert(tlsCert *tls.Certificate) (cert *x509.Certificate, errMsg string)

func HashChk

func HashChk(b []byte) string

func IsChkValid

func IsChkValid(chk string) bool

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

Jump to

Keyboard shortcuts

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