Current location - Quotes Website - Personality signature - What are the java asymmetric encryption algorithms?
What are the java asymmetric encryption algorithms?
1. Initialize keys to construct key pairs, generate public keys and private keys, and save them in the key map.

Key pair generator->; key pair-& gt; RSAPublicKey、RSAPrivateKey

2. Party A encrypts the encrypted data with the private key, and then signs the encrypted data with the private key and sends it to Party B.

RSA coder . encryptbyprivatekey(data,privateKey);

RSACoder.sign(encodedData,private key);

3. Party B verifies the signed encrypted data through the public key, and decrypts the encrypted data through the public key if the verification is correct.

RSACoder.verify(encodedData,publicKey,sign);

RSA coder . decryptbypublickey(encoded data,public key);

4. Party B sends it to Party A through public key encryption.

RSA coder . encryptbypublickey(decode ddata,public key);

5. Party A decrypts the data through the private key.

RSA coder . decryptprivatekey(encoded data,private key);