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 1032845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:08:35+00:00 2026-05-16T14:08:35+00:00

How convert RSA public key, from XML to PEM (PHP)?

  • 0

How convert RSA public key, from XML to PEM (PHP)?

  • 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-05-16T14:08:36+00:00Added an answer on May 16, 2026 at 2:08 pm

    we know

    .pem – (Privacy Enhanced Mail) Base64
    encoded DER certificate, enclosed
    between “—–BEGIN CERTIFICATE—–”
    and “—–END CERTIFICATE—–“

    X.509

    The SignatureValue element contains
    the Base64 encoded signature result –
    the signature generated with the
    parameters specified in the
    SignatureMethod element – of the
    SignedInfo element after applying the
    algorithm specified by the
    CanonicalizationMethod.

    XML_Signature

    so we end up with

    $xml = simplexml_load_file($xmlFile); // or simplexml_load_string
    
    $pem = "-----BEGIN CERTIFICATE-----\n";
    $pem .= $xml->SignatureValue;
    $pem .= "\n-----END CERTIFICATE-----";
    
    // save to file
    

    if your xml-file isn’t a XML_Signature

    $xml = simplexml_load_file($xmlFile); // or simplexml_load_string
    $pem = "-----BEGIN CERTIFICATE-----\n";
    $pem .= $xml->nodeWithWantedValue; // use base64_encode if needed
    $pem .= "\n-----END CERTIFICATE-----";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im creating xml string from my RSA key: var keyXmlString = rsaPrivKey.ToXmlString(true); And now
How can I convert this RSA public key: 109120132967399429278860960508995541528237502902798129123468757937266291492576446330739696001110 6039072308886100726558188253585034290 57592827629436413108566029093628 2126359538366865626758497206207862794310902180176810615217550567108238764764442605581471797071 19674283982419152118103759076030616683978566631413 to
Who knows how to convert PEM encoded X.509 version 2 certificate with RSA public
How can I fill RSA structure with xml-formatted public key for using with RSA
How can I convert RSAPublicKey into something readable (public key sharing reasons) and then
I searched a lot online but stuck with doubts in RSA public key and
I used openSSL command to create 2 files: 1 for RSA public key &
I'm using C# to generate an RSA public/private key to encrypt user information. I
is there anyway that I can convert this to use RSA encryption? im kinda
Recently, I have to convert an java project related to rsa/des encryption into an

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.