1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 14:23:32 +00:00

extract public from private key

This commit is contained in:
Kyle Spearrin
2018-07-02 23:53:44 -04:00
parent e22915818c
commit 2bc7ae0da2
5 changed files with 49 additions and 1 deletions

View File

@@ -161,6 +161,15 @@ describe('NodeCrypto Function Service', () => {
});
});
describe('rsaExtractPublicKey', () => {
it('should successfully extract key', async () => {
const nodeCryptoFunctionService = new NodeCryptoFunctionService();
const privKey = Utils.fromB64ToArray(RsaPrivateKey);
const publicKey = await nodeCryptoFunctionService.rsaExtractPublicKey(privKey.buffer);
expect(Utils.fromBufferToB64(publicKey)).toBe(RsaPublicKey);
});
});
describe('randomBytes', () => {
it('should make a value of the correct length', async () => {
const nodeCryptoFunctionService = new NodeCryptoFunctionService();