示例#1
0
        internal static void Decode(AsnReader reader, out RSAPublicKeyAsn decoded)
        {
            if (reader == null)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            Decode(reader, Asn1Tag.Sequence, out decoded);
        }
示例#2
0
        internal static void Decode(AsnReader reader, Asn1Tag expectedTag, out RSAPublicKeyAsn decoded)
        {
            if (reader == null)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            decoded = default;
            AsnReader sequenceReader = reader.ReadSequence(expectedTag);

            decoded.Modulus        = sequenceReader.GetInteger();
            decoded.PublicExponent = sequenceReader.GetInteger();

            sequenceReader.ThrowIfNotEmpty();
        }
示例#3
0
        internal static void Decode(ref AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory <byte> rebind, out RSAPublicKeyAsn decoded)
        {
            decoded = default;
            AsnValueReader sequenceReader = reader.ReadSequence(expectedTag);

            decoded.Modulus        = sequenceReader.ReadInteger();
            decoded.PublicExponent = sequenceReader.ReadInteger();

            sequenceReader.ThrowIfNotEmpty();
        }
示例#4
0
 internal static void Decode(ref AsnValueReader reader, ReadOnlyMemory <byte> rebind, out RSAPublicKeyAsn decoded)
 {
     Decode(ref reader, Asn1Tag.Sequence, rebind, out decoded);
 }
示例#5
0
 internal static void Decode(ref AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory <byte> rebind, out RSAPublicKeyAsn decoded)
 {
     try
     {
         DecodeCore(ref reader, expectedTag, rebind, out decoded);
     }
     catch (AsnContentException e)
     {
         throw new CryptographicException(SR.Cryptography_Der_Invalid_Encoding, e);
     }
 }