Display the drop-down list

openssl_pkey_new()

« openssl_pkey_get_public | openssl_private_decrypt »
<?php
$resource 
openssl_pkey_new (
    
  // [array $configargs]
);

// shows the key details, plus the rsa, dsa or dh key details in hexadecimal
if ($resource) {
    
$array openssl_pkey_get_details($resource);
    
$hex array_map("bin2hex"$this->result["array"]["rsa"]);
}
?>
Result
$resource = 'OpenSSL key ressource'
$array = [
  
'bits' => 4096,
  
'key' => '-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2FZ0sKYmefbqB+TDF5K6
VxOx82lEzU57lQzIyPZNOCCxDN+4C8x3je18RbftVngYNq/4NSCUyhmTl4ycu8KO
ZjPLIlMd6R7++09TJcZQJHqutGHXh+RIVvqJXfgh+OtwLP9YGVmIJ6KpCG1U2hJf
SP6E/ZAb8hEwBNFLD+VI0OcXfTQ8rrxfl5HvK7avf2PvX/KQK+vd99jiaPYcQn8r
PzHZvXIG8Z49SkFYwramrXDc29w/lcpNBhAmXXcIYk8hGFsaqFTr0I9N8FmwlA+J
INDkW9JDf5WlCn8ECvwh4vAtW8YLT4pl5oUFBm60+6LoOBaCjjN6b5w+RhnOQIDc
JwEXJiH319ADmnnaOs0K+iPk2SwYAcqLm7+2Dk860+rrpseNOt4/8gTYGVlwGT4f
j+0kOQkwGYdaKhXQJCJI5g1aVZoGpdQZLY0gE9vjbn1SBXdJM2liM5cWvit50dFo
WgLYkzc3Tk6LIPemx2C/WOlwGRDzQBISC9cem3GD7w0oCQjZoVS28HZ9iSbhABQ7
vefq6i9sFYR6QvxPlDmHznr8MAKVn6bZPF4ALUocrqq1POM5CM30BSmRv+fCmOU4
9czOejdCkBAqAF41+lP5QkPyDH2PrKMm2/MzVBvKgMEpl6WoHvisV0VgevWq/B/3
6+XulLnnFUGHBXqJOIudefsCAwEAAQ==
-----END PUBLIC KEY-----
'
,
  
'rsa' => [
    
'n' => 'Vt&yWiDN{ M8  ߸ w|EVx65 Žf3"SOS%P$za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qmp' => 'ԧ(@/ɈpؘI@ci|MϚ9wW~\\`~<4/(eFB
,OR,Npf
vzY-}H]ZZp \'SP7' 
"\0" 'bL%|T<Fzly#pw3#ڧ%.F5yײ0&mY5"*T( xa{|hU}6ΏdT[( dRg ^"a4',
  ],
  
'type' => 0,
]
$hex = [
  
'n' => 'd85674b0a62679f6ea07e4c31792ba5713b1f36944cd4e7b950cc8c8f64d3820b10cdfb80bcc778ded7c45b7ed56781836aff8352094ca1993978c9cbbc28e6633cb22531de91efefb4f5325c650247aaeb461d787e44856fa895df821f8eb702cff5819598827a2a9086d54da125f48fe84fd901bf2113004d14b0fe548d0e7177d343caebc5f9791ef2bb6af7f63ef5ff2902bebddf7d8e268f61c427f2b3f31d9bd7206f19e3d4a4158c2b6a6ad70dcdbdc3f95ca4d0610265d7708624f21185b1aa854ebd08f4df059b0940f8920d0e45bd2437f95a50a7f040afc21e2f02d5bc60b4f8a65e68505066eb4fba2e83816828e337a6f9c3e4619ce4080dc2701172621f7d7d0039a79da3acd0afa23e4d92c1801ca8b9bbfb60e4f3ad3eaeba6c78d3ade3ff204d8195970193e1f8fed2439093019875a2a15d0242248e60d5a559a06a5d4192d8d2013dbe36e7d52057749336962339716be2b79d1d1685a02d89337374e4e8b20f7a6c760bf58e9701910f34012120bd71e9b7183ef0d280908d9a154b6f0767d8926e100143bbde7eaea2f6c15847a42fc4f943987ce7afc3002959fa6d93c5e002d4a1caeaab53ce33908cdf4052991bfe7c298e538f5ccce7a374290102a005e35fa53f94243f20c7d8faca326dbf333541bca80c12997a5a81ef8ac5745607af5aafc1ff7ebe5ee94b9e7154187057a89388b9d79fb',
  
'e' => '010001',
  
'd' => 'c3822684ba330d881a6a35d025cea17e2e3b64aa1ed697f5d176b342026d38ab3ab652bc46556b3a2584689156f90d217cd2bcb26e9668aa829ab425b4fd97a93f6775c6bdc23f13da540ee5957a39ed71536d14d6277544bdb844e708f4a6f9428124c20c0aa31f3a39766cf78320ff9b9cde764cfb0f9360d73049d6415f216935ea6e68cfae6811279f4ec2fd9277f333081dd9544937852dac354fd71363520ee0495b8322296ba0f0b14f56046a79fe6be63edd8b8c4e2e0dcb94151c43e179fbf662809683dbc0b99d7dc1288132a71d604145dd1c410716c542a4f12d73207c331e98098d316ba02b8e7dd6f49c33a39b1564b1d6f6e46d4fdb35593e7096057b8981759435da4e5d8fea2358805f42a43c12a7036a90eeb4a87b42066ddcee8a904d16fea7a9ebd217bfbe3d1e6ba439b391af3fd6f07eb2e30ff21bb91ca7e2ceff17fcc10a99b61edc1bb61595ddecbe1dbdeeb4c8b2b8e6a3101168ccdd2369034f81862d799c78487ede8398b6b6f7769fd166bd0e9f60b057bf812f6b369b7ab0f569e0dbe4dd6c10b4263cfa37ce9b075174eb86fedb3b039f55b4419d519413bd4a91f58b26d19208f5a90c90a16d7a1f559c4fa8efe40c1c538577eae40844b7ad49c5a893e11f12acda4331630d4592cb719f08e22c6a3efb1ca97d861d85aab2c18f9642e2aa8fb692f3995a1401698fb5032b32f9cf19',
  
'p' => 'f8cf55572f63b4d604573d55cdd1152612fadbf60e80e564796c9e820398456d32534a3d4b0899d4f1ecd47a30e737ef3fdecd684ba1c8b81fd00547f4cbc8a42628fb53866c092635ec80bb15ef367cacc9c689a7ffaff88410c9fa8ef678d51017c5f9cb7290c0cc89dffe9b6730fcf3a05ea80154612c193ef48e52e54703bc3aab60caacdeb06bdd82c08f4f08be8eb4cdfdf8673e77ee73263e47b36eef9ec9c1a7624cbab7157a15d6d30b8c3bc4304fc07dd1abc1d64cb2c87910e661ee9a2cad90ca0a2787c668ebfe7195c72890dd8531afa9bc273777218acdece8fc7cd36066ea3364783ee42b11530a0d8852511334bfd45aefb052af2866e1a7',
  
'q' => 'de96e5a63ded2cc69ac32077aef7366208e6d1c0e6db6a7b0f3c61cda492543d498a4ee9ec088ca60b20a5ea04c5ca5dac56ad41f2d32f507f84f2a89cf0faa9216577af2352ae149b1639021ec4f6a95b457a517e27210e0c33ea8d50de5240b7563e364b091e9830035395cc3e3431e47e02f8d6b1efeda95dcd731a5b0dcfb757d41f4e543d3680b5e627fb4d5175e1703c337d0c4a0fb610bfeddda0a187262dc6c1bfb42ec6819a8c7eaf22c8e1877491a93f034b8a3794b5552342eb29e8373c61827d9965d66de797fe90c6e054c67bd9f4dc3921051c4f1c8515809652355775d01a915aa96528d403e2289cb0f5b4ba17a820d40f546f0bd3af678d',
  
'dmp1' => '7eee77212561fe6d7885711b0706f57d190db58d8fd49e3265e7cded921beabf4c7f454e83aafd9faf541d09c14d14321029802d06f8a0479ea3272e906a2e0fe00fe437b64a0358e505a49ecd0fde82383c2ff72627c1044d8bab1f1234176ccaeaf5eafba994c36715a79a6279807a6b679322ae9af77fe1d946361d802e7c6f5896f9a82c0ce77fffdfa690f5c7064013694b79a062341907d1a8d037700efab8fefc7f9f9959b1b138d7018fd098e4fba894111c183da93033bd265642d20f41c42d3fc272efbbcab2d842547c0ec0593749ae1169cc3d4d848f2e1ae413f04b5622c61e10dddea26710b9a3dd6b0df2c0bdc5995fa28cc92d45829d09dd',
  
'dmq1' => '6963dcfc275a02d74e33914dd9a3e735e7ad122759a70df592332ec3a5663b4881676111d4d5ff7226d6a077fb26833872fedf2dd8813167d5d8e6e3fadb0673ca0236f6cfacb80bbd9a7a078cf6092c0ab10cc74509d5d6c6e455ebef1c34a9bba4b3f414f70e6b54605ed5104d6b7d2c0895f3a803bbec3542daa1e31ab5a161d7cdf1bcae9a0512500dd7645f2970bcfadd262bd103c8089649a9a0440bf6e796c902b777e2a5ce7b9485eefa734e854a26259256470ffc5d06b676e99a5acf3e47f28b4c58b325220883a8de77ab83b82eaff605c76ee0f2946a9680a5cf86c106d61b6058ee2a426160712e45b85af91b46f9287bd2ac2778248b680389',
  
'iqmp' => 'e6b008ce05a1d4a70f28402fe0b3c98870f7e3d8984940630e690ea1f67cc24dcf9a18f5c6e41fbe083902b577579d7eacc85c6089d17e3c1a342f83ee28159765c346420a8f2c4f522cf14ec20eb6a6709f660a767aec15c3592d887d03485d5a5af902e0700cb9f5fb27aa535017d10505afca37a1ca1100624c25977cf802a71deb543c467afa7fe06cb7dc0479ebed2370a3778fe733fdf3a19bc212a0bc9d9c8186f7a007992382e6cedaa786252e46edba359879acd7b23026d7e5a26db059d935f722942a54281d990d7801aa97df617b96c87cd66855f693ae01d97dbdb3360214ce8f64545b99280be2d76452c3679a20185e061022e86105a334d3',
]
Examples
#1 openssl_pkey_new  ()
#2 openssl_pkey_new  (["digest_alg" => "sha512""private_key_bits" => 4096"private_key_type" => OPENSSL_KEYTYPE_RSA])
See also
array_map, openssl_pkey_get_details