0

Backbone.js로 작성된 Chrome 패키지 앱에 RSA 서명을 만들어야합니다. 내가 content_security_policy을 설정하려고Chrome 패키지 앱 보안 정책

Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an 
allowed source of script in the following Content Security Policy directive: 
"default-src 'self' chrome-extension-resource:". Note that 'script-src' was 
not explicitly set, so 'default-src' is used as a fallback. 

하지만, 패키지 애플리케이션과 함께 작동하지 않습니다 : 나는 jsrsasign를 사용할 때 그러나 나는 얻는다. 어떻게 해결할 수 있을까요?

var sig = new KJUR.crypto.Signature({"alg": "SHA1withRSA", "prov": "cryptojs/jsrsa"}); 

그리고 LIB 호출 평가입니다 : 문제가 발생

코드는 첫눈에

this.md = eval(KJUR.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[alg]).create(); 
+1

원래 라이브러리로 라이브러리를 전환하거나 [문제 제기] (https://github.com/kjur/jsrsasign/issues)를 시도 하시겠습니까? 앱 정책을 완화 할 수는 없습니다. – Xan

답변

1

, 당신이 도서관에서 그 라인을 패치 할 수 있음을 보인다

this.md = CryptoJS.algo[alg.toUpperCase()].create(); 
관련 문제