Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Openssl RSA asymmetric encryption, decryption, signature, signature verification

Shulou Source: shulou.com Published: 2022-06-03 05:25:01 10月03日 Update

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

Tags: Encryption public key character string data result content key success quantity identity identifier format certificate resource error guarantee generation original function Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology OPPO Reno macOS Apple MariaDB