diff --git a/sign.md b/sign.md index e47ecd3b4ebdf28396964d29fac6654471939408..ae2bafe2f76aeccc5f307344f22fce80be0a0f76 100644 --- a/sign.md +++ b/sign.md @@ -1,49 +1,79 @@ -# To add your plugin built on Jami, you need to sign it with certificates. +# Certifying and Adding Your Plugin to Jami + +To add your plugin built on Jami, you need to certify it by signing it with keys and certificates. + +First, you will generate a unique developer key and certificate, which will be used to create a certificate for each plugin. Then, you will sign your plugin archive (.jpl) using the plugin’s certificate key. + +After that, you will be able to add your signed plugin to Jami. ## Create a directory to store them: -``` +```bash mkdir -p jami-plugins/certificate ``` -## In a Python environment (recommended) install the requirements: +## Install the Required Dependencies -``` +Install the necessary dependencies in a Python environment: + +```bash cd jami-plugins/SDK pip install -r requirements.txt pip install -r certificate_requirements.txt pip install requests ``` -## Create the certificates: +## Create the Developer Key and Certificate -``` -python3 ./certKey.py create --subject PluginName ../certificate/ +Generate a unique developer certificate: + +```bash +./certKey.py create --subject <YourName> ../certificate/<YourName> ``` -## Verify the certificates: +## Create the Plugin Certificate -``` -openssl x509 -in ../certificate/certificate.crt -text -noout +Use the developer certificate to create a plugin-specific certificate: + +```bash +./certKey.py create --issuer ../certificate/<YourName> --subject <YourPlugin> ../certificate/<YourPlugin> ``` -## Sign the plugin (certKey.py will automatically add the `.crt` and `.jpl` extensions): +## Verify the Certificates -``` -python3 ./certKey.py --plugin sign --issuer <Path to your certificate without the ".crt"> --path <path to your plugin.jpl> <path to your signed plugin output without the ".jpl"> +To verify the content of a certificate: + +```bash +openssl x509 -in ../certificate/<CertificateName.crt> -text -noout ``` -For example: +## Sign the Plugin +Sign your plugin archive using the created certificate: + +```bash +python3 ./certKey.py --plugin sign --issuer ../certificate/<YourPlugin> --path ../build/<your distribution>/<YourPlugin.jpl> ../build/<your distribution>/signed/<YourPluginSigned> ``` -python3 ./certKey.py --plugin sign --issuer ../certificate/certificate --path ../build/x86_64-linux-gnu/AutoAnswer.jpl ../build/x86_64-linux-gnu/signed/AutoAnswerSigned -``` -## Display the signed files: +## Complete example with developer=Alexandre, plugin=AudioFilter, distribution=x86_64-linux-gnu: + +```bash +python3 ./certKey.py create --subject Alexandre ../certificate/Alexandre +python3 ./certKey.py create --issuer ../certificate/Alexandre --subject AudioFilter ../certificate/AudioFilter + +python3 ./certKey.py --plugin sign --issuer ../certificate/AudioFilter --path ../build/x86_64-linux-gnu/AudioFilter.jpl ../build/x86_64-linux-gnu/signed/AudioFilterSigned ``` + +## Display the Signed Files + +Verify that the signed file is generated correctly: + +```bash ls ../build/<your distribution>/signed ``` -## You can now add your signed `.jpl` plugin to Jami. +## Add Your Plugin to Jami + +You can now add your signed `.jpl` archive to Jami.