Passer au contenu

Chiffrement

This Documentation explains how to Migrer to the Chiffrement v2 system. Learn more À propos the Chiffrement v2 system in the blog post.

Terminal window
npx @capgo/cli key create

Store the private key securely. Never commit it to source control or share it with untrusted parties.

This Commande:

  • Creates a Nouveau key pair in your Application
  • Removes the old key from your Capacitor config
  • Keeps old key files for backward compatibility

When prompted “Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?”, select yes. This adds a new defaultChannel option to your Capacitor config.

capacitor.config.ts
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'com.example.app',
appName: 'Example App',
plugins: {
CapacitorUpdater: {
// ... other options
defaultChannel: 'encryption_v2' // New apps will use this channel
}
}
};
export default config;
Terminal window
npx @capgo/cli bundle upload --channel encryption_v2

Required for the defaultChannel option to work

Terminal window
npx @capgo/cli channel set encryption_v2 --self-assign
Terminal window
npx @capgo/cli bundle upload --channel production

Capacitor config is never uploaded to Capgo

Once all Utilisateurs have updated their apps:

  1. Remove defaultChannel from your Capacitor config
  2. Supprimer the old Canal:
Terminal window
npx @capgo/cli channel delete encryption_v2

Apps using encryption_v2 as default will switch to production channel after deletion