Imported Upstream version 6.0.0.293

Former-commit-id: c73c6d59ea27405c8ec2975fc933d2a9a447e603
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-06-08 08:45:03 +00:00
parent 7de0679779
commit 76c6505a64
70 changed files with 132 additions and 69 deletions

View File

@@ -41,7 +41,7 @@ static partial class Consts
// Use these assembly version constants to make code more maintainable.
//
public const string MonoVersion = "6.0.0.284";
public const string MonoVersion = "6.0.0.293";
public const string MonoCompany = "Mono development team";
public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors";

View File

@@ -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 ();
}
}
}

View File

@@ -80,8 +80,8 @@ namespace System.Net {
if (!File.Exists (pvk_file))
return null;
var cert = new X509Certificate2 (cert_file);
cert.PrivateKey = PrivateKey.CreateFromFile (pvk_file).RSA;
certificate = cert;
var privateKey = PrivateKey.CreateFromFile (pvk_file).RSA;
certificate = new X509Certificate2 ((X509Certificate2Impl)cert.Impl.CopyWithPrivateKey (privateKey));
return certificate;
} catch {
// ignore errors

View File

@@ -83,6 +83,18 @@ namespace System.Security.Cryptography.X509Certificates
public abstract void AppendPrivateKeyInfo (StringBuilder sb);
public sealed override X509CertificateImpl CopyWithPrivateKey (RSA privateKey)
{
var impl = (X509Certificate2Impl)Clone ();
impl.PrivateKey = privateKey;
return impl;
}
public sealed override X509Certificate CreateCertificate ()
{
return new X509Certificate2 (this);
}
public abstract void Reset ();
}
}

View File

@@ -8,6 +8,7 @@ using System.Text;
namespace System.Reflection
{
[Serializable]
partial class MethodBase
{
//

View File

@@ -123,6 +123,10 @@ namespace System.Security.Cryptography.X509Certificates
public abstract byte[] Export (X509ContentType contentType, SafePasswordHandle password);
public abstract X509CertificateImpl CopyWithPrivateKey (RSA privateKey);
public abstract X509Certificate CreateCertificate ();
public sealed override bool Equals (object obj)
{
var other = obj as X509CertificateImpl;

View File

@@ -1 +1 @@
7cd8184c6e906e7804425471eda17f75ade7c29f
581faec1da3d53a1134ed7c388537cfe101e007a

View File

@@ -1,4 +1,5 @@
namespace System.Reflection {
[Serializable]
partial class MethodInfo {
internal virtual int GenericParameterCount => GetGenericArguments ().Length;
}

View File

@@ -1 +1 @@
0081ae35dbce9a10dcfd0a9a0a22e9690e19da56
8644f424bdc6234783527808eaf364fc4de93589

View File

@@ -1 +1 @@
1cbed502c7bc7f3ee585f5a992af3439588908ee
04ac9ca261d369e0152cd185f329179981ae261c

View File

@@ -1 +1 @@
de4610d6ed476d486c45dcda2a88ff584d1ff1c3
7f0002af7c012f940b77ef4faad9c0c76bbcd769

View File

@@ -1 +1 @@
489d7ee861c287503c007ef4054371bb2650a61f
7b3eabaa8fc825740de557145177ada3805fa15c

View File

@@ -1 +1 @@
0755b77099541d721dba6c265a09c09e9cc9d9be
aa3f20f4223ee894f821c81b5144d56c827dd529

View File

@@ -1 +1 @@
ef2e4304281563bd8360933f8a58371f6e4dba90
67f564c659e3a210e285f362896772324d9c53d2

View File

@@ -1 +1 @@
8a04fc03dae997ce5a67c88ff36d45e62465988c
bd292a0970d5b63a9eac50da950d1e21060bf470

View File

@@ -1 +1 @@
13da60b713ea88aa40dfb5cac5b123260ecbe2b1
ca30e2abba5df571106821a1f43c06751ef65a0f

View File

@@ -1 +1 @@
0081ae35dbce9a10dcfd0a9a0a22e9690e19da56
8644f424bdc6234783527808eaf364fc4de93589

View File

@@ -1 +1 @@
1cbed502c7bc7f3ee585f5a992af3439588908ee
04ac9ca261d369e0152cd185f329179981ae261c

View File

@@ -1 +1 @@
de4610d6ed476d486c45dcda2a88ff584d1ff1c3
7f0002af7c012f940b77ef4faad9c0c76bbcd769

Some files were not shown because too many files have changed in this diff Show More