This commit is contained in:
2026-06-15 18:18:16 +08:00
parent 97c9fba14e
commit 2b9f134e5f
4164 changed files with 386922 additions and 79 deletions

View File

@@ -0,0 +1,44 @@
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms
{
/**
* Produce an object suitable for an Asn1OutputStream.
* <pre>
* ContentInfo ::= SEQUENCE {
* contentType ContentType,
* content
* [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
* </pre>
*/
public class ContentInfoParser
{
private readonly DerObjectIdentifier m_contentType;
private readonly Asn1TaggedObjectParser m_content;
public ContentInfoParser(Asn1SequenceParser seq)
{
m_contentType = (DerObjectIdentifier)seq.ReadObject();
m_content = (Asn1TaggedObjectParser)seq.ReadObject();
}
public DerObjectIdentifier ContentType
{
get { return m_contentType; }
}
public IAsn1Convertible GetContent(int tag)
{
if (null == m_content)
return null;
// TODO[cms] Ideally we could enforce the claimed tag
//return Asn1Utilities.ParseContextBaseUniversal(content, 0, true, tag);
return Asn1Utilities.ParseExplicitContextBaseObject(m_content, 0);
}
}
}
#pragma warning restore
#endif