507 {
508 if (encodedDistinguishedName == null || encodedDistinguishedName.Length == 0)
509 {
510 return string.Empty;
511 }
512 int dwFormatStrType = (multiLine ? 1 : 0);
513 int pcbFormat = 0;
514 if (!global::Interop.Crypt32.CryptFormatObject(1, 0, dwFormatStrType,
IntPtr.
Zero, (
byte*)7, encodedDistinguishedName, encodedDistinguishedName.Length,
null, ref pcbFormat))
515 {
516 return encodedDistinguishedName.ToHexStringUpper();
517 }
518 int num = (pcbFormat + 1) / 2;
521 fixed (char* pbFormat = span2)
522 {
523 if (!global::Interop.Crypt32.CryptFormatObject(1, 0, dwFormatStrType,
IntPtr.
Zero, (
byte*)7, encodedDistinguishedName, encodedDistinguishedName.Length, pbFormat, ref pcbFormat))
524 {
525 return encodedDistinguishedName.ToHexStringUpper();
526 }
527 }
528 return new string(span2.
Slice(0, pcbFormat / 2 - 1));
529 }
static readonly IntPtr Zero
Span< T > Slice(int start)