45 lines
1002 B
C#
45 lines
1002 B
C#
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
|
#pragma warning disable
|
|
using System;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1
|
|
{
|
|
public class DerOctetString
|
|
: Asn1OctetString
|
|
{
|
|
/// <param name="str">The octets making up the octet string.</param>
|
|
public DerOctetString(
|
|
byte[] str)
|
|
: base(str)
|
|
{
|
|
}
|
|
|
|
public DerOctetString(IAsn1Convertible obj)
|
|
: this(obj.ToAsn1Object())
|
|
{
|
|
}
|
|
|
|
public DerOctetString(Asn1Encodable obj)
|
|
: base(obj.GetEncoded(Asn1Encodable.Der))
|
|
{
|
|
}
|
|
|
|
internal override void Encode(
|
|
DerOutputStream derOut)
|
|
{
|
|
derOut.WriteEncoded(Asn1Tags.OctetString, str);
|
|
}
|
|
|
|
internal static void Encode(
|
|
DerOutputStream derOut,
|
|
byte[] bytes,
|
|
int offset,
|
|
int length)
|
|
{
|
|
derOut.WriteEncoded(Asn1Tags.OctetString, bytes, offset, length);
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore
|
|
#endif
|