add all
This commit is contained in:
52
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/cms/CMSContentInfoParser.cs
vendored
Normal file
52
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/cms/CMSContentInfoParser.cs
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace Best.HTTP.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()
|
||||
{
|
||||
data.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
Reference in New Issue
Block a user