pike.git
/
lib
/
modules
/
Standards.pmod
/
testsuite.in
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Standards.pmod/testsuite.in:337:
string s = Standards.X509.make_selfsigned_certificate(key, 3600, ([ "commonName":"*" ]), 0, h); if( !Standards.X509.verify_certificate(s, ([])) ) return h; } return 1; ]], 1) ]]) test_any([[ Crypto.RSA root_rsa = Crypto.RSA();
-
rsa->generate_key(512);
+
root_
rsa->generate_key(512);
string root = Standards.X509.make_root_certificate(root_rsa, 3600, ([ "commonName":"*" ]));
-
+
object rtbs = Standards.X509.decode_certificate(root);
+
+
Crypto.RSA cert_rsa = Crypto.RSA();
+
cert_rsa->generate_key(512);
+
string c = Standards.X509.make_site_certificate(rtbs, root_rsa, cert_rsa, 3600, ([ "commonName":"*" ]));
+
+
mapping m = Standards.X509.verify_certificate_chain( ({ c }), ([ rtbs->subject->get_der() : rtbs->public_key ]), 1);
+
return m->verified;
]], 1) define(test_cert, ([[ test_true(Standards.X509.verify_certificate(Standards.PEM.Messages(#"$1")->parts->CERTIFICATE->body, ([]))) ]])) dnl openssl req -x509 -nodes -days 365 -subj "/CN=PikeCert" -md5 -newkey rsa:2048 -out certfile.cer test_cert(-----BEGIN CERTIFICATE----- MIIC+TCCAeGgAwIBAgIJAK9S+nXAkU+DMA0GCSqGSIb3DQEBBAUAMBMxETAPBgNV BAMMCFBpa2VDZXJ0MB4XDTEzMTEyMTIxMjM1MFoXDTE0MTEyMTIxMjM1MFowEzER