You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
52 lines
1.2 KiB
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) |
|
#pragma warning disable |
|
using System; |
|
using System.IO; |
|
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; |
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; |
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; |
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms |
|
{ |
|
public class CmsContentInfoParser |
|
{ |
|
protected ContentInfoParser contentInfo; |
|
protected Stream data; |
|
|
|
protected CmsContentInfoParser( |
|
Stream data) |
|
{ |
|
if (data == null) |
|
throw new ArgumentNullException("data"); |
|
|
|
this.data = data; |
|
|
|
try |
|
{ |
|
Asn1StreamParser inStream = new Asn1StreamParser(data); |
|
|
|
this.contentInfo = new ContentInfoParser((Asn1SequenceParser)inStream.ReadObject()); |
|
} |
|
catch (IOException e) |
|
{ |
|
throw new CmsException("IOException reading content.", e); |
|
} |
|
catch (InvalidCastException e) |
|
{ |
|
throw new CmsException("Unexpected object reading content.", e); |
|
} |
|
} |
|
|
|
/** |
|
* Close the underlying data stream. |
|
* @throws IOException if the close fails. |
|
*/ |
|
public void Close() |
|
{ |
|
BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(this.data); |
|
} |
|
} |
|
} |
|
#pragma warning restore |
|
#endif
|
|
|