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

◆ Write()

static char[] System.Security.Cryptography.PemEncoding.Write ( ReadOnlySpan< char > label,
ReadOnlySpan< byte > data )
inlinestatic

Definition at line 283 of file PemEncoding.cs.

284 {
285 if (!IsValidLabel(label))
286 {
288 }
289 int encodedSize = GetEncodedSize(label.Length, data.Length);
290 char[] array = new char[encodedSize];
291 if (!TryWrite(label, data, array, out var _))
292 {
293 throw new ArgumentException(null, "data");
294 }
295 return array;
296 }
static string Argument_PemEncoding_InvalidLabel
Definition SR.cs:32
Definition SR.cs:7
static bool IsValidLabel(ReadOnlySpan< char > data)
static bool TryWrite(ReadOnlySpan< char > label, ReadOnlySpan< byte > data, Span< char > destination, out int charsWritten)
static int GetEncodedSize(int labelLength, int dataLength)

References System.SR.Argument_PemEncoding_InvalidLabel, System.array, System.Security.Cryptography.PemEncoding.GetEncodedSize(), System.Security.Cryptography.PemEncoding.IsValidLabel(), System.ReadOnlySpan< T >.Length, and System.Security.Cryptography.PemEncoding.TryWrite().