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

  • SEARCH
  • Home
  • 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 6980017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:57:37+00:00 2026-05-27T17:57:37+00:00

Ok, I have a string of text, encoded in Base64. I want to decode

  • 0

Ok, I have a string of text, encoded in Base64.

I want to decode this from Base64 to a byte array, then decrypt this with my private key. My private key is a *.pem file. I am lost!

I think I need to declare a byte array, grab the text between the —BEGIN— and —END— part of my *.pem, and convert this from a base 64 string as the result of my byte array.

I then need to declare an X509Certificate2, and use the constructor that takes a byte array and a string of text, the byte array being my private key, the string of text being my passphrase like below:

byte[] myprivateKey = Convert.FromBase64String("BASE 64 ENCODED PRIVATE KEY GOES HERE");
X509Certificate2 myPem = new X509Certificate2(myprivateKey, "MY PASSPHRASE");

However, I am getting the following error at this point:

Cannot find the requested object.

Am I heading in the right direction at least or am I way off? What do I need to do here?

  • 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-27T17:57:38+00:00Added an answer on May 27, 2026 at 5:57 pm

    X509Certificate2 won’t read a private key from a PEM base64-encoded file. You’ll need to read the private key apart from the certificate and then assign it the the PrivateKey property.

    See how to get private key from PEM file? for more details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a huge string (22000+ characters) of encoded text. The code is consisted
I have a string like: hello #this# is #some text string# text text I
I have a string of text like so: var foo = FooBar; I want
Suppose I have this code: String encoding = UTF-16; String text = [Hello StackOverflow];
I have a Base64 encoded String that contains PDF data. Using the EncdDecd unit
I have at base64 encoded string of a image file. I need to save
I have a cipher text I encoded with the AesManaged .Net classes. plaintext: string
I have come across some Base64 conversion functions in .net(FromBase64.string etc). What i want
Ok so I have a string of text, encoded in Base 64 like below:
I have a string of text that is encoded in such a way: {itemId:17417362,type:0,cclass:0,value:100,category:null,image:{url:\/\/cdn.site.com\/insight.site.com\/COS20\/_Cache\/_ImageCache\/362\/17417362.gif,height:100,width:80},burstText:,summary:SAVE

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.