0

I am trying to create a custom jwt token for firebase authentication from a C# WCF service. The problem is that I need to sign the jwt token with my private RSA key (e.g. "-----BEGIN PRIVATE KEY-----\nMIIEvQIBA ... wFg=\n-----END PRIVATE KEY-----).

How do I create a representation of the private key in String format (in brackets above) to a representation that C# understands?

user3414265
  • 23
  • 1
  • 6

1 Answers1

0

As far as I konw, X509Certificate2 is not able to read a private key from a PEM base64-encoded file.

It is more easily to read the private key from the certificates. And refer to how to get private key from PEM file? about the detail.

Community
  • 1
  • 1
Fei Xue
  • 14,369
  • 1
  • 19
  • 27