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

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