vibornoff / webcrypto-shim

Web Cryptography API shim for legacy browsers

Home Page:https://vibornoff.github.io/webcrypto-shim/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

not working on safari 9.1

oreporan opened this issue · comments

Added webcrypto-shim from npm:

"version": "0.1.1"

added to html file :

<script src="node_modules/webcrypto-shim/webcrypto-shim.js"></script>

I see it gets loaded and enters this code:

 if ( isWebkit ) {
        _crypto.subtle = _subtle;

        global.Crypto = _Crypto;
        global.SubtleCrypto = _SubtleCrypto;
        global.CryptoKey = CryptoKey;
    }

my code calls crypto.generateKey(algorithmKeyGen, true, ['sign'])
with these options:

   var algorithmKeyGen = {
            name: 'RSASSA-PKCS1-v1_5',
            modulusLength: 2048,
            publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
            hash: {
                name: 'SHA-256'
            }
        };

Getting this error (works on chrome) :

Failed to extract public key from keypair TypeError: undefined is not an object (evaluating 'b._key')