gmcredentials

package
v0.0.0-...-2ea34e8 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientTLSFromCert

func NewClientTLSFromCert(cp *sm2.CertPool, serverNameOverride string) credentials.TransportCredentials

NewClientTLSFromCert constructs TLS credentials from the provided root certificate authority certificate(s) to validate server connections. If certificates to establish the identity of the client need to be included in the credentials (eg: for mTLS), use NewTLS instead, where a complete tls.Config can be specified. serverNameOverride is for testing only. If set to a non empty string, it will override the virtual host name of authority (e.g. :authority header field) in requests.

func NewClientTLSFromFile

func NewClientTLSFromFile(certFile, serverNameOverride string) (credentials.TransportCredentials, error)

NewClientTLSFromFile constructs TLS credentials from the provided root certificate authority certificate file(s) to validate server connections. If certificates to establish the identity of the client need to be included in the credentials (eg: for mTLS), use NewTLS instead, where a complete tls.Config can be specified. serverNameOverride is for testing only. If set to a non empty string, it will override the virtual host name of authority (e.g. :authority header field) in requests.

func NewServerTLSFromCert

func NewServerTLSFromCert(cert *gmtls.Certificate) credentials.TransportCredentials

NewServerTLSFromCert constructs TLS credentials from the input certificate for server.

func NewServerTLSFromFile

func NewServerTLSFromFile(certFile, keyFile string) (credentials.TransportCredentials, error)

NewServerTLSFromFile constructs TLS credentials from the input certificate file and key file for server.

func NewTLS

NewTLS uses c to construct a TransportCredentials based on TLS.

Types

type TLSChannelzSecurityValue

type TLSChannelzSecurityValue struct {
	credentials.ChannelzSecurityValue
	StandardName      string
	LocalCertificate  []byte
	RemoteCertificate []byte
}

TLSChannelzSecurityValue defines the struct that TLS protocol should return from GetSecurityValue(), containing security info like cipher and certificate used.

This API is EXPERIMENTAL.

type TLSInfo

type TLSInfo struct {
	State gmtls.ConnectionState
	credentials.CommonAuthInfo
}

TLSInfo contains the auth information for a TLS authenticated connection. It implements the AuthInfo interface.

func (TLSInfo) AuthType

func (t TLSInfo) AuthType() string

AuthType returns the type of TLSInfo as a string.

func (TLSInfo) GetSecurityValue

func (t TLSInfo) GetSecurityValue() credentials.ChannelzSecurityValue

GetSecurityValue returns security info requested by channelz.

Directories

Path Synopsis
Package echo is a generated protocol buffer package.
Package echo is a generated protocol buffer package.
Package internal contains gRPC-internal code, to avoid polluting the godoc of the top-level grpc package.
Package internal contains gRPC-internal code, to avoid polluting the godoc of the top-level grpc package.
grpctest
Package grpctest implements testing helpers.
Package grpctest implements testing helpers.
leakcheck
Package leakcheck contains functions to check leaked goroutines.
Package leakcheck contains functions to check leaked goroutines.

Jump to

Keyboard shortcuts

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