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

◆ WriteConstructedCerOctetString()

void System.Formats.Asn1.AsnWriter.WriteConstructedCerOctetString ( Asn1Tag tag,
ReadOnlySpan< byte > payload )
inlineprivate

Definition at line 923 of file AsnWriter.cs.

924 {
925 WriteTag(tag.AsConstructed());
926 WriteLength(-1);
927 int result;
928 int num = Math.DivRem(payload.Length, 1000, out result);
929 int num2 = ((result != 0) ? (2 + result + GetEncodedLengthSubsequentByteCount(result)) : 0);
930 int pendingCount = num * 1004 + num2 + 2;
932 byte[] buffer = _buffer;
933 int offset = _offset;
935 Asn1Tag primitiveOctetString = Asn1Tag.PrimitiveOctetString;
937 while (readOnlySpan.Length > 1000)
938 {
940 WriteLength(1000);
941 destination = _buffer.AsSpan(_offset);
942 readOnlySpan.Slice(0, 1000).CopyTo(destination);
943 _offset += 1000;
944 readOnlySpan = readOnlySpan.Slice(1000);
945 }
948 destination = _buffer.AsSpan(_offset);
950 _offset += readOnlySpan.Length;
952 }
void CopyTo(KeyValuePair< TKey, TValue >[] array, int index)
void EnsureWriteCapacity(int pendingCount)
Definition AsnWriter.cs:246
static int GetEncodedLengthSubsequentByteCount(int length)
Definition AsnWriter.cs:303
void WriteLength(int length)
Definition AsnWriter.cs:272
void WriteTag(Asn1Tag tag)
Definition AsnWriter.cs:261

References System.Formats.Asn1.AsnWriter._buffer, System.Formats.Asn1.AsnWriter._offset, System.Formats.Asn1.Asn1Tag.AsConstructed(), System.buffer, System.Collections.Generic.Dictionary< TKey, TValue >.CopyTo(), System.destination, System.Math.DivRem(), System.Formats.Asn1.AsnWriter.EnsureWriteCapacity(), System.Formats.Asn1.AsnWriter.GetEncodedLengthSubsequentByteCount(), System.offset, System.Formats.Asn1.Asn1Tag.PrimitiveOctetString, System.Formats.Asn1.AsnWriter.WriteEndOfContents(), System.Formats.Asn1.AsnWriter.WriteLength(), and System.Formats.Asn1.AsnWriter.WriteTag().

Referenced by System.Formats.Asn1.AsnWriter.PopTag(), System.Formats.Asn1.AsnWriter.WriteConstructedCerCharacterString(), and System.Formats.Asn1.AsnWriter.WriteOctetStringCore().