You've already forked linux-packaging-mono
Imported Upstream version 6.0.0.293
Former-commit-id: c73c6d59ea27405c8ec2975fc933d2a9a447e603
This commit is contained in:
parent
7de0679779
commit
76c6505a64
@ -30,7 +30,7 @@ namespace System.Security.Cryptography.X509Certificates
|
||||
{
|
||||
public static class RSACertificateExtensions
|
||||
{
|
||||
public static RSA GetRSAPrivateKey(this X509Certificate2 certificate)
|
||||
public static RSA GetRSAPrivateKey (this X509Certificate2 certificate)
|
||||
{
|
||||
if (certificate == null)
|
||||
throw new ArgumentNullException (nameof (certificate));
|
||||
@ -41,11 +41,21 @@ namespace System.Security.Cryptography.X509Certificates
|
||||
return certificate.Impl.GetRSAPrivateKey ();
|
||||
}
|
||||
|
||||
public static RSA GetRSAPublicKey(this X509Certificate2 certificate)
|
||||
public static RSA GetRSAPublicKey (this X509Certificate2 certificate)
|
||||
{
|
||||
if (certificate == null)
|
||||
throw new ArgumentNullException("certificate");
|
||||
throw new ArgumentNullException (nameof (certificate));
|
||||
return certificate.PublicKey.Key as RSA;
|
||||
}
|
||||
|
||||
public static X509Certificate2 CopyWithPrivateKey (this X509Certificate2 certificate, RSA privateKey)
|
||||
{
|
||||
if (certificate == null)
|
||||
throw new ArgumentNullException (nameof (certificate));
|
||||
if (privateKey == null)
|
||||
throw new ArgumentNullException (nameof (privateKey));
|
||||
var impl = certificate.Impl.CopyWithPrivateKey (privateKey);
|
||||
return (X509Certificate2)impl.CreateCertificate ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user