Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pure JavaScript public key #25

Merged
merged 1 commit into from
Nov 29, 2014
Merged

Pure JavaScript public key #25

merged 1 commit into from
Nov 29, 2014

Conversation

thom4parisot
Copy link
Owner

thom4parisot pushed a commit that referenced this pull request Nov 29, 2014
@thom4parisot thom4parisot merged commit 93f422e into master Nov 29, 2014
@thom4parisot thom4parisot deleted the feature-rsajs branch November 29, 2014 15:54
@joscha
Copy link
Collaborator

joscha commented Nov 30, 2014

With this, I get

Writing build/my-extension-2.0.10.zip...OK
Fatal error: encoding too long
InvalidAsn1Error: encoding too long
    at module.exports.newInvalidAsn1Error (/Users/joscha/Development/mailbutler/extension/node_modules/grunt-crx/node_modules/crx/node_modules/node-rsa/node_modules/asn1/lib/ber/errors.js:7:13)
    at Reader.readLength (/Users/joscha/Development/mailbutler/extension/node_modules/grunt-crx/node_modules/crx/node_modules/node-rsa/node_modules/asn1/lib/ber/reader.js:94:13)
    at Reader.readSequence (/Users/joscha/Development/mailbutler/extension/node_modules/grunt-crx/node_modules/crx/node_modules/node-rsa/node_modules/asn1/lib/ber/reader.js:127:16)
    at Object.module.exports.privateImport (/Users/joscha/Development/mailbutler/extension/node_modules/grunt-crx/node_modules/crx/node_modules/node-rsa/src/formats/pkcs1.js:63:16)
    at Object.module.exports.detectAndImport (/Users/joscha/Development/mailbutler/extension/node_modules/grunt-crx/node_modules/crx/node_modules/node-rsa/src/formats/formats.js:62:48)
    at NodeRSA.module.exports.NodeRSA.importKey (/Users/joscha/Development/mailbutler/extension/node_modules/grunt-crx/node_modules/crx/node_modules/node-rsa/src/NodeRSA.js:177:22)
    at new NodeRSA (/Users/joscha/Development/mailbutler/extension/node_modules/grunt-crx/node_modules/crx/node_modules/node-rsa/src/NodeRSA.js:67:18)
    at /Users/joscha/Development/mailbutler/extension/node_modules/grunt-crx/node_modules/crx/src/crx.js:166:17
    at $$$internal$$initializePromise (/Users/joscha/Development/mailbutler/extension/node_modules/grunt-crx/node_modules/crx/node_modules/es6-promise/dist/es6-promise.js:351:9)
    at new $$es6$promise$promise$$Promise (/Users/joscha/Development/mailbutler/extension/node_modules/grunt-crx/node_modules/crx/node_modules/es6-promise/dist/es6-promise.js:657:9)

with the error InvalidAsn1Error: encoding too long in line

var key = new RSA(privateKey, 'pkcs1-private-pem');

do I have to regenerate my private key in a special format?

@joscha
Copy link
Collaborator

joscha commented Nov 30, 2014

Nevermind. After using crx keygen . and generating a new private key, it seems to work...

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

Successfully merging this pull request may close these issues.

Pure JavaScript RSA generation
2 participants