PHP.nl

openssl_spki_export

openssl_spki_export

Exports a valid PEM formatted public key signed public key and challenge

 **openssl_spki_export** string $spki

Exports formatted public key from encoded signed public key and challenge

spkiExpects a valid signed public key and challenge

Returns the associated formatted public key or false on failure.

Emits an level error if an invalid argument is passed via the parameter. E_WARNING``spki

Voorbeeld: example

Extracts the associated formatted public key or null on failure.

<?php
$pkey = openssl_pkey_new('secret password');
$spkac = openssl_spki_new($pkey, 'challenge string');
$pubKey = openssl_spki_export(preg_replace('/SPKAC=/', '', $spkac));

if ($pubKey) {
    echo $pubKey;
}
?>

Voorbeeld: example from

Extracts the associated formatted public key issued from the element

<?php
$spkac = openssl_spki_export(preg_replace('/SPKAC=/', '', $_POST['spkac']));
if ($spkac != NULL) {
    echo $spkac;
} else {
    echo "Extraction of pub key failed";
}
?>
<keygen name="spkac" challenge="challenge string" keytype="RSA">

openssl_spki_new``openssl_spki_verify``openssl_spki_export_challenge``openssl_get_md_methods``openssl_csr_new``openssl_csr_sign