add all
This commit is contained in:
46
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/openssl/PEMWriter.cs
vendored
Normal file
46
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/openssl/PEMWriter.cs
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System.IO;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Security;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Pem;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.OpenSsl
|
||||
{
|
||||
/// <remarks>General purpose writer for OpenSSL PEM objects.</remarks>
|
||||
public class PemWriter
|
||||
: Utilities.IO.Pem.PemWriter
|
||||
{
|
||||
/// <param name="writer">The TextWriter object to write the output to.</param>
|
||||
public PemWriter(TextWriter writer)
|
||||
: base(writer)
|
||||
{
|
||||
}
|
||||
|
||||
public void WriteObject(object obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
base.WriteObject(new MiscPemGenerator(obj));
|
||||
}
|
||||
catch (PemGenerationException e)
|
||||
{
|
||||
if (e.InnerException is IOException inner)
|
||||
throw inner;
|
||||
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteObject(
|
||||
object obj,
|
||||
string algorithm,
|
||||
char[] password,
|
||||
SecureRandom random)
|
||||
{
|
||||
base.WriteObject(new MiscPemGenerator(obj, algorithm, password, random));
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
Reference in New Issue
Block a user