0

I need to convert a byte[] to some implementation of AsymmetricAlgorithm. I am trying to sign a xml and I can only get the private key in a byte array. I am using the quite good PKCS11.Net to access a token, if anyone needs to know.

The class I am using to sign is this: System.Security.Cryptography.Xml.SignedXml
The property only asks for AsymmetricAlgorithm : XmlSignedXml.SigningKey;

Does anyone knows how to do it?

marcelo-ferraz
  • 3,147
  • 4
  • 38
  • 55
  • Check out this thread [How to read a PEM RSA private key from .NET.](http://stackoverflow.com/questions/243646/how-to-read-a-pem-rsa-private-key-from-net). – Dmitriy Konovalov Dec 09 '11 at 09:10

1 Answers1

0

Use a library like http://www.bouncycastle.org/ to import this.

csharptest.net
  • 62,602
  • 11
  • 71
  • 89