Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static AsymmetricAlgorithm GetAnyPublicKey(this X509Certificate2 c)
- {
- AsymmetricAlgorithm a;
- a = c.GetRSAPublicKey();
- if (a != null)
- return a;
- a = c.GetDSAPublicKey();
- if (a != null)
- return a;
- a = c.GetECDsaPublicKey();
- if (a != null)
- return a;
- throw new NotSupportedException(SecurityResources.GetResourceString("NotSupported_KeyAlgorithm"));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement