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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user