Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Javascript runtime error: 'Jose' is undefined in IE #38

Closed
Rajeshkumar123 opened this issue Apr 27, 2016 · 3 comments
Closed

Javascript runtime error: 'Jose' is undefined in IE #38

Rajeshkumar123 opened this issue Apr 27, 2016 · 3 comments

Comments

@Rajeshkumar123
Copy link

Hi,

I am using Jose to encrypt the json data purpose. I have referred the following plugins in my code

<script src="@Url.Content("~/Content/External/Scripts/joseEncryption/promiz.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Content/External/Scripts/joseEncryption/webcrypto-shim.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Content/External/Scripts/joseEncryption/jose.js")" type="text/javascript"></script>

My code is:

crypto = new Jose.WebCryptographer();
            crypto.setKeyEncryptionAlgorithm("RSA-OAEP-256");
            crypto.setContentEncryptionAlgorithm("A128CBC-HS256");
            rsa_key = Jose.Utils.importRsaPublicKey(rsa_key, "RSA-OAEP-256");
            encrypt = new JoseJWE.Encrypter(crypto , rsa_key);

The above code is working fine in chrome browser but I am getting this error Javascript runtime error: 'Jose' is undefined in IE 11 browser.

Am I missing anything or do I need to include any additional script reference to overcome this issue.

Thanks in advance

@wfortin
Copy link

wfortin commented Feb 9, 2017

I'm having the same issue. Would adding a polyfill to the WebCrypto API fix this?

@Rajeshkumar123 did you ever find a workaround this?

@wfortin
Copy link

wfortin commented Feb 10, 2017

After adding webcrypto-shim I don't get this error anymore.

@Rajeshkumar123
Copy link
Author

@wfortin Thank you so much for your work around. Let me give a try on this...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants