This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
@@ -0,0 +1,290 @@
using System;
using System.Collections;
using System.Text;
namespace Mono.Security.X509.Extensions
{
// Token: 0x0200006B RID: 107
internal class GeneralNames
{
// Token: 0x060003EC RID: 1004 RVA: 0x000197A4 File Offset: 0x000179A4
public GeneralNames()
{
}
// Token: 0x060003ED RID: 1005 RVA: 0x000197AC File Offset: 0x000179AC
public GeneralNames(string[] rfc822s, string[] dnsNames, string[] ipAddresses, string[] uris)
{
this.asn = new ASN1(48);
if (rfc822s != null)
{
this.rfc822Name = new ArrayList();
foreach (string text in rfc822s)
{
this.asn.Add(new ASN1(129, Encoding.ASCII.GetBytes(text)));
this.rfc822Name.Add(rfc822s);
}
}
if (dnsNames != null)
{
this.dnsName = new ArrayList();
foreach (string text2 in dnsNames)
{
this.asn.Add(new ASN1(130, Encoding.ASCII.GetBytes(text2)));
this.dnsName.Add(text2);
}
}
if (ipAddresses != null)
{
this.ipAddr = new ArrayList();
foreach (string text3 in ipAddresses)
{
string[] array = text3.Split(new char[] { '.', ':' });
byte[] array2 = new byte[array.Length];
for (int l = 0; l < array.Length; l++)
{
array2[l] = byte.Parse(array[l]);
}
this.asn.Add(new ASN1(135, array2));
this.ipAddr.Add(text3);
}
}
if (uris != null)
{
this.uris = new ArrayList();
foreach (string text4 in uris)
{
this.asn.Add(new ASN1(134, Encoding.ASCII.GetBytes(text4)));
this.uris.Add(text4);
}
}
}
// Token: 0x060003EE RID: 1006 RVA: 0x00019994 File Offset: 0x00017B94
public GeneralNames(ASN1 sequence)
{
int i = 0;
while (i < sequence.Count)
{
byte tag = sequence[i].Tag;
switch (tag)
{
case 129:
if (this.rfc822Name == null)
{
this.rfc822Name = new ArrayList();
}
this.rfc822Name.Add(Encoding.ASCII.GetString(sequence[i].Value));
break;
case 130:
if (this.dnsName == null)
{
this.dnsName = new ArrayList();
}
this.dnsName.Add(Encoding.ASCII.GetString(sequence[i].Value));
break;
default:
if (tag == 164)
{
goto IL_CF;
}
break;
case 132:
goto IL_CF;
case 134:
if (this.uris == null)
{
this.uris = new ArrayList();
}
this.uris.Add(Encoding.ASCII.GetString(sequence[i].Value));
break;
case 135:
{
if (this.ipAddr == null)
{
this.ipAddr = new ArrayList();
}
byte[] value = sequence[i].Value;
string text = ((value.Length != 4) ? ":" : ".");
StringBuilder stringBuilder = new StringBuilder();
for (int j = 0; j < value.Length; j++)
{
stringBuilder.Append(value[j].ToString());
if (j < value.Length - 1)
{
stringBuilder.Append(text);
}
}
this.ipAddr.Add(stringBuilder.ToString());
if (this.ipAddr == null)
{
this.ipAddr = new ArrayList();
}
break;
}
}
IL_1F9:
i++;
continue;
IL_CF:
if (this.directoryNames == null)
{
this.directoryNames = new ArrayList();
}
this.directoryNames.Add(X501.ToString(sequence[i][0]));
goto IL_1F9;
}
}
// Token: 0x170000E0 RID: 224
// (get) Token: 0x060003EF RID: 1007 RVA: 0x00019BAC File Offset: 0x00017DAC
public string[] RFC822
{
get
{
if (this.rfc822Name == null)
{
return new string[0];
}
return (string[])this.rfc822Name.ToArray(typeof(string));
}
}
// Token: 0x170000E1 RID: 225
// (get) Token: 0x060003F0 RID: 1008 RVA: 0x00019BE8 File Offset: 0x00017DE8
public string[] DirectoryNames
{
get
{
if (this.directoryNames == null)
{
return new string[0];
}
return (string[])this.directoryNames.ToArray(typeof(string));
}
}
// Token: 0x170000E2 RID: 226
// (get) Token: 0x060003F1 RID: 1009 RVA: 0x00019C24 File Offset: 0x00017E24
public string[] DNSNames
{
get
{
if (this.dnsName == null)
{
return new string[0];
}
return (string[])this.dnsName.ToArray(typeof(string));
}
}
// Token: 0x170000E3 RID: 227
// (get) Token: 0x060003F2 RID: 1010 RVA: 0x00019C60 File Offset: 0x00017E60
public string[] UniformResourceIdentifiers
{
get
{
if (this.uris == null)
{
return new string[0];
}
return (string[])this.uris.ToArray(typeof(string));
}
}
// Token: 0x170000E4 RID: 228
// (get) Token: 0x060003F3 RID: 1011 RVA: 0x00019C9C File Offset: 0x00017E9C
public string[] IPAddresses
{
get
{
if (this.ipAddr == null)
{
return new string[0];
}
return (string[])this.ipAddr.ToArray(typeof(string));
}
}
// Token: 0x060003F4 RID: 1012 RVA: 0x00019CD8 File Offset: 0x00017ED8
public byte[] GetBytes()
{
return this.asn.GetBytes();
}
// Token: 0x060003F5 RID: 1013 RVA: 0x00019CE8 File Offset: 0x00017EE8
public override string ToString()
{
StringBuilder stringBuilder = new StringBuilder();
if (this.rfc822Name != null)
{
foreach (object obj in this.rfc822Name)
{
string text = (string)obj;
stringBuilder.Append("RFC822 Name=");
stringBuilder.Append(text);
stringBuilder.Append(Environment.NewLine);
}
}
if (this.dnsName != null)
{
foreach (object obj2 in this.dnsName)
{
string text2 = (string)obj2;
stringBuilder.Append("DNS Name=");
stringBuilder.Append(text2);
stringBuilder.Append(Environment.NewLine);
}
}
if (this.directoryNames != null)
{
foreach (object obj3 in this.directoryNames)
{
string text3 = (string)obj3;
stringBuilder.Append("Directory Address: ");
stringBuilder.Append(text3);
stringBuilder.Append(Environment.NewLine);
}
}
if (this.uris != null)
{
foreach (object obj4 in this.uris)
{
string text4 = (string)obj4;
stringBuilder.Append("URL=");
stringBuilder.Append(text4);
stringBuilder.Append(Environment.NewLine);
}
}
if (this.ipAddr != null)
{
foreach (object obj5 in this.ipAddr)
{
string text5 = (string)obj5;
stringBuilder.Append("IP Address=");
stringBuilder.Append(text5);
stringBuilder.Append(Environment.NewLine);
}
}
return stringBuilder.ToString();
}
// Token: 0x040001CE RID: 462
private ArrayList rfc822Name;
// Token: 0x040001CF RID: 463
private ArrayList dnsName;
// Token: 0x040001D0 RID: 464
private ArrayList directoryNames;
// Token: 0x040001D1 RID: 465
private ArrayList uris;
// Token: 0x040001D2 RID: 466
private ArrayList ipAddr;
// Token: 0x040001D3 RID: 467
private ASN1 asn;
}
}