Documentation ¶
Index ¶
- func LoadKey(keyAddr string) (crypto.PrivateKey, error)
- type ID
- func (id *ID) CA() *x509.CertPool
- func (id *ID) Cert() *tls.Certificate
- func (i *ID) ClientTLSConfig() *tls.Config
- func (i *ID) GetClientCertificate(info *tls.CertificateRequestInfo) (*tls.Certificate, error)
- func (i *ID) GetServerCertificate(info *tls.ClientHelloInfo) (*tls.Certificate, error)
- func (id *ID) Reload() error
- func (id *ID) ServerCert() *tls.Certificate
- func (i *ID) ServerTLSConfig() *tls.Config
- type Identity
- type IdentityConfig
- type TokenId
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ID ¶
type ID struct { IdentityConfig // contains filtered or unexported fields }
func (*ID) Cert ¶
func (id *ID) Cert() *tls.Certificate
func (*ID) ClientTLSConfig ¶
func (*ID) GetClientCertificate ¶ added in v0.15.27
func (i *ID) GetClientCertificate(info *tls.CertificateRequestInfo) (*tls.Certificate, error)
func (*ID) GetServerCertificate ¶ added in v0.15.27
func (i *ID) GetServerCertificate(info *tls.ClientHelloInfo) (*tls.Certificate, error)
func (*ID) ServerCert ¶
func (id *ID) ServerCert() *tls.Certificate
func (*ID) ServerTLSConfig ¶
type Identity ¶
type Identity interface { Cert() *tls.Certificate ServerCert() *tls.Certificate CA() *x509.CertPool ServerTLSConfig() *tls.Config ClientTLSConfig() *tls.Config Reload() error }
func LoadIdentity ¶
func LoadIdentity(cfg IdentityConfig) (Identity, error)
type IdentityConfig ¶
type IdentityConfig struct { Key string `json:"key" yaml:"key" mapstructure:"key"` Cert string `json:"cert" yaml:"cert" mapstructure:"cert"` ServerCert string `json:"server_cert,omitempty" yaml:"server_cert,omitempty" mapstructure:"server_cert,omitempty"` ServerKey string `json:"server_key,omitempty" yaml:"server_key,omitempty" mapstructure:"server_key,omitempty"` CA string `json:"ca,omitempty" yaml:"ca,omitempty" mapstructure:"ca"` }
type TokenId ¶
func LoadClientIdentity ¶
func LoadServerIdentity ¶
func NewIdentity ¶
func (*TokenId) ClientTLSConfig ¶
func (*TokenId) ServerTLSConfig ¶
func (*TokenId) ShallowCloneWithNewToken ¶
Click to show internal directories.
Click to hide internal directories.