Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ WriteObjectIdentifierCore()

void System.Formats.Asn1.AsnWriter.WriteObjectIdentifierCore ( Asn1Tag tag,
ReadOnlySpan< char > oidValue )
inlineprivate

Definition at line 969 of file AsnWriter.cs.

970 {
971 if (oidValue.Length < 3)
972 {
974 }
975 if (oidValue[1] != '.')
976 {
978 }
980 int num = 0;
981 try
982 {
983 int num2 = oidValue[0] switch
984 {
985 '0' => 0,
986 '1' => 1,
987 '2' => 2,
988 _ => throw new ArgumentException(System.SR.Argument_InvalidOidValue, "oidValue"),
989 };
992 subIdentifier += (BigInteger)(40 * num2);
993 int num3 = EncodeSubIdentifier(array.AsSpan(num), ref subIdentifier);
994 num += num3;
995 while (!oidValue2.IsEmpty)
996 {
999 num += num3;
1000 }
1001 WriteTag(tag);
1002 WriteLength(num);
1003 Buffer.BlockCopy(array, 0, _buffer, _offset, num);
1004 _offset += num;
1005 }
1006 finally
1007 {
1009 }
1010 }
static BigInteger ParseSubIdentifier(ref ReadOnlySpan< char > oidValue)
void WriteLength(int length)
Definition AsnWriter.cs:272
static int EncodeSubIdentifier(Span< byte > dest, ref BigInteger subIdentifier)
void WriteTag(Asn1Tag tag)
Definition AsnWriter.cs:261
static string Argument_InvalidOidValue
Definition SR.cs:20
Definition SR.cs:7
static void Return(byte[] array, int clearSize=-1)
Definition CryptoPool.cs:12
static byte[] Rent(int minimumLength)
Definition CryptoPool.cs:7

References System.Formats.Asn1.AsnWriter._buffer, System.Formats.Asn1.AsnWriter._offset, System.SR.Argument_InvalidOidValue, System.array, System.Buffer.BlockCopy(), System.Formats.Asn1.AsnWriter.EncodeSubIdentifier(), System.Formats.Asn1.AsnWriter.ParseSubIdentifier(), System.Security.Cryptography.CryptoPool.Rent(), System.Security.Cryptography.CryptoPool.Return(), System.Formats.Asn1.AsnWriter.WriteLength(), and System.Formats.Asn1.AsnWriter.WriteTag().

Referenced by System.Formats.Asn1.AsnWriter.WriteObjectIdentifier().