12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #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
|