Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8995823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:40:15+00:00 2026-06-15T23:40:15+00:00

<?php $c = $_POST[‘c’]; $city = $_POST[‘city’]; $cn = $_POST[‘cn’]; $mail = $_POST[’email’]; $p

  • 0
<?php 
$c = $_POST['c'];
$city = $_POST['city'];
$cn = $_POST['cn'];
$mail = $_POST['email'];
$p = $_POST['pass'];
echo "$c<BR>$city<br>$cn<br>$mail";
$key = $_POST['key'];
$dn = array(
"countryName" => "$c",
"stateOrProvinceName" => ".",
"localityName" => "$city",
"organizationName" => ".",
"organizationalUnitName" => ".",
"commonName" => "$cn",
"emailAddress" => "$key"
//"passphase" => "$p"
);
// Generate a certificate signing request
$csr = openssl_csr_new($dn, $key);
var_dump($csr);
while ($msg = openssl_error_string())
echo $msg . "<br />\n";
?>

It is showing me an error:

Warning: openssl_csr_new(): dn: add_entry_by_NID 48 -&gt; -----BEGIN RSA PRIVATE KEY----- M[...]= -----END RSA PRIVATE KEY----- (failed; check error queue and value of string_mask OpenSSL option if illegal characters are reported) in D:\wamp\www\csr.php on line 21

and

boolean false
error:0E06D06C:configuration file routines:NCONF_get_string:no value
error:0E06D06C:configuration file routines:NCONF_get_string:no value
error:0E06D06C:configuration file routines:NCONF_get_string:no value
error:0E06D06C:configuration file routines:NCONF_get_string:no value
error:0E06D06C:configuration file routines:NCONF_get_string:no value
error:0E06D06C:configuration file routines:NCONF_get_string:no value
error:0D07A097:asn1 encoding routines:ASN1_mbstring_ncopy:string too long

This is what I found on php.net

mixed openssl_csr_new ( array $dn , resource &$privkey [, array $configargs [, array $extraattribs ]] )  

$pivkey should be a resource type, what if I already have got a private key as string?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:40:15+00:00Added an answer on June 15, 2026 at 11:40 pm

    Personally, I’d use phpseclib, a pure PHP CSR implementation. eg.

    <?php
    include('File/X509.php');
    include('Crypt/RSA.php');
    
    $key = new Crypt_RSA();
    $key->loadKey($_POST['key']);
    
    $x509 = new File_X509();
    $x509->setPrivateKey($key);
    $x509->setDN(array(
        'countryName' => $_POST['c'],
        'stateOrProvinceName' => '.',
        'localityName' => $_POST['city'],
        'organizationName' => '.',
        'organizationalUnitName' => '.',
        'commonName' => $_POST['cn'],
        'emailAddress' => $_POST['email']
    ));
    
    $csr = $x509->signCSR();
    
    echo $x509->saveCSR($csr);
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: php $_POST array empty upon form submission I am trying to have
im trying to pass an array of data to a PHP script using Jquery's
So, say you have a php post script that appends whatever you pass to
This is my php where I need to authenticate: <?php $username=$_POST[m_username]; $password=$_POST[m_password]; /* $username=$_GET[m_username];
I write two file main.php and download.php . main.php echo<form action='download.php' method='post'> for(i =
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
What's a method to sanitize PHP POST data for passing to a mail function?
Okay so I have a form that is using PHP to mail to an
Shortened Aim: To pass a variable via $.POST to a PHP file (get.php), and
I want to use this function: http://www.frankmacdonald.co.uk/php/post-to-wordpress-with-php.html Its used to post to Wordpress using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.