Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(option ClientOption) (credentials.TransportCredentials, error)
NewClient create client's credential
func NewServer ¶
func NewServer(option ServerOption) (credentials.TransportCredentials, error)
NewServer create server's credential
Types ¶
type ClientOption ¶
type ClientOption struct {
// ServerName name of server, a wildcard *.xx.com is supported.
ServerName string
// ChainPEMBlock chain of server issuer's
ChainPEMBlock []byte
// CertPEMBlock used by if server require and verify client cert; optional
CertPEMBlock []byte
// KeyPEMBlock used by if server require and verify client cert; optional
KeyPEMBlock []byte
}
ClientOption option for client credential
type ServerOption ¶
type ServerOption struct {
// ChainPEMBlock chain of client issuer's
ChainPEMBlock []byte
// CertPEMBlock PEM encoded data
CertPEMBlock []byte
// KeyPEMBlock PEM encoded data
KeyPEMBlock []byte
// RequireAndVerifyClientCert enable verify client's cert
RequireAndVerifyClientCert bool
}
ServerOption option for server credential
Click to show internal directories.
Click to hide internal directories.