Connection
Swift wrapper for privmx.NativeConnectionWrapper
, used to establish and manage secure connections with PrivMX platform.
Static Methodsβ
connect(as:toπ)β
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.
public static func connect(
as userPrivKey: String,
to solutionID: String,
on bridgeUrl: String
) throws -> any PrivMXConnection
Name | Type | Description |
---|---|---|
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. |
Type | Description |
---|---|
any PrivMXConnection | A new `PrivMXConnection` instance representing the established connection. |
connectPublic(toπ)β
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.
public static func connectPublic(
to solutionID: String,
on bridgeUrl: String
) throws -> any PrivMXConnection
Name | Type | Description |
---|---|---|
solutionID | String | The unique identifier of the Solution to connect to. |
bridgeUrl | String | The URL of PrivMX Bridge to connect to. |
Type | Description |
---|---|
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.
public static func setCertsPath(
_ path: String
) throws
Name | Type | Description |
---|---|---|
path | String | The path to the `.pem` file containing the required certificates. |
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.
public func listContexts(
basedOn query: privmx.endpoint.core.PagingQuery
) throws -> privmx.ContextList
Name | Type | Description |
---|---|---|
query | privmx.endpoint.core.PagingQuery | A `PagingQuery` object to filter the list of Contexts. |
Type | Description |
---|---|
privmx.ContextList | A `privmx.endpoint.core.ContextList` instance containing the list of Contexts. |