i am using AsymmetricAlgorithm.ImportSubjectPublicKeyInfo(ReadOnlySpan, Int32) Method in .net, what is the equivalent in .net4.61 ?
Asked
Active
Viewed 296 times
1
-
X.509/SPKI is not supported in .NET Framework. I would recommend BouncyCastle. – Topaco Mar 15 '22 at 15:47
1 Answers
0
There isn’t one built in.
BouncyCastle can do it, or you can use the System.Formats.Asn1 library (or any other DER library) to read the key. For RSA, it’s fairly straightforward: https://stackoverflow.com/a/54011211/6535399
For DSA it’s just different, for ECC (ECDSA/ECDH) it’s harder because the key structure is more complicated.

bartonjs
- 30,352
- 2
- 71
- 111