class ChannelCredentials (View source)

Class ChannelCredentials

Methods

static 
setDefaultRootsPem(string $pem_roots)

Set default roots pem.

createDefault()

Create a default channel credentials object.

createSsl(string $pem_root_certs = null, string $pem_private_key = null, string $pem_cert_chain = null)

Create SSL credentials.

createComposite(ChannelCredentials $cred1, CallCredentials $cred2)

Create composite credentials from two existing credentials.

static null
createInsecure()

Create insecure channel credentials

Details

static setDefaultRootsPem(string $pem_roots)

Set default roots pem.

Parameters

string $pem_roots

PEM encoding of the server root certificates

Exceptions

InvalidArgumentException

static ChannelCredentials createDefault()

Create a default channel credentials object.

Return Value

ChannelCredentials

The new default channel credentials object

static ChannelCredentials createSsl(string $pem_root_certs = null, string $pem_private_key = null, string $pem_cert_chain = null)

Create SSL credentials.

Parameters

string $pem_root_certs

PEM encoding of the server root certificates

string $pem_private_key

PEM encoding of the client's private key

string $pem_cert_chain

PEM encoding of the client's certificate chain

Return Value

ChannelCredentials

The new SSL credentials object

Exceptions

InvalidArgumentException

static ChannelCredentials createComposite(ChannelCredentials $cred1, CallCredentials $cred2)

Create composite credentials from two existing credentials.

Parameters

ChannelCredentials $cred1

The first credential

CallCredentials $cred2

The second credential

Return Value

ChannelCredentials

The new composite credentials object

Exceptions

InvalidArgumentException

static null createInsecure()

Create insecure channel credentials

Return Value

null