Openssl RSA asymmetric encryption, decryption, signature, signature verification
Openssl series functions that you need to know first
Openssl_pkey_get_private parses the private key from the certificate for use. If successful, the real key resource identifier (Resource ID) is returned, otherwise falseopenssl_pkey_get_public is returned to parse the public key from the certificate for use. If successful, the real key resource identifier (ResourceID) is returned, otherwise falseopenssl_private_encrypt ($data, $encrypted, $privateKeyResourceID, OPENSSL_PKCS1_PADDING) / / encrypts the data data using the private key key and saves the result to the variable crypted openssl_public_decrypt ($encrypted), $decrypted, $publicKeyResourceID, OPENSSL_PKCS1_PADDING) / / the private key encrypted content is decrypted through the public key