Documentation ¶
Overview ¶
Package p2ptls
@author: xwc1125
Package p2ptls ¶
@author: xwc1125
Package p2ptls ¶
@author: xwc1125
Package p2ptls ¶
@author: xwc1125
Index ¶
Constants ¶
View Source
const ProtocolID = "/tls/1.0.0"
ProtocolID 协ID
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaTrustRoot ¶
type CaTrustRoot struct {
// contains filtered or unexported fields
}
CaTrustRoot CA可信根
func NewCaTrustRoot ¶
func NewCaTrustRoot(caRoots [][]byte) (*CaTrustRoot, error)
NewCaTrustRoot 创建CA可信根
func (*CaTrustRoot) AppendCertsFromPEM ¶
func (r *CaTrustRoot) AppendCertsFromPEM(rootPem []byte) bool
AppendCertsFromPEM 添加pem证书
func (*CaTrustRoot) RefreshCARootFromPem ¶
func (r *CaTrustRoot) RefreshCARootFromPem(rootsPem [][]byte) bool
RefreshCARootFromPem 更新CA可信根
func (*CaTrustRoot) VerifyCert ¶
func (r *CaTrustRoot) VerifyCert(cert *x509.Certificate) error
VerifyCert 验证证书
type Identity ¶
type Identity struct {
// contains filtered or unexported fields
}
func NewIdentity ¶
func NewIdentity(cert *tls.Certificate, caRoots [][]byte) (*Identity, error)
func (*Identity) ConfigForPeer ¶
func (*Identity) PubKeyFromCertChain ¶
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport 安全通信会话
func (*Transport) SecureInbound ¶
SecureInbound runs the TLS handshake as a server.
Click to show internal directories.
Click to hide internal directories.