MCPcopy Create free account
hub / github.com/bytespider/Meross / generateKeyPair

Function generateKeyPair

packages/lib/src/encryption.ts:89–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87}
88
89export async function generateKeyPair(): Promise<EncryptionKeyPair> {
90 const ecdh = createECDH('prime256v1');
91 ecdh.generateKeys();
92
93 const publicKey = ecdh.getPublicKey();
94 const privateKey = ecdh.getPrivateKey();
95
96 encryptionLogger.debug(`Generated key pair`, { publicKey, privateKey });
97
98 return {
99 privateKey,
100 publicKey,
101 };
102}
103
104export async function deriveSharedKey(
105 privateKey: Buffer,

Callers 3

meross-setup.tsFile · 0.90
meross-info.tsFile · 0.90
exchangeKeysMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected