internal static void Decode(ref AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory <byte> rebind, out KEKRecipientInfoAsn decoded) { decoded = default; KEKIdentifierAsn kekIdentifier; AlgorithmIdentifierAsn algIdentifier; AsnValueReader sequenceReader = reader.ReadSequence(expectedTag); int version; if (sequenceReader.TryReadInt32(out version)) { decoded.Version = version; } KEKIdentifierAsn.Decode(ref sequenceReader, Asn1Tag.Sequence, rebind, out kekIdentifier); AlgorithmIdentifierAsn.Decode(ref sequenceReader, Asn1Tag.Sequence, rebind, out algIdentifier); var encryptedKey = sequenceReader.ReadOctetString(); decoded.KEKId = kekIdentifier; decoded.KeyEncryptionAlg = algIdentifier; decoded.EncryptedKey = encryptedKey; }
internal static void Decode(ref AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory <byte> rebind, out KEKIdentifierAsn decoded) { decoded = default; AsnValueReader sequenceReader = reader.ReadSequence(expectedTag); decoded.KeyIdentifier = sequenceReader.ReadOctetString(); }