diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-11-20 18:44:07 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-11-20 18:44:07 +0700 |
commit | fe0abc8e4f4eb407a7fff3e5d567a51ce49a4baf (patch) | |
tree | 33f1beb1702c99430a033cd52b568b283319c487 /crypto/src/asn1/cms | |
parent | ASN:1 tagged object parser updates from bc-java (diff) | |
download | BouncyCastle.NET-ed25519-fe0abc8e4f4eb407a7fff3e5d567a51ce49a4baf.tar.xz |
ASN.1: Tagged object parser improvements
- add DLTaggedObjectParser - refactoring of Asn1InputStream/Asn1StreamParser
Diffstat (limited to 'crypto/src/asn1/cms')
-rw-r--r-- | crypto/src/asn1/cms/ContentInfoParser.cs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/crypto/src/asn1/cms/ContentInfoParser.cs b/crypto/src/asn1/cms/ContentInfoParser.cs index 541cc0f59..750d8ba7a 100644 --- a/crypto/src/asn1/cms/ContentInfoParser.cs +++ b/crypto/src/asn1/cms/ContentInfoParser.cs @@ -13,28 +13,28 @@ namespace Org.BouncyCastle.Asn1.Cms */ public class ContentInfoParser { - private DerObjectIdentifier contentType; - private Asn1TaggedObjectParser content; + private readonly DerObjectIdentifier m_contentType; + private readonly Asn1TaggedObjectParser m_content; - public ContentInfoParser( - Asn1SequenceParser seq) + public ContentInfoParser(Asn1SequenceParser seq) { - contentType = (DerObjectIdentifier)seq.ReadObject(); - content = (Asn1TaggedObjectParser)seq.ReadObject(); + m_contentType = (DerObjectIdentifier)seq.ReadObject(); + m_content = (Asn1TaggedObjectParser)seq.ReadObject(); } public DerObjectIdentifier ContentType { - get { return contentType; } + get { return m_contentType; } } - public IAsn1Convertible GetContent( - int tag) + public IAsn1Convertible GetContent(int tag) { - if (content == null) + if (null == m_content) return null; - return content.GetObjectParser(tag, true); - } + // TODO[cms] Ideally we could enforce the claimed tag + //return Asn1Utilities.ParseContextBaseUniversal(content, 0, true, tag); + return Asn1Utilities.ParseExplicitContextBaseObject(m_content, 0); + } } } |