openssl_x509_export

(PHP 4 >= 4.2.0, PHP 5, PHP 7) Exports a certificate as a string bool openssl_x509_export ( mixed $x509, string &$output [, bool $notext = TRUE ] ) openssl_x509_export() stores x509 into a string named by output in a PEM encoded format. Parameters: x509 See Key/Certificate parameters for a list of valid values. output On success

openssl_x509_export_to_file

(PHP 4 >= 4.2.0, PHP 5, PHP 7) Exports a certificate to file bool openssl_x509_export_to_file ( mixed $x509, string $outfilename [, bool $notext = TRUE ] ) openssl_x509_export_to_file() stores x509 into a file named by outfilename in a PEM encoded format. Parameters: x509 See Key/Certificate parameters for a list of valid values. outfilename

openssl_spki_verify

(PHP 5 >= 5.6.0, PHP 7) Verifies a signed public key and challenge string openssl_spki_verify ( string &$spkac ) Validates the supplied signed public key and challenge Parameters: spkac Expects a valid signed public key and challenge Returns: Returns a boolean on success or failure. Exception: Emits an E_W

openssl_verify

(PHP 4 >= 4.0.4, PHP 5, PHP 7) Verify signature int openssl_verify ( string $data, string $signature, mixed $pub_key_id [, mixed $signature_alg = OPENSSL_ALGO_SHA1 ] ) openssl_verify() verifies that the signature is correct for the specified data using the public key associated with pub_key_id. This must be the public key corresponding to the private key used for signing. Parameters:

openssl_spki_export

(PHP 5 >= 5.6.0, PHP 7) Exports a valid PEM formatted public key signed public key and challenge string openssl_spki_export ( string &$spkac ) Exports PEM formatted public key from encoded signed public key and challenge Parameters: spkac Expects a valid signed public key and challenge Returns: Returns the associated PEM formatted public k

openssl_spki_export_challenge

(PHP 5 >= 5.6.0, PHP 7) Exports the challenge assoicated with a signed public key and challenge string openssl_spki_export_challenge ( string &$spkac ) Exports challenge from encoded signed public key and challenge Parameters: spkac Expects a valid signed public key and challenge Returns: Returns the associated challenge string or NULL on

openssl_spki_new

(PHP 5 >= 5.6.0, PHP 7) Generate a new signed public key and challenge string openssl_spki_new ( resource &$privkey, string &$challenge [, int $algorithm = 0 ] ) Generates a signed public key and challenge using specified hashing algorithm Parameters: privkey privkey should be set to a private key that was previously generated by openssl_pkey_new() (or otherwi

openssl_sign

(PHP 4 >= 4.0.4, PHP 5, PHP 7) Generate signature bool openssl_sign ( string $data, string &$signature, mixed $priv_key_id [, mixed $signature_alg = OPENSSL_ALGO_SHA1 ] ) openssl_sign() computes a signature for the specified data by generating a cryptographic digital signature using the private key associated with priv_key_id. Note that the data itself is not encrypted. Parameters:

openssl_random_pseudo_bytes

(PHP 5 >= 5.3.0, PHP 7) Generate a pseudo-random string of bytes string openssl_random_pseudo_bytes ( int $length [, bool &$crypto_strong ] ) Generates a string of pseudo-random bytes, with the number of bytes determined by the length parameter. It also indicates if a cryptographically strong algorithm was used to produce the pseudo-random bytes, and does this via the optional crypto_strong parameter. It's rare for

openssl_public_decrypt

(PHP 4 >= 4.0.6, PHP 5, PHP 7) Decrypts data with public key bool openssl_public_decrypt ( string $data, string &$decrypted, mixed $key [, int $padding = OPENSSL_PKCS1_PADDING ] ) openssl_public_decrypt() decrypts data that was previous encrypted via openssl_private_encrypt() and stores the result into decrypted. You can use this function e.g. to check if the message was written by the owner of the private key.