PrivMX DOCS
API Reference/PrivMX Endpoint Swift Extra/Core

Connection

Swift wrapper for privmx.NativeConnectionWrapper, used to establish and manage secure connections with PrivMX platform.

Static Methods

connect(as:to:on:setting:)

Establishes an authorized connection to PrivMX Bridge. This method initiates a secured connection to PrivMX Bridge using the user’s private key. The connection allows for the execution of secured operations within a specified Solution.

Params

userPrivKey

String

The user’s private key used for authentication (WIF format).

solutionID

String

The unique identifier of the Solution to connect to.

bridgeUrl

String

The URL of PrivMX Bridge to connect to.

verificationOptions

privmx.endpoint.core.PKIVerificationOptions

Options used to verify if Bridge on given url is the one you expect.

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

Returns

any PrivMXConnection · A new PrivMXConnection instance representing the established connection.

connectPublic(to:on:setting:)

Establishes a public connection to PrivMX Bridge. This method initiates a public connection to PrivMX Bridge, which is typically used for operations that do not require authentication, such as handling inbound traffic to an Inbox.

Params

solutionID

String

The unique identifier of the Solution to connect to.

bridgeUrl

String

The URL of PrivMX Bridge to connect to.

verificationOptions

privmx.endpoint.core.PKIVerificationOptions

Options used to verify if Bridge on given url is the one you expect.

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

Returns

any PrivMXConnection · A new PrivMXConnection instance representing the public connection.

setCertsPath(_:)

Sets the path to the .pem file containing certificates required for establishing a connection. This method configures the path to a .pem file with certificates necessary to authenticate the connection. The required certificates depend on the specific setup of PrivMX Bridge.

Params

path

String

The path to the .pem file containing the required certificates.

public static func setCertsPath(
_ path: String
) throws

Methods

listContexts(basedOn:)

Lists all available Contexts for the authorized user in the current Solution. This method retrieves a list of Contexts available to the user, filtered according to the provided query.

Params

query

privmx.endpoint.core.PagingQuery

A PagingQuery object to filter the list of Contexts.

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

Returns

privmx.ContextList · A privmx.endpoint.core.ContextList instance containing the list of Contexts.

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