Import IKAR messenger client and server

This commit is contained in:
sevenhill
2026-10-07 22:06:07 +03:00
commit 69ea5091eb
1951 changed files with 424546 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
// Test key is held in memory only; the production app uses Android Keystore.
const crypto = require('node:crypto');
const readline = require('node:readline');
const key = crypto.generateKeyPairSync('ec', {namedCurve: 'prime256v1'});
const publicKey = key.publicKey.export({type: 'spki', format: 'der'});
console.log(JSON.stringify({installationId: crypto.createHash('sha256').update(publicKey).digest('hex').slice(0,32), devicePublicKey: publicKey.toString('base64')}));
readline.createInterface({input: process.stdin}).on('line', line => {
console.log(crypto.sign('sha256', Buffer.from(line, 'base64'), {key: key.privateKey, dsaEncoding: 'der'}).toString('base64'));
});