295 lines
11 KiB
C#
295 lines
11 KiB
C#
using System;
|
|
using System.IO;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs
|
|
{
|
|
// Token: 0x02001E97 RID: 7831
|
|
[Token(Token = "0x2001E97")]
|
|
public class PrivateKeyInfo : Asn1Encodable
|
|
{
|
|
// Token: 0x0600C5DC RID: 50652 RVA: 0x002D2F88 File Offset: 0x002D1188
|
|
[Token(Token = "0x600C5DC")]
|
|
[Address(RVA = "0x2BC7320", Offset = "0x2BC6120", VA = "0x182BC7320")]
|
|
public static PrivateKeyInfo GetInstance(Asn1TaggedObject obj, bool explicitly)
|
|
{
|
|
Asn1Sequence instance;
|
|
Asn1Sequence instance2;
|
|
for (;;)
|
|
{
|
|
instance = Asn1Sequence.GetInstance(obj, explicitly);
|
|
if (instance == 0)
|
|
{
|
|
return;
|
|
}
|
|
if (instance == 0)
|
|
{
|
|
break;
|
|
}
|
|
if (instance2 != 0)
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
instance2 = Asn1Sequence.GetInstance(instance);
|
|
return new PrivateKeyInfo(instance2);
|
|
}
|
|
|
|
// Token: 0x0600C5DD RID: 50653 RVA: 0x002D2FC4 File Offset: 0x002D11C4
|
|
[Token(Token = "0x600C5DD")]
|
|
[Address(RVA = "0x2BC7220", Offset = "0x2BC6020", VA = "0x182BC7220")]
|
|
public static PrivateKeyInfo GetInstance(object obj)
|
|
{
|
|
while (obj != 0)
|
|
{
|
|
Asn1Sequence instance;
|
|
if (obj == 0)
|
|
{
|
|
instance = Asn1Sequence.GetInstance(obj);
|
|
return new PrivateKeyInfo(instance);
|
|
}
|
|
if (instance != 0)
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600C5DE RID: 50654 RVA: 0x002D2FF8 File Offset: 0x002D11F8
|
|
[Token(Token = "0x600C5DE")]
|
|
[Address(RVA = "0x2BC7420", Offset = "0x2BC6220", VA = "0x182BC7420")]
|
|
private static int GetVersionValue(DerInteger version)
|
|
{
|
|
BigInteger value = version.Value;
|
|
BigInteger zero = BigInteger.Zero;
|
|
int num = value.CompareTo(zero);
|
|
BigInteger one = BigInteger.One;
|
|
int num2 = value.CompareTo(one);
|
|
return value.IntValue;
|
|
}
|
|
|
|
// Token: 0x0600C5DF RID: 50655 RVA: 0x002D3038 File Offset: 0x002D1238
|
|
[Token(Token = "0x600C5DF")]
|
|
[Address(RVA = "0x2BC7DC0", Offset = "0x2BC6BC0", VA = "0x182BC7DC0")]
|
|
public PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, Asn1Encodable privateKey)
|
|
{
|
|
DerInteger derInteger = new DerInteger(BigInteger.Zero);
|
|
this.version = derInteger;
|
|
this.privateKeyAlgorithm = privateKeyAlgorithm;
|
|
DerOctetString derOctetString = new DerOctetString(privateKey);
|
|
int num = 0;
|
|
this.privateKey = derOctetString;
|
|
this.attributes = num;
|
|
this.publicKey = num;
|
|
}
|
|
|
|
// Token: 0x0600C5E0 RID: 50656 RVA: 0x002D3088 File Offset: 0x002D1288
|
|
[Token(Token = "0x600C5E0")]
|
|
[Address(RVA = "0x2BC78C0", Offset = "0x2BC66C0", VA = "0x182BC78C0")]
|
|
public PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, Asn1Encodable privateKey, Asn1Set attributes)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600C5E1 RID: 50657 RVA: 0x002D3098 File Offset: 0x002D1298
|
|
[Token(Token = "0x600C5E1")]
|
|
[Address(RVA = "0x2BC7C60", Offset = "0x2BC6A60", VA = "0x182BC7C60")]
|
|
public PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, Asn1Encodable privateKey, Asn1Set attributes, byte[] publicKey)
|
|
{
|
|
DerInteger derInteger = new DerInteger(BigInteger.Zero);
|
|
this.version = derInteger;
|
|
this.privateKeyAlgorithm = privateKeyAlgorithm;
|
|
DerOctetString derOctetString = new DerOctetString(privateKey);
|
|
this.privateKey = derOctetString;
|
|
this.attributes = attributes;
|
|
DerBitString derBitString;
|
|
this.publicKey = derBitString;
|
|
}
|
|
|
|
// Token: 0x0600C5E2 RID: 50658 RVA: 0x002D30E8 File Offset: 0x002D12E8
|
|
[Token(Token = "0x600C5E2")]
|
|
[Address(RVA = "0x2BC78E0", Offset = "0x2BC66E0", VA = "0x182BC78E0")]
|
|
private PrivateKeyInfo(Asn1Sequence seq)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600C5E2)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs.PrivateKeyInfo::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Asn1Sequence)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_C9:
|
|
stloc:ArgumentException(var_15_D8, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("unknown optional field in private key info"), ldstr:string("seq")))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x17001EB8 RID: 7864
|
|
// (get) Token: 0x0600C5E3 RID: 50659 RVA: 0x002D31D0 File Offset: 0x002D13D0
|
|
[Token(Token = "0x17001EB8")]
|
|
public virtual Asn1Set Attributes
|
|
{
|
|
[Token(Token = "0x600C5E3")]
|
|
[Address(RVA = "0x3F63E0", Offset = "0x3F51E0", VA = "0x1803F63E0", Slot = "6")]
|
|
get
|
|
{
|
|
return this.attributes;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001EB9 RID: 7865
|
|
// (get) Token: 0x0600C5E4 RID: 50660 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x17001EB9")]
|
|
public virtual bool HasPublicKey
|
|
{
|
|
[Token(Token = "0x600C5E4")]
|
|
[Address(RVA = "0xA5F420", Offset = "0xA5E220", VA = "0x180A5F420", Slot = "7")]
|
|
get
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001EBA RID: 7866
|
|
// (get) Token: 0x0600C5E5 RID: 50661 RVA: 0x002D31E4 File Offset: 0x002D13E4
|
|
[Token(Token = "0x17001EBA")]
|
|
public virtual AlgorithmIdentifier PrivateKeyAlgorithm
|
|
{
|
|
[Token(Token = "0x600C5E5")]
|
|
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40", Slot = "8")]
|
|
get
|
|
{
|
|
return this.privateKeyAlgorithm;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600C5E6 RID: 50662 RVA: 0x002D31F8 File Offset: 0x002D13F8
|
|
[Token(Token = "0x600C5E6")]
|
|
[Address(RVA = "0x2BC7530", Offset = "0x2BC6330", VA = "0x182BC7530", Slot = "9")]
|
|
public virtual Asn1Object ParsePrivateKey()
|
|
{
|
|
Stream octetStream = this.privateKey.GetOctetStream();
|
|
Asn1Object asn1Object;
|
|
return asn1Object;
|
|
}
|
|
|
|
// Token: 0x0600C5E7 RID: 50663 RVA: 0x002D3218 File Offset: 0x002D1418
|
|
[Token(Token = "0x600C5E7")]
|
|
[Address(RVA = "0x2BC7570", Offset = "0x2BC6370", VA = "0x182BC7570", Slot = "10")]
|
|
public virtual Asn1Object ParsePublicKey()
|
|
{
|
|
DerBitString derBitString = this.publicKey;
|
|
if (derBitString == 0)
|
|
{
|
|
}
|
|
string @string = derBitString.GetString();
|
|
Asn1Object asn1Object;
|
|
return asn1Object;
|
|
}
|
|
|
|
// Token: 0x17001EBB RID: 7867
|
|
// (get) Token: 0x0600C5E8 RID: 50664 RVA: 0x002D323C File Offset: 0x002D143C
|
|
[Token(Token = "0x17001EBB")]
|
|
public virtual DerBitString PublicKeyData
|
|
{
|
|
[Token(Token = "0x600C5E8")]
|
|
[Address(RVA = "0x3FA180", Offset = "0x3F8F80", VA = "0x1803FA180", Slot = "11")]
|
|
get
|
|
{
|
|
return this.publicKey;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600C5E9 RID: 50665 RVA: 0x002D3250 File Offset: 0x002D1450
|
|
[Token(Token = "0x600C5E9")]
|
|
[Address(RVA = "0x2BC75B0", Offset = "0x2BC63B0", VA = "0x182BC75B0", Slot = "5")]
|
|
public override Asn1Object ToAsn1Object()
|
|
{
|
|
Asn1Encodable[] array = new Asn1Encodable[3];
|
|
DerInteger derInteger = this.version;
|
|
if (derInteger != 0)
|
|
{
|
|
}
|
|
array[0] = derInteger;
|
|
AlgorithmIdentifier algorithmIdentifier = this.privateKeyAlgorithm;
|
|
if (algorithmIdentifier != 0)
|
|
{
|
|
}
|
|
array[1] = algorithmIdentifier;
|
|
Asn1OctetString asn1OctetString = this.privateKey;
|
|
if (asn1OctetString != 0)
|
|
{
|
|
}
|
|
array[2] = asn1OctetString;
|
|
Asn1EncodableVector asn1EncodableVector = new Asn1EncodableVector(array);
|
|
if (this.attributes != (ulong)0L)
|
|
{
|
|
Asn1Encodable[] array2 = new Asn1Encodable[1];
|
|
Asn1Set asn1Set = this.attributes;
|
|
int num;
|
|
int num2;
|
|
DerTaggedObject derTaggedObject = new DerTaggedObject(num != 0, num2, asn1Set);
|
|
num2 = 0;
|
|
num = 0;
|
|
if (derTaggedObject != 0)
|
|
{
|
|
}
|
|
array2[0] = derTaggedObject;
|
|
asn1EncodableVector.Add(array2);
|
|
}
|
|
if (this.publicKey != (ulong)0L)
|
|
{
|
|
Asn1Encodable[] array3 = new Asn1Encodable[1];
|
|
DerBitString derBitString = this.publicKey;
|
|
int num3;
|
|
DerTaggedObject derTaggedObject2 = new DerTaggedObject(num3 != 0, 1, derBitString);
|
|
num3 = 0;
|
|
if (derTaggedObject2 != 0)
|
|
{
|
|
}
|
|
array3[0] = derTaggedObject2;
|
|
asn1EncodableVector.Add(array3);
|
|
}
|
|
DerSequence derSequence = new DerSequence(asn1EncodableVector);
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x04007DAE RID: 32174
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4007DAE")]
|
|
private readonly DerInteger version;
|
|
|
|
// Token: 0x04007DAF RID: 32175
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4007DAF")]
|
|
private readonly AlgorithmIdentifier privateKeyAlgorithm;
|
|
|
|
// Token: 0x04007DB0 RID: 32176
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4007DB0")]
|
|
private readonly Asn1OctetString privateKey;
|
|
|
|
// Token: 0x04007DB1 RID: 32177
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4007DB1")]
|
|
private readonly Asn1Set attributes;
|
|
|
|
// Token: 0x04007DB2 RID: 32178
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4007DB2")]
|
|
private readonly DerBitString publicKey;
|
|
}
|
|
}
|