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

Can not support PrivateKey encrypt and PublicKey decrypt #259

Open
jackieonway opened this issue Sep 13, 2022 · 2 comments
Open

Can not support PrivateKey encrypt and PublicKey decrypt #259

jackieonway opened this issue Sep 13, 2022 · 2 comments

Comments

@jackieonway
Copy link

jackieonway commented Sep 13, 2022

i can not use this to encrypt data by private key and decrypt data by public key. such as

 const encryptor = new JSEncrypt();
 encryptor.setPrivateKey(privateKey); // set private key;
 return encryptor.encrypt(data);
    const decryptor = new JSEncrypt()
    decryptor.setPublicKey(publicKey)// set public key
    return  decryptor.decrypt(data)
@jackieonway jackieonway changed the title Can not support PrivateKey encrypt and PublicKey denrypt Can not support PrivateKey encrypt and PublicKey decrypt Sep 13, 2022
@tonychanczm
Copy link

Why not use sign()?

@trasherdk
Copy link

What's the point of encrypting something to be decrypted by a public key? Keyword here is public

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

No branches or pull requests

3 participants