培训考核三期,新版培训,网页版培训登录器
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.

79 lines
1.9 KiB

#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500
{
public class DirectoryString
: Asn1Encodable, IAsn1Choice, IAsn1String
{
private readonly DerStringBase str;
public static DirectoryString GetInstance(object obj)
{
if (obj == null || obj is DirectoryString)
return (DirectoryString) obj;
if (obj is DerStringBase)
{
if (obj is DerT61String
|| obj is DerPrintableString
|| obj is DerUniversalString
|| obj is DerUtf8String
|| obj is DerBmpString)
{
return new DirectoryString((DerStringBase) obj);
}
}
throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
public static DirectoryString GetInstance(
Asn1TaggedObject obj,
bool isExplicit)
{
if (!isExplicit)
throw new ArgumentException("choice item must be explicitly tagged");
return GetInstance(obj.GetObject());
}
private DirectoryString(
DerStringBase str)
{
this.str = str;
}
public DirectoryString(
string str)
{
this.str = new DerUtf8String(str);
}
public string GetString()
{
return str.GetString();
}
/**
* <pre>
* DirectoryString ::= CHOICE {
* teletexString TeletexString (SIZE (1..MAX)),
* printableString PrintableString (SIZE (1..MAX)),
* universalString UniversalString (SIZE (1..MAX)),
* utf8String UTF8String (SIZE (1..MAX)),
* bmpString BMPString (SIZE (1..MAX)) }
* </pre>
*/
public override Asn1Object ToAsn1Object()
{
return str.ToAsn1Object();
}
}
}
#pragma warning restore
#endif