Connection.setPrivateKey()

DESCRIPTION

Set the private key to be used on this connection.

The private key is a PEM encoded string, it can be created by using the Client.createPrivateKey() function or using another tool which can make an appropriate private key (see https://docs.nabto.com/developer/guides/security/public_key_auth.html for more info)

DECLARATION

    public func setPrivateKey(key: String) throws 

PARAMETERS

key:
The PEM encoded private key to set.

ERRORS

Throws the following errors:

INVALID_STATE:
if the connection is not in the setup phase

RETURN VALUES

None.

EXAMPLES

None.