From a92792300b43b4d77ec5a5bc6542efa06ed4867d Mon Sep 17 00:00:00 2001 From: Lluis Sanchez Date: Fri, 14 Oct 2016 09:27:08 +0200 Subject: [PATCH] Implemented System.Security.Cryptography.X509Certificates.RSACertificateExtensions (cherry picked from commit 04a376b2ab038fc8ebc786185695893456d541c9) --- .../RSACertificateExtensions.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mcs/class/System.Core/System.Security.Cryptography.X509Certificates/RSACertificateExtensions.cs b/mcs/class/System.Core/System.Security.Cryptography.X509Certificates/RSACertificateExtensions.cs index 0e322e4b109..81c303bd091 100644 --- a/mcs/class/System.Core/System.Security.Cryptography.X509Certificates/RSACertificateExtensions.cs +++ b/mcs/class/System.Core/System.Security.Cryptography.X509Certificates/RSACertificateExtensions.cs @@ -30,16 +30,18 @@ namespace System.Security.Cryptography.X509Certificates { public static class RSACertificateExtensions { - [MonoTODO] public static RSA GetRSAPrivateKey(this X509Certificate2 certificate) { - throw new NotImplementedException (); + if (certificate == null) + throw new ArgumentNullException("certificate"); + return certificate.PrivateKey as RSA; } - [MonoTODO] public static RSA GetRSAPublicKey(this X509Certificate2 certificate) { - throw new NotImplementedException (); + if (certificate == null) + throw new ArgumentNullException("certificate"); + return certificate.PublicKey.Key as RSA; } } } -- 2.25.1