297 lines
11 KiB
C#
297 lines
11 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs
|
|
{
|
|
// Token: 0x020018BA RID: 6330
|
|
[Token(Token = "0x20018BA")]
|
|
[StructLayout(3)]
|
|
public class PrivateKeyInfo : Asn1Encodable
|
|
{
|
|
// Token: 0x0600AA02 RID: 43522 RVA: 0x0027AA7C File Offset: 0x00278C7C
|
|
[Token(Token = "0x600AA02")]
|
|
[Address(RVA = "0x27D8AD0", Offset = "0x27D74D0", VA = "0x1827D8AD0")]
|
|
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: 0x0600AA03 RID: 43523 RVA: 0x0027AAB8 File Offset: 0x00278CB8
|
|
[Token(Token = "0x600AA03")]
|
|
[Address(RVA = "0x27D89D0", Offset = "0x27D73D0", VA = "0x1827D89D0")]
|
|
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: 0x0600AA04 RID: 43524 RVA: 0x0027AAEC File Offset: 0x00278CEC
|
|
[Token(Token = "0x600AA04")]
|
|
[Address(RVA = "0x27D8BD0", Offset = "0x27D75D0", VA = "0x1827D8BD0")]
|
|
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: 0x0600AA05 RID: 43525 RVA: 0x0027AB2C File Offset: 0x00278D2C
|
|
[Token(Token = "0x600AA05")]
|
|
[Address(RVA = "0x27D9570", Offset = "0x27D7F70", VA = "0x1827D9570")]
|
|
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: 0x0600AA06 RID: 43526 RVA: 0x0027AB7C File Offset: 0x00278D7C
|
|
[Token(Token = "0x600AA06")]
|
|
[Address(RVA = "0x27D9070", Offset = "0x27D7A70", VA = "0x1827D9070")]
|
|
public PrivateKeyInfo(AlgorithmIdentifier privateKeyAlgorithm, Asn1Encodable privateKey, Asn1Set attributes)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600AA07 RID: 43527 RVA: 0x0027AB8C File Offset: 0x00278D8C
|
|
[Token(Token = "0x600AA07")]
|
|
[Address(RVA = "0x27D9410", Offset = "0x27D7E10", VA = "0x1827D9410")]
|
|
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: 0x0600AA08 RID: 43528 RVA: 0x0027ABDC File Offset: 0x00278DDC
|
|
[Token(Token = "0x600AA08")]
|
|
[Address(RVA = "0x27D9090", Offset = "0x27D7A90", VA = "0x1827D9090")]
|
|
private PrivateKeyInfo(Asn1Sequence seq)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600AA08)
|
|
|
|
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: 0x17001AB7 RID: 6839
|
|
// (get) Token: 0x0600AA09 RID: 43529 RVA: 0x0027ACC4 File Offset: 0x00278EC4
|
|
[Token(Token = "0x17001AB7")]
|
|
public virtual Asn1Set Attributes
|
|
{
|
|
[Token(Token = "0x600AA09")]
|
|
[Address(RVA = "0x3C1230", Offset = "0x3BFC30", VA = "0x1803C1230", Slot = "6")]
|
|
get
|
|
{
|
|
return this.attributes;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001AB8 RID: 6840
|
|
// (get) Token: 0x0600AA0A RID: 43530 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x17001AB8")]
|
|
public virtual bool HasPublicKey
|
|
{
|
|
[Token(Token = "0x600AA0A")]
|
|
[Address(RVA = "0x78E160", Offset = "0x78CB60", VA = "0x18078E160", Slot = "7")]
|
|
get
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001AB9 RID: 6841
|
|
// (get) Token: 0x0600AA0B RID: 43531 RVA: 0x0027ACD8 File Offset: 0x00278ED8
|
|
[Token(Token = "0x17001AB9")]
|
|
public virtual AlgorithmIdentifier PrivateKeyAlgorithm
|
|
{
|
|
[Token(Token = "0x600AA0B")]
|
|
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240", Slot = "8")]
|
|
get
|
|
{
|
|
return this.privateKeyAlgorithm;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600AA0C RID: 43532 RVA: 0x0027ACEC File Offset: 0x00278EEC
|
|
[Token(Token = "0x600AA0C")]
|
|
[Address(RVA = "0x27D8CE0", Offset = "0x27D76E0", VA = "0x1827D8CE0", Slot = "9")]
|
|
public virtual Asn1Object ParsePrivateKey()
|
|
{
|
|
Stream octetStream = this.privateKey.GetOctetStream();
|
|
Asn1Object asn1Object;
|
|
return asn1Object;
|
|
}
|
|
|
|
// Token: 0x0600AA0D RID: 43533 RVA: 0x0027AD0C File Offset: 0x00278F0C
|
|
[Token(Token = "0x600AA0D")]
|
|
[Address(RVA = "0x27D8D20", Offset = "0x27D7720", VA = "0x1827D8D20", Slot = "10")]
|
|
public virtual Asn1Object ParsePublicKey()
|
|
{
|
|
DerBitString derBitString = this.publicKey;
|
|
if (derBitString == 0)
|
|
{
|
|
}
|
|
string @string = derBitString.GetString();
|
|
Asn1Object asn1Object;
|
|
return asn1Object;
|
|
}
|
|
|
|
// Token: 0x17001ABA RID: 6842
|
|
// (get) Token: 0x0600AA0E RID: 43534 RVA: 0x0027AD30 File Offset: 0x00278F30
|
|
[Token(Token = "0x17001ABA")]
|
|
public virtual DerBitString PublicKeyData
|
|
{
|
|
[Token(Token = "0x600AA0E")]
|
|
[Address(RVA = "0x3C1250", Offset = "0x3BFC50", VA = "0x1803C1250", Slot = "11")]
|
|
get
|
|
{
|
|
return this.publicKey;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600AA0F RID: 43535 RVA: 0x0027AD44 File Offset: 0x00278F44
|
|
[Token(Token = "0x600AA0F")]
|
|
[Address(RVA = "0x27D8D60", Offset = "0x27D7760", VA = "0x1827D8D60", 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: 0x04006F6B RID: 28523
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006F6B")]
|
|
private readonly DerInteger version;
|
|
|
|
// Token: 0x04006F6C RID: 28524
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4006F6C")]
|
|
private readonly AlgorithmIdentifier privateKeyAlgorithm;
|
|
|
|
// Token: 0x04006F6D RID: 28525
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4006F6D")]
|
|
private readonly Asn1OctetString privateKey;
|
|
|
|
// Token: 0x04006F6E RID: 28526
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4006F6E")]
|
|
private readonly Asn1Set attributes;
|
|
|
|
// Token: 0x04006F6F RID: 28527
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4006F6F")]
|
|
private readonly DerBitString publicKey;
|
|
}
|
|
}
|