48 lines
1.8 KiB
PHP
48 lines
1.8 KiB
PHP
|
<?php
|
||
|
$form = $_POST;
|
||
|
|
||
|
require('./config.php');
|
||
|
|
||
|
|
||
|
if(isset($_POST['Nom'])) {
|
||
|
$dn = array(
|
||
|
"countryName" => "FR",
|
||
|
"stateOrProvinceName" => "Alpes Maritimes",
|
||
|
"localityName" => "Nice",
|
||
|
"organizationName" => "iut",
|
||
|
"organizationalUnitName" => "iotia",
|
||
|
"commonName" => "Pauline Srifi",
|
||
|
"emailAddress" => "pauline@srifi.fr"
|
||
|
);
|
||
|
$pk = openssl_pkey_new($config);
|
||
|
$req = openssl_csr_new($dn, $pk, $config);
|
||
|
$certif = openssl_csr_sign($req, null, $pk, (365), $config);
|
||
|
$exportCertif = openssl_x509_export_to_file($certif, "./b/certificat");
|
||
|
$exportReq = openssl_csr_export_to_file($req, "./b/requete");
|
||
|
$exportKey = openssl_pkey_export_to_file($pk, "./b/clePrivee", null, $config);
|
||
|
|
||
|
echo "Certificat exporté<br />";
|
||
|
echo "Requête exportée<br />";
|
||
|
echo "Clée privée exportée<br />";
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
?>
|
||
|
|
||
|
<html>
|
||
|
<form method="POST" action="b.php">
|
||
|
<label for="Nom">Nom</label> <input type="text" name="Nom" id="Nom" value=""/><br />
|
||
|
<label for="Prenom">Prenom</label> <input type="text" name="Prenom" id="Prenom" value=""/><br />
|
||
|
<label for="Ville">Ville</label> <input type="text" name="Ville" id="Ville" value=""/><br />
|
||
|
<label for="Département">Département</label> <input type="text" name="Département" id="Département" value=""/><br />
|
||
|
<label for="Pays">Pays</label> <input type="text" name="Pays" id="Pays" value=""/><br />
|
||
|
<label for="Organisation">Organisation</label> <input type="text" name="Organisation" id="Organisation" value=""/><br />
|
||
|
<label for="Unite">Unite</label> <input type="text" name="Unite" id="Unite" value=""/><br />
|
||
|
<input type="submit" name="Envoyer" value="Envoyer" />
|
||
|
</form>
|
||
|
</html>
|
||
|
|
||
|
|
||
|
|