Uncaught TypeError: cb is not a function
See original GitHub issueI’m having some trouble implementing both signing and encryption at the same time (probably due to tiredness). The below code gives the above error but I’m not really sure why, if anyone could help me out that would be great, I’m super rusty with Javascript.
var signencryptionButton = $("#signencryption-button");
signencryptionButton.click(function(){
var signencryptionPlainText = $("#signencryption-plain-text");
var signencryptionEncryptedText = $("#signencryption-encrypted-text");
var signencryptionReceiversPublicKey = $("#signencryption-receivers-public-key");
var sign2PrivateKey = $("#sign2private-Key");
var sign2Passphrase = $("#sign2-passphrase");
// import receiver's public key
var receiver = kbpgp.KeyManager.import_from_armored_pgp({
armored: signencryptionReceiversPublicKey.val()});
var currUser = kbpgp.KeyManager.import_from_armored_pgp({
armored: sign2PrivateKey.val()});
currUser.unlock_pgp({
passphrase: sign2Passphrase.val()});
// encrypt the message
var params = {
msg: signencryptionPlainText.val(),
encrypt_for: receiver,
sign_with: currUser
};
kbpgp.box(params, function(err, result_string, result_buffer) {
console.log(err, result_string, result_buffer);
signencryptionEncryptedText.val(result_string);
});
});
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
TypeError: cb is not a function - javascript - Stack Overflow
1. You aren't passing any cb s to any of the three functions that require a callback as a second parameter. – CertainPerformance...
Read more >TypeError: cb is not a function #917 - tediousjs/tedious - GitHub
Hi @Steexyz, for the 'cb' function issue, there is a change under PR #845 that has been recently merged into master which introduce...
Read more >Uncaught TypeError: cb is not a function - Espruino Forum
Hi, i am working on a little project which involves controlling the puck from a web browser. i have came across this error...
Read more >How I fixed a "cb.apply is not a function" error while using ...
I regularly use Gitbook, a little Node.js software used to generate an ebook from a set of markdown files. I use it for...
Read more >TypeError: callback is not a function in JavaScript | bobbyhadz
The "callback is not a function" error occurs when we define a callback parameter to a function, but invoke the function without passing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I feel a little bit proud saying that despite not knowing any Javascript before a few days ago, I figured it out alone, yay.
It’s now live on the site! https://thechiefmeat.github.io/pgp/
Whoops, didn’t mean to close the issue :S
Closest I have so far is:
With this it no longer complains about any errors, and the keys appear to be loaded, but it doesn’t do anything after that.