Imported Upstream version 4.4.0.122

Former-commit-id: a99f46acaeba3ab496c7afc02c29b839e30a0d0b
This commit is contained in:
Xamarin Public Jenkins
2016-04-12 13:19:31 -04:00
parent a632333cc7
commit d444f0caa4
118 changed files with 4121 additions and 1632 deletions

View File

@@ -109,17 +109,44 @@ namespace System.Security.Cryptography.X509Certificates {
impl = X509Helper.InitFromHandle (handle);
}
internal X509Certificate (X509CertificateImpl impl)
{
if (impl == null)
throw new ArgumentNullException ("impl");
this.impl = X509Helper.InitFromCertificate (impl);
}
public X509Certificate (System.Security.Cryptography.X509Certificates.X509Certificate cert)
{
if (cert == null)
throw new ArgumentNullException ("cert");
X509Helper.ThrowIfContextInvalid (cert.impl);
impl = X509Helper.InitFromCertificate (cert.impl);
impl = X509Helper.InitFromCertificate (cert);
hideDates = false;
}
internal void ImportHandle (X509CertificateImpl impl)
{
Reset ();
this.impl = impl;
}
internal X509CertificateImpl Impl {
get {
X509Helper.ThrowIfContextInvalid (impl);
return impl;
}
}
internal bool IsValid {
get { return X509Helper.IsValid (impl); }
}
internal void ThrowIfContextInvalid ()
{
X509Helper.ThrowIfContextInvalid (impl);
}
// public methods
@@ -161,7 +188,7 @@ namespace System.Security.Cryptography.X509Certificates {
return null;
X509Helper.ThrowIfContextInvalid (impl);
return impl.GetEffectiveDateString ().ToString ();
return impl.GetValidFrom ().ToLocalTime ().ToString ();
}
// strangly there are no DateTime returning function
@@ -171,7 +198,7 @@ namespace System.Security.Cryptography.X509Certificates {
return null;
X509Helper.ThrowIfContextInvalid (impl);
return impl.GetExpirationDateString ().ToString ();
return impl.GetValidUntil ().ToLocalTime ().ToString ();
}
// well maybe someday there'll be support for PGP or SPKI ?