Files
niko c12fbe3fc6 m
2026-04-12 16:51:38 +02:00

185 lines
10 KiB
C#

using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms
{
// Token: 0x02001E2C RID: 7724
[Token(Token = "0x2001E2C")]
public class DefaultDigestAlgorithmIdentifierFinder
{
// Token: 0x0600C1C9 RID: 49609 RVA: 0x002BC710 File Offset: 0x002BA910
[Token(Token = "0x600C1C9")]
[Address(RVA = "0x292AA00", Offset = "0x2929A00", VA = "0x18292AA00")]
static DefaultDigestAlgorithmIdentifierFinder()
{
IDictionary dictionary = Platform.CreateHashtable();
DefaultDigestAlgorithmIdentifierFinder.digestOids = dictionary;
DefaultDigestAlgorithmIdentifierFinder.digestNameToOids = Platform.CreateHashtable();
IDictionary dictionary2 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier md = PkcsObjectIdentifiers.MD4;
IDictionary dictionary3 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier md2 = PkcsObjectIdentifiers.MD4;
IDictionary dictionary4 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier md3 = PkcsObjectIdentifiers.MD5;
IDictionary dictionary5 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary6 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha2 = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary7 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha3 = NistObjectIdentifiers.IdSha224;
IDictionary dictionary8 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha4 = NistObjectIdentifiers.IdSha256;
IDictionary dictionary9 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha5 = NistObjectIdentifiers.IdSha384;
IDictionary dictionary10 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha6 = NistObjectIdentifiers.IdSha512;
IDictionary dictionary11 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier md4 = PkcsObjectIdentifiers.MD2;
IDictionary dictionary12 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier md5 = PkcsObjectIdentifiers.MD4;
IDictionary dictionary13 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier md6 = PkcsObjectIdentifiers.MD5;
IDictionary dictionary14 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha7 = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary15 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha8 = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary16 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha9 = NistObjectIdentifiers.IdSha224;
IDictionary dictionary17 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha10 = NistObjectIdentifiers.IdSha256;
IDictionary dictionary18 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha11 = NistObjectIdentifiers.IdSha384;
IDictionary dictionary19 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha12 = NistObjectIdentifiers.IdSha512;
IDictionary dictionary20 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha13 = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary21 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha14 = NistObjectIdentifiers.IdSha224;
IDictionary dictionary22 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha15 = NistObjectIdentifiers.IdSha256;
IDictionary dictionary23 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha16 = NistObjectIdentifiers.IdSha384;
IDictionary dictionary24 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier idSha17 = NistObjectIdentifiers.IdSha512;
IDictionary dictionary25 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier ripeMD = TeleTrusTObjectIdentifiers.RipeMD128;
IDictionary dictionary26 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier ripeMD2 = TeleTrusTObjectIdentifiers.RipeMD160;
IDictionary dictionary27 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier ripeMD3 = TeleTrusTObjectIdentifiers.RipeMD256;
IDictionary dictionary28 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier gostR = CryptoProObjectIdentifiers.GostR3411;
IDictionary dictionary29 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
DerObjectIdentifier gostR2 = CryptoProObjectIdentifiers.GostR3411;
IDictionary dictionary30 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha18 = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary31 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha19 = NistObjectIdentifiers.IdSha224;
IDictionary dictionary32 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha20 = NistObjectIdentifiers.IdSha256;
IDictionary dictionary33 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha21 = NistObjectIdentifiers.IdSha384;
IDictionary dictionary34 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha22 = NistObjectIdentifiers.IdSha512;
IDictionary dictionary35 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha23 = OiwObjectIdentifiers.IdSha1;
IDictionary dictionary36 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha24 = NistObjectIdentifiers.IdSha224;
IDictionary dictionary37 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha25 = NistObjectIdentifiers.IdSha256;
IDictionary dictionary38 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha26 = NistObjectIdentifiers.IdSha384;
IDictionary dictionary39 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha27 = NistObjectIdentifiers.IdSha512;
IDictionary dictionary40 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha3_ = NistObjectIdentifiers.IdSha3_224;
IDictionary dictionary41 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha3_2 = NistObjectIdentifiers.IdSha3_256;
IDictionary dictionary42 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha3_3 = NistObjectIdentifiers.IdSha3_384;
IDictionary dictionary43 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idSha3_4 = NistObjectIdentifiers.IdSha3_512;
IDictionary dictionary44 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idShake = NistObjectIdentifiers.IdShake128;
IDictionary dictionary45 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier idShake2 = NistObjectIdentifiers.IdShake256;
IDictionary dictionary46 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier gostR3 = CryptoProObjectIdentifiers.GostR3411;
IDictionary dictionary47 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier md7 = PkcsObjectIdentifiers.MD2;
IDictionary dictionary48 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier md8 = PkcsObjectIdentifiers.MD4;
IDictionary dictionary49 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier md9 = PkcsObjectIdentifiers.MD5;
IDictionary dictionary50 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier ripeMD4 = TeleTrusTObjectIdentifiers.RipeMD128;
IDictionary dictionary51 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier ripeMD5 = TeleTrusTObjectIdentifiers.RipeMD160;
IDictionary dictionary52 = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
DerObjectIdentifier ripeMD6 = TeleTrusTObjectIdentifiers.RipeMD256;
}
// Token: 0x0600C1CA RID: 49610 RVA: 0x002BCA08 File Offset: 0x002BAC08
[Token(Token = "0x600C1CA")]
[Address(RVA = "0x292BAA0", Offset = "0x292AAA0", VA = "0x18292BAA0")]
public AlgorithmIdentifier find(AlgorithmIdentifier sigAlgId)
{
int num;
AlgorithmIdentifier algorithmIdentifier;
for (;;)
{
Asn1Object asn1Object = sigAlgId.ToAsn1Object();
IDictionary dictionary = DefaultDigestAlgorithmIdentifierFinder.digestOids;
Asn1Object asn1Object2 = sigAlgId.ToAsn1Object();
DerNull instance = DerNull.Instance;
algorithmIdentifier = new AlgorithmIdentifier(num, instance);
if (asn1Object2 == 0)
{
break;
}
if (asn1Object2 != 0)
{
return algorithmIdentifier;
}
}
num = 0;
return algorithmIdentifier;
}
// Token: 0x0600C1CB RID: 49611 RVA: 0x002BCA64 File Offset: 0x002BAC64
[Token(Token = "0x600C1CB")]
[Address(RVA = "0x292BCE0", Offset = "0x292ACE0", VA = "0x18292BCE0")]
public AlgorithmIdentifier find(string digAlgName)
{
IDictionary dictionary = DefaultDigestAlgorithmIdentifierFinder.digestNameToOids;
IDictionary dictionary2 = DefaultDigestAlgorithmIdentifierFinder.digestOids;
AlgorithmIdentifier algorithmIdentifier;
return algorithmIdentifier;
}
// Token: 0x0600C1CC RID: 49612 RVA: 0x002BCA88 File Offset: 0x002BAC88
[Token(Token = "0x600C1CC")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public DefaultDigestAlgorithmIdentifierFinder()
{
}
// Token: 0x04007AA3 RID: 31395
[Token(Token = "0x4007AA3")]
private static readonly IDictionary digestOids;
// Token: 0x04007AA4 RID: 31396
[Token(Token = "0x4007AA4")]
private static readonly IDictionary digestNameToOids;
}
}