Files
cmp-php-openssl/cmpOpenSSLTests.php
2024-01-25 07:46:42 +12:00

84 lines
1.6 KiB
PHP

<?php
require_once("cmpOpenSSLClass.php");
$x = new cmpOpenSSLClass();
if(0) {
$out = $x->cmpOpenSslGenDh();
var_export($out);
exit;
}
if(1) {
$parm = array(
"days" => 3650 ,
"outfile" => "test-ca-01" ,
"commonName" => "test-ca-01" ,
"stateOrProvinceName" => "MSK" ,
"localityName" => "MSK" ,
"emailAddress" => "it@example.ru" ,
"organizationName" => "TEST" ,
"organizationalUnitName" => "TEST-OIT" ,
);
$out = array();
$x->createCA($parm, $out);
var_export($out);
//exit;
}
if(1) {
$parm = array(
"days" => 3650 ,
"outfile" => "test-srv-01" ,
"commonName" => "test-srv-01" ,
"stateOrProvinceName" => "MSK" ,
"localityName" => "MSK" ,
"emailAddress" => "it@example.ru" ,
"organizationName" => "TEST" ,
"organizationalUnitName" => "TEST-OIT" ,
);
$x->loadFromFileCACrt("test-ca-01.crt");
$x->loadFromFileCAPrv("test-ca-01.prv");
$out = array();
$x->createServer($parm, $out);
var_export($out);
//exit;
}
if(1) {
$parm = array(
"days" => 365 ,
"outfile" => "test-cli-cli01" ,
"commonName" => "test-cli-cli01" ,
"stateOrProvinceName" => "MSK" ,
"localityName" => "MSK" ,
"emailAddress" => "it@example.ru" ,
"organizationName" => "TEST" ,
"organizationalUnitName" => "TEST-OIT" ,
);
$x->loadFromFileCACrt("test-ca-01.crt");
$x->loadFromFileCAPrv("test-ca-01.prv");
$out = array();
$x->createClient($parm, $out);
var_export($out);
//exit;
}