Subversion Repositories oidplus

Rev

Rev 360 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
353 daniel-mar 1
<?php
2
 
3
if (!function_exists('openssl_pkey_new')) {
4
        echo '<font color="red">OpenSSL PHP extension is not installed!</font>';
5
        die();
6
}
7
 
8
$pkey_config = array(
9
        "digest_alg" => "sha512",
10
        "private_key_bits" => 2048,
11
        "private_key_type" => OPENSSL_KEYTYPE_RSA,
12
);
13
 
14
$res = openssl_pkey_new($pkey_config);
15
if ($res) {
16
        echo '<font color="green">OpenSSL key generation works!</font>';
17
} else {
18
        echo '<font color="red">OpenSSL key generation does not work!</font>';
19
}