You've already forked linux-packaging-mono
Imported Upstream version 4.4.0.122
Former-commit-id: a99f46acaeba3ab496c7afc02c29b839e30a0d0b
This commit is contained in:
@@ -52,6 +52,7 @@ namespace System.Security.Cryptography.X509Certificates {
|
||||
X500DistinguishedNameFlags.UseT61Encoding | X500DistinguishedNameFlags.ForceUTF8Encoding;
|
||||
|
||||
private string name;
|
||||
private byte[] canonEncoding;
|
||||
|
||||
|
||||
public X500DistinguishedName (AsnEncodedData encodedDistinguishedName)
|
||||
@@ -122,6 +123,20 @@ namespace System.Security.Cryptography.X509Certificates {
|
||||
name = distinguishedName.name;
|
||||
}
|
||||
|
||||
internal X500DistinguishedName (byte[] encoded, byte[] canonEncoding, string name)
|
||||
: this (encoded)
|
||||
{
|
||||
this.canonEncoding = canonEncoding;
|
||||
this.name = name;
|
||||
|
||||
Oid = new Oid ();
|
||||
RawData = encoded;
|
||||
}
|
||||
|
||||
internal byte[] CanonicalEncoding {
|
||||
get { return canonEncoding; }
|
||||
}
|
||||
|
||||
|
||||
public string Name {
|
||||
get { return name; }
|
||||
@@ -215,6 +230,16 @@ namespace System.Security.Cryptography.X509Certificates {
|
||||
if (name2 == null)
|
||||
return false;
|
||||
|
||||
if (name1.canonEncoding != null && name2.canonEncoding != null) {
|
||||
if (name1.canonEncoding.Length != name2.canonEncoding.Length)
|
||||
return false;
|
||||
for (int i = 0; i < name1.canonEncoding.Length; i++) {
|
||||
if (name1.canonEncoding[i] != name2.canonEncoding[2])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
X500DistinguishedNameFlags flags = X500DistinguishedNameFlags.UseNewLines | X500DistinguishedNameFlags.DoNotUseQuotes;
|
||||
string[] split = new string[] { Environment.NewLine };
|
||||
string[] parts1 = name1.Decode (flags).Split (split, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
Reference in New Issue
Block a user