--TEST-- openssl_csr_get_public_key() tests --SKIPIF-- --FILE-- $phex, 'g' => '2'); $dh = openssl_pkey_new(array( 'dh'=> array('p' => hex2bin($phex), 'g' => '2')) ); $dn = array( "countryName" => "BR", "stateOrProvinceName" => "Rio Grande do Sul", "localityName" => "Porto Alegre", "commonName" => "Henrique do N. Angelo", "emailAddress" => "hnangelo@php.net" ); $args = array( "digest_alg" => "sha1", "private_key_bits" => 2048, "private_key_type" => OPENSSL_KEYTYPE_DSA, "encrypt_key" => true, "config" => $config, ); $privkey_file = 'file://' . __DIR__ . '/private_rsa_2048.key'; $csr = openssl_csr_new($dn, $privkey_file, $args); $csr_file = file_get_contents(__DIR__ . '/cert.csr'); var_dump(openssl_csr_get_public_key($csr)); var_dump(openssl_csr_get_public_key($csr_file)); ?> --EXPECTF-- resource(%d) of type (OpenSSL key) resource(%d) of type (OpenSSL key)