PAAS-client Pseudonym Service
The PAAS client is a library to interact with PAAS servers or transcryptors, wrapping around libpep (and libpep-wasm).
It is available in Rust and JS/TS.
For the Rust client, there is also a paascli binary available.
Installation
The JS/TS client is available here
To install it, run:
npm install @nolai/paas-client @nolai/libpep-wasm
or
yarn add @nolai/paas-client @nolai/libpep-wasm
The Rust client is available here
To install it, run:
cargo install paas-client
Usage
We provide a simple example of how to use the client, in typescript. The usage is similar in Rust.
const config: PseudonymServiceConfig = {
blindedGlobalPrivateKey: BlindedGlobalSecretKey.fromHex(
"dacec694506fa1c1ab562059174b022151acab4594723614811eaaa93a9c5908",
),
globalPublicKey: GlobalPublicKey.fromHex(
"3025b1584bc729154f33071f73bb9499509bb504f887496ba86cb57e88d5dc62",
),
transcryptors: [
new TranscryptorConfig("test_system_1", "http://localhost:8080"),
new TranscryptorConfig("test_system_2", "http://localhost:8081"),
],
};
const authTokens = new Map(
[["test_system_1", "test_token_1"], ["test_system_2", "test_token_2"],],
)
const encryptedPseudonym = EncryptedPseudonym.fromBase64(
"nr3FRadpFFGCFksYgrloo5J2V9j7JJWcUeiNBna66y78lwMia2-l8He4FfJPoAjuHCpH-8B0EThBr8DS3glHJw==",
);
const sessions = new Map(
[["test_system_1", "session_1"], ["test_system_2", "session_2"],],
);
const domainFrom = "domain1";
const domainTo = "domain2";
const service = new PseudonymService(config, authTokens);
const result = await service.pseudonymize(
encryptedPseudonym,
sessions,
domainFrom,
domainTo,
);
const pseudonym = await service.decryptPseudonym(result);
console.log(pseudonym.asHex())
The rust binary paascli is available to interact with the PAAS server.
For example run the following command to pseudonymize an encrypted pseudonym from domain1 to domain2:
Or during development, you can run: