Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Uncaught TypeError: Cannot read property 'toString' of undefined #31

Open
ckproduct opened this issue Aug 15, 2017 · 3 comments
Open

Uncaught TypeError: Cannot read property 'toString' of undefined #31

ckproduct opened this issue Aug 15, 2017 · 3 comments

Comments

@ckproduct
Copy link

Uncaught TypeError: Cannot read property 'toString' of undefined
at Object.a.publicKeyString (cryptico.min.js:105)

I put a KeyString to cryptico.publicKeyString()
and It just happen

@comrat
Copy link

comrat commented Sep 12, 2018

Can you provide some code if issue is still actual of cause =)
I've same issue because of treating RSA key from method generateRSAKey as string but its object and publicKeyString expect object

@awdDev786
Copy link

i have same issue.in my case m copying the result of generateRSAKey into publicKeyString function as follows.

  var key=cryptico.generateRSAKey(PassPhrase, Bits);
  console.log(key);//copied the key from console and pasted below.
  var publicKey = cryptico.publicKeyString();

while passing key variable is working well.

@comrat
Copy link

comrat commented Sep 24, 2018

@awdDev786 you should pass a key in publicKeyString it will not work without it. Here is its implementation in cryptico.js:

    // Returns the ascii-armored version of the public key.
    my.publicKeyString = function(rsakey) 
    {
        pubkey = my.b16to64(rsakey.n.toString(16));
        return pubkey; 
    }

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