PrivMX DOCS
API Reference/PrivMX Endpoint Swift Extra/Core

PrivMXConnection

The PrivMXConnection protocol declares methods for managing connections to PrivMX Bridge with Swift types. Do not conform to this protocol on your own.

Static Methods

setCertsPath(_:)

Sets path to .pem file with certificates needed for establishing connection. This certificates depends on your Bridge setup.

Params

path

String

Path to the .pem file

static func setCertsPath(
_ path: String
) throws -> Void

connect(as:to:on:setting:)

Connects with provided credentials to PrivMX Bridge.

Params

userPrivKey

String

User’s Private Key in WIF format

solutionID

String

Unique Solution Identifier defined at PrivMX Bridge

bridgeUrl

String

URL of PrivMX Bridge Instance

verificationOptions

privmx.endpoint.core.PKIVerificationOptions

URL of PrivMX Bridge Instance

static func connect(
as userPrivKey: String,
to solutionID: String,
on bridgeUrl: String,
setting verificationOptions: privmx.endpoint.core.PKIVerificationOptions
) throws -> any PrivMXConnection

Returns

any PrivMXConnection · new Connection object which can be used for initializing proper PrivMX Endpoint APIs

connectPublic(to:on:setting:)

Connects with public access to PrivMX Bridge. It is used mainly for public access to InboxApi.

Params

solutionID

String

Unique Solution Identifier defined at PrivMX Bridge

bridgeUrl

String

verificationOptions

privmx.endpoint.core.PKIVerificationOptions

static func connectPublic(
to solutionID: String,
on bridgeUrl: String,
setting verificationOptions: privmx.endpoint.core.PKIVerificationOptions
) throws -> any PrivMXConnection

Returns

any PrivMXConnection · new Connection object which can be used for initializing PrivMX InboxApi.

Methods

disconnect()

Disconnects current connection. Calling this function finished usage of PrivMXConnection object.

func disconnect(
) throws -> Void

getConnectionId()

Returns current Connection ID.

func getConnectionId(
) throws -> Int64

Returns

Int64 · Current Connection ID. Used for managing and identifying connections.

listContexts(basedOn:)

Lists Contexts to which the connected user has access.

Params

query

privmx.endpoint.core.PagingQuery

Object holding parameters of the query

func listContexts(
basedOn query: privmx.endpoint.core.PagingQuery
) throws -> privmx.ContextList

Returns

privmx.ContextList · Structure containing all Contexts user has access to.

setUserVerifier(_:)

Sets user’s custom verification callback. Use this to set up verification with a PKI server.

Params

verifierImplementation

privmx.VerificationImplementation

Callback that will be called for each verification request by the C++ library. It takes a C++ std.vector of privmx.endpoint.core.VerificationRequest objects, exposed to swift as privmx.VerificationRequestVector and returns a std.vector of bools corresponding to the verification results.

func setUserVerifier(
_ verifierImplementation: privmx.VerificationImplementation
) throws -> Void

We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.

PrivMX Endpoint Swift v2.3

This package is not up to date with the core documentation. Some of the features you've seen described in other parts of the documentation might not be mentioned here. Those changes do not influence compatibility, however