Enable End-to-End Encryption (E2EE) Using SSL

Replication synchronization streams can be encrypted end-to-end from the client to Unwired Server. You can configure the application to make these secure, encrypted connections.

This code example executes only the first time the application runs (DataVault.exists returns false) as part of application initialization.

The first two statements set up the UltraLite database to be encrypted (with the password "secret"), and the 4th and 5th statements set up synchronization to use E2EE. Statements 3 and 6 persist the settings. The last statement creates the encrypted database and uses E2EE for initial synchronization.

The e2ee_public_key is a file containing the server's PEM-encoded public key for end-to-end encryption.

The e2ee_type specifies the asymmetric algorithm to use for key exchange for end-to-end encryption. The value for e2ee_type must be either rsa or ecc, and must match the value specified on the server.

Sybase.Persistence.ConnectionProfile cp = MyDB.GetConnectionProfile();
cp.SetEncryptionKey("secret");
cp.Save();
Sybase.Persistence.ConnectionProfile sp = MyDB.GetSynchronizationProfile();
sp.NetworkStreamParams="tls_type=rsa;trusted_certificates=c:\\tmp\\https_public_cert.crt;e2ee_type=rsa;e2ee_public_key=c:\\e22_public.pem";
sp.Save();
MyDB.LoginToSync(...);