Files
cmp-php-openssl/cmpOpenSSLTests.php
2024-01-26 12:54:46 +03:00

84 lines
1.7 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->cmpOpenSslCaGen($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->cmpOpenSslCaCertFromFile("test-ca-01.crt");
$x->cmpOpenSslCaPrivFromFile("test-ca-01.prv");
$out = array();
$x->cmpOpenSslCertServerGen($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->cmpOpenSslCaCertFromFile("test-ca-01.crt");
$x->cmpOpenSslCaPrivFromFile("test-ca-01.prv");
$out = array();
$x->cmpOpenSslCertClientGen($parm, $out);
var_export($out);
//exit;
}