Skip to content

Registering

All participants need to create an account on the Cosmian platform by visiting https://console.cosmian.com to create their accounts. Then all participants need to register on the computation according to the role given to them by the computation owner. Note: if a participant shares multiple roles, it should register for each role.

Register as code provider

# register.py
from cosmian_secure_computation_client import CodeProviderAPI
import subprocess

# replace with your computation id
computation_uuid = "xxxxxxxxxxxxxxxxxxxxxx"
cp_cosmian_token = environ.get('CP_COSMIAN_TOKEN')
code_provider_name = "Jane Doe"
code_provider_email = "code.provider@email.com"
code_provider = CodeProviderAPI(cp_cosmian_token)

subprocess.Popen(['gpg', '--batch', '--passphrase', '', '--quick-generate-key', f'{code_provider_name} <{code_provider_email}>', 'ed25519', 'cert', 'never'], stdout=subprocess.PIPE,  stderr=subprocess.PIPE, universal_newlines=True).communicate()
public_key, stderr = subprocess.Popen(['gpg', '--export', '--armor', code_provider_email], stdout=subprocess.PIPE,  stderr=subprocess.PIPE, universal_newlines=True).communicate()

computation = code_provider.register(computation_uuid, public_key)

PGP keys must be unique inside a computation

If you share multiple roles in the computation, you must use different PGP key for each role. You can generate a new PGP key for an alias of your email address “john+data_provider@example.org”.

import subprocess
subprocess.Popen(['gpg', '--batch', '--passphrase', '', '--quick-generate-key', 'John Doe <john@example.org>', 'ed25519', 'cert', 'never'], stdout=subprocess.PIPE,  stderr=subprocess.PIPE, universal_newlines=True).communicate()
public_key, stderr = subprocess.Popen(['gpg', '--export', '--armor', 'john@example.org'], stdout=subprocess.PIPE,  stderr=subprocess.PIPE, universal_newlines=True).communicate()

Register as data provider

# register.py

from cosmian_secure_computation_client import DataProviderAPI
import subprocess

# replace with your computation id
computation_uuid = "xxxxxxxxxxxxxxxxxxxxxx"
dp_cosmian_token = environ.get('DP_COSMIAN_TOKEN')
data_provider_name = "Jon Doe"
data_provider_email = "data.provider.1@email.com"
data_provider = DataProviderAPI(dp_cosmian_token)

subprocess.Popen(['gpg', '--batch', '--passphrase', '', '--quick-generate-key', f'{code_provider_name} <{code_provider_email}>', 'ed25519', 'cert', 'never'], stdout=subprocess.PIPE,  stderr=subprocess.PIPE, universal_newlines=True).communicate()
public_key, stderr = subprocess.Popen(['gpg', '--export', '--armor', code_provider_email], stdout=subprocess.PIPE,  stderr=subprocess.PIPE, universal_newlines=True).communicate()

computation = data_provider.register(computation_uuid, public_key)

PGP keys must be unique inside a computation

If you share multiple roles in the computation, you must use different PGP key for each role. You can generate a new PGP key for an alias of your email address “john+data_provider@example.org”.

import subprocess
subprocess.Popen(['gpg', '--batch', '--passphrase', '', '--quick-generate-key', 'John Doe <john@example.org>', 'ed25519', 'cert', 'never'], stdout=subprocess.PIPE,  stderr=subprocess.PIPE, universal_newlines=True).communicate()
public_key, stderr = subprocess.Popen(['gpg', '--export', '--armor', 'john@example.org'], stdout=subprocess.PIPE,  stderr=subprocess.PIPE, universal_newlines=True).communicate()

Register as data consumer

# register.py

from cosmian_secure_computation_client import ResultConsumerAPI
import subprocess

# replace with your computation id
computation_uuid = "xxxxxxxxxxxxxxxxxxxxxx"
rc_cosmian_token = environ.get('RC_COSMIAN_TOKEN')
data_provider_name = "Jade Doe"
data_provider_email = "result.consumer.1@email.com"
data_provider = ResultConsumerAPI(rc_cosmian_token)

subprocess.Popen(['gpg', '--batch', '--passphrase', '', '--quick-generate-key', f'{code_provider_name} <{code_provider_email}>', 'ed25519', 'cert', 'never'], stdout=subprocess.PIPE,  stderr=subprocess.PIPE, universal_newlines=True).communicate()
public_key, stderr = subprocess.Popen(['gpg', '--export', '--armor', code_provider_email], stdout=subprocess.PIPE,  stderr=subprocess.PIPE, universal_newlines=True).communicate()

computation = data_provider.register(computation_uuid, public_key)

PGP keys must be unique inside a computation

If you share multiple roles in the computation, you must use different PGP key for each role. You can generate a new PGP key for an alias of your email address “john+data_provider@example.org”.

import subprocess
subprocess.Popen(['gpg', '--batch', '--passphrase', '', '--quick-generate-key', 'John Doe <john@example.org>', 'ed25519', 'cert', 'never'], stdout=subprocess.PIPE,  stderr=subprocess.PIPE, universal_newlines=True).communicate()
public_key, stderr = subprocess.Popen(['gpg', '--export', '--armor', 'john@example.org'], stdout=subprocess.PIPE,  stderr=subprocess.PIPE, universal_newlines=True).communicate()