internal SubjectIdentifier(SignerIdentifierAsn signerIdentifierAsn)
        {
            if (signerIdentifierAsn.IssuerAndSerialNumber.HasValue)
            {
                ReadOnlySpan <byte> issuerNameSpan = signerIdentifierAsn.IssuerAndSerialNumber.Value.Issuer.Span;
                ReadOnlySpan <byte> serial         = signerIdentifierAsn.IssuerAndSerialNumber.Value.SerialNumber.Span;

                bool nonZero = false;

                for (int i = 0; i < serial.Length; i++)
                {
                    if (serial[i] != 0)
                    {
                        nonZero = true;
                        break;
                    }
                }

                // If the serial number is zero and the subject is exactly "CN=Dummy Signer"
                // then this is the special "NoSignature" signer.
                if (!nonZero &&
                    DummySignerEncodedValue.AsReadOnlySpan().SequenceEqual(issuerNameSpan))
                {
                    Type  = SubjectIdentifierType.NoSignature;
                    Value = null;
                }
                else
                {
                    Type = SubjectIdentifierType.IssuerAndSerialNumber;

                    var name = new X500DistinguishedName(issuerNameSpan.ToArray());
                    Value = new X509IssuerSerial(name.Name, serial.ToSkiString());
                }
            }
            else if (signerIdentifierAsn.SubjectKeyIdentifier != null)
            {
                Type  = SubjectIdentifierType.SubjectKeyIdentifier;
                Value = signerIdentifierAsn.SubjectKeyIdentifier.Value.Span.ToSkiString();
            }
            else
            {
                Debug.Fail("Do not know how to decode value");
                throw new CryptographicException();
            }
        }
 internal SubjectIdentifier(SignerIdentifierAsn signerIdentifierAsn)
     : this(signerIdentifierAsn.IssuerAndSerialNumber, signerIdentifierAsn.SubjectKeyIdentifier)
 {
 }