PrivMX DOCS
C#

Getting Started

Initial Requirements

To start developing using PrivMX Endpoint C# you need a PrivMX Bridge instance.

To connect it to your environment, you need:

  • Bridge URL - URL address of the instance of your PrivMX Bridge
  • Solution ID - ID of the Solution provided by PrivMX Bridge during its initialization process
  • User Private Key - the private key from the user's public-private key pair

You also need to use your own application server to manage users (and their keys) and Contexts.

Setup a Project

Add a reference to the PrivMX Endpoint package in your existing or a new project. See Installation for available options and detailed steps.

Initial Assumptions

The initial assumptions for all the code examples below are as follows:

const string bridgeUrl = "BRIDGE_URL";
const string solutionId = "SOLUTION_ID";
const string contextId = "CONTEXT_ID";
 
const string userId = "USER_ID";
const string userPrivKey = "USER_PRIVATE_KEY";
const string userPubKey = "USER_PUBLIC_KEY";

All the values above like BRIDGE_URL, SOLUTION_ID, CONTEXT_ID should be replaced by the ones corresponding to your Bridge Server instance.

The private keys should be kept separately by each user and stored in a safe place, or generated from a password. For more information on how to obtain keys, see generatePrivateKey() and derivePrivateKey2() methods in the Crypto API.

Connecting to PrivMX Bridge

To connect to PrivMX, you must provide users's private key, solution ID and bridge URL. The user's private key does not leave the library. It is required to use asymmetric encryption and sign data.

Connection connection = 
    Connection.Connect(userPrivKey, solutionId, bridgeUrl);

Disconnecting from PrivMX Bridge

connection.Disconnect();

Next Steps

With everything ready to go, now it's time to start using all of the platform's capabilities.

Learn how to use:

  • Threads - for exchanging encrypted messages;
  • Stores - for saving and sharing encrypted files;
  • Inboxes - for one way communication with external users.

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.

On this page