logo

Crypto

This is a collection of functions for working with FCM crypto.

Create ECDH

The createFcmECDH functions creates a new ECDH instance with the prime256v1 curve and generates a new key pair.

import { createFcmECDH } from '@aracna/fcm';

const ecdh = createFcmECDH();

// will log ECDH
console.log(ecdh);

Generate Auth Secret

The generateFcmAuthSecret function generates a new FCM auth secret.

import { generateFcmAuthSecret } from '@aracna/fcm';

const authSecret = generateFcmAuthSecret();

// will log Uint8Array
console.log(authSecret);