This commit is contained in:
2026-06-15 18:18:16 +08:00
parent 97c9fba14e
commit 2b9f134e5f
4164 changed files with 386922 additions and 79 deletions

View File

@@ -0,0 +1,75 @@
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509
{
/**
* Some other information of non-restrictive nature regarding the usage of this
* certificate.
*
* <pre>
* AdditionalInformationSyntax ::= DirectoryString (SIZE(1..2048))
* </pre>
*/
public class AdditionalInformationSyntax
: Asn1Encodable
{
private readonly DirectoryString information;
public static AdditionalInformationSyntax GetInstance(
object obj)
{
if (obj is AdditionalInformationSyntax)
return (AdditionalInformationSyntax) obj;
if (obj is IAsn1String)
return new AdditionalInformationSyntax(DirectoryString.GetInstance(obj));
throw new ArgumentException("Unknown object in GetInstance: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
private AdditionalInformationSyntax(
DirectoryString information)
{
this.information = information;
}
/**
* Constructor from a given details.
*
* @param information The describtion of the information.
*/
public AdditionalInformationSyntax(
string information)
{
this.information = new DirectoryString(information);
}
public virtual DirectoryString Information
{
get { return information; }
}
/**
* Produce an object suitable for an Asn1OutputStream.
* <p/>
* Returns:
* <p/>
* <pre>
* AdditionalInformationSyntax ::= DirectoryString (SIZE(1..2048))
* </pre>
*
* @return an Asn1Object
*/
public override Asn1Object ToAsn1Object()
{
return information.ToAsn1Object();
}
}
}
#pragma warning restore
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5d06e00a692047041bc68c25afa2929e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,279 @@
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509
{
/**
* Attribute to indicate admissions to certain professions.
* <p/>
* <pre>
* AdmissionSyntax ::= SEQUENCE
* {
* admissionAuthority GeneralName OPTIONAL,
* contentsOfAdmissions SEQUENCE OF Admissions
* }
* <p/>
* Admissions ::= SEQUENCE
* {
* admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
* namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
* professionInfos SEQUENCE OF ProfessionInfo
* }
* <p/>
* NamingAuthority ::= SEQUENCE
* {
* namingAuthorityId OBJECT IDENTIFIER OPTIONAL,
* namingAuthorityUrl IA5String OPTIONAL,
* namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
* }
* <p/>
* ProfessionInfo ::= SEQUENCE
* {
* namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
* professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
* professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
* registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
* addProfessionInfo OCTET STRING OPTIONAL
* }
* </pre>
* <p/>
* <p/>
* ISIS-MTT PROFILE: The relatively complex structure of AdmissionSyntax
* supports the following concepts and requirements:
* <ul>
* <li> External institutions (e.g. professional associations, chambers, unions,
* administrative bodies, companies, etc.), which are responsible for granting
* and verifying professional admissions, are indicated by means of the data
* field admissionAuthority. An admission authority is indicated by a
* GeneralName object. Here an X.501 directory name (distinguished name) can be
* indicated in the field directoryName, a URL address can be indicated in the
* field uniformResourceIdentifier, and an object identifier can be indicated in
* the field registeredId.</li>
* <li> The names of authorities which are responsible for the administration of
* title registers are indicated in the data field namingAuthority. The name of
* the authority can be identified by an object identifier in the field
* namingAuthorityId, by means of a text string in the field
* namingAuthorityText, by means of a URL address in the field
* namingAuthorityUrl, or by a combination of them. For example, the text string
* can contain the name of the authority, the country and the name of the title
* register. The URL-option refers to a web page which contains lists with
* officially registered professions (text and possibly OID) as well as
* further information on these professions. Object identifiers for the
* component namingAuthorityId are grouped under the OID-branch
* id-isis-at-namingAuthorities and must be applied for.</li>
* <li>See http://www.teletrust.de/anwend.asp?Id=30200&amp;Sprache=E_&amp;HomePG=0
* for an application form and http://www.teletrust.de/links.asp?id=30220,11
* for an overview of registered naming authorities.</li>
* <li> By means of the data type ProfessionInfo certain professions,
* specializations, disciplines, fields of activity, etc. are identified. A
* profession is represented by one or more text strings, resp. profession OIDs
* in the fields professionItems and professionOIDs and by a registration number
* in the field registrationNumber. An indication in text form must always be
* present, whereas the other indications are optional. The component
* addProfessionInfo may contain additional applicationspecific information in
* DER-encoded form.</li>
* </ul>
* <p/>
* By means of different namingAuthority-OIDs or profession OIDs hierarchies of
* professions, specializations, disciplines, fields of activity, etc. can be
* expressed. The issuing admission authority should always be indicated (field
* admissionAuthority), whenever a registration number is presented. Still,
* information on admissions can be given without indicating an admission or a
* naming authority by the exclusive use of the component professionItems. In
* this case the certification authority is responsible for the verification of
* the admission information.
* <p/>
* <p/>
* <p/>
* This attribute is single-valued. Still, several admissions can be captured in
* the sequence structure of the component contentsOfAdmissions of
* AdmissionSyntax or in the component professionInfos of Admissions. The
* component admissionAuthority of AdmissionSyntax serves as default value for
* the component admissionAuthority of Admissions. Within the latter component
* the default value can be overwritten, in case that another authority is
* responsible. The component namingAuthority of Admissions serves as a default
* value for the component namingAuthority of ProfessionInfo. Within the latter
* component the default value can be overwritten, in case that another naming
* authority needs to be recorded.
* <p/>
* The length of the string objects is limited to 128 characters. It is
* recommended to indicate a namingAuthorityURL in all issued attribute
* certificates. If a namingAuthorityURL is indicated, the field professionItems
* of ProfessionInfo should contain only registered titles. If the field
* professionOIDs exists, it has to contain the OIDs of the professions listed
* in professionItems in the same order. In general, the field professionInfos
* should contain only one entry, unless the admissions that are to be listed
* are logically connected (e.g. they have been issued under the same admission
* number).
*
* @see Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.Admissions
* @see Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.ProfessionInfo
* @see Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.NamingAuthority
*/
public class AdmissionSyntax
: Asn1Encodable
{
private readonly GeneralName admissionAuthority;
private readonly Asn1Sequence contentsOfAdmissions;
public static AdmissionSyntax GetInstance(
object obj)
{
if (obj == null || obj is AdmissionSyntax)
{
return (AdmissionSyntax)obj;
}
if (obj is Asn1Sequence)
{
return new AdmissionSyntax((Asn1Sequence)obj);
}
throw new ArgumentException("unknown object in factory: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
/**
* Constructor from Asn1Sequence.
* <p/>
* The sequence is of type ProcurationSyntax:
* <p/>
* <pre>
* AdmissionSyntax ::= SEQUENCE
* {
* admissionAuthority GeneralName OPTIONAL,
* contentsOfAdmissions SEQUENCE OF Admissions
* }
* <p/>
* Admissions ::= SEQUENCE
* {
* admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
* namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
* professionInfos SEQUENCE OF ProfessionInfo
* }
* <p/>
* NamingAuthority ::= SEQUENCE
* {
* namingAuthorityId OBJECT IDENTIFIER OPTIONAL,
* namingAuthorityUrl IA5String OPTIONAL,
* namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
* }
* <p/>
* ProfessionInfo ::= SEQUENCE
* {
* namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
* professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
* professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
* registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
* addProfessionInfo OCTET STRING OPTIONAL
* }
* </pre>
*
* @param seq The ASN.1 sequence.
*/
private AdmissionSyntax(
Asn1Sequence seq)
{
switch (seq.Count)
{
case 1:
this.contentsOfAdmissions = DerSequence.GetInstance(seq[0]);
break;
case 2:
admissionAuthority = GeneralName.GetInstance(seq[0]);
contentsOfAdmissions = DerSequence.GetInstance(seq[1]);
break;
default:
throw new ArgumentException("Bad sequence size: " + seq.Count);
}
}
/**
* Constructor from given details.
*
* @param admissionAuthority The admission authority.
* @param contentsOfAdmissions The admissions.
*/
public AdmissionSyntax(
GeneralName admissionAuthority,
Asn1Sequence contentsOfAdmissions)
{
this.admissionAuthority = admissionAuthority;
this.contentsOfAdmissions = contentsOfAdmissions;
}
/**
* Produce an object suitable for an Asn1OutputStream.
* <p/>
* Returns:
* <p/>
* <pre>
* AdmissionSyntax ::= SEQUENCE
* {
* admissionAuthority GeneralName OPTIONAL,
* contentsOfAdmissions SEQUENCE OF Admissions
* }
* <p/>
* Admissions ::= SEQUENCE
* {
* admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
* namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
* professionInfos SEQUENCE OF ProfessionInfo
* }
* <p/>
* NamingAuthority ::= SEQUENCE
* {
* namingAuthorityId OBJECT IDENTIFIER OPTIONAL,
* namingAuthorityUrl IA5String OPTIONAL,
* namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
* }
* <p/>
* ProfessionInfo ::= SEQUENCE
* {
* namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
* professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
* professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
* registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
* addProfessionInfo OCTET STRING OPTIONAL
* }
* </pre>
*
* @return an Asn1Object
*/
public override Asn1Object ToAsn1Object()
{
Asn1EncodableVector v = new Asn1EncodableVector();
v.AddOptional(admissionAuthority);
v.Add(contentsOfAdmissions);
return new DerSequence(v);
}
/**
* @return Returns the admissionAuthority if present, null otherwise.
*/
public virtual GeneralName AdmissionAuthority
{
get { return admissionAuthority; }
}
/**
* @return Returns the contentsOfAdmissions.
*/
public virtual Admissions[] GetContentsOfAdmissions()
{
Admissions[] result = new Admissions[contentsOfAdmissions.Count];
for (int i = 0; i < contentsOfAdmissions.Count; ++i)
{
result[i] = Admissions.GetInstance(contentsOfAdmissions[i]);
}
return result;
}
}
}
#pragma warning restore
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9585d9a3646432b498c88670026b6b1c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,174 @@
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509
{
/**
* An Admissions structure.
* <p/>
* <pre>
* Admissions ::= SEQUENCE
* {
* admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
* namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
* professionInfos SEQUENCE OF ProfessionInfo
* }
* <p/>
* </pre>
*
* @see Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.AdmissionSyntax
* @see Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.ProfessionInfo
* @see Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.NamingAuthority
*/
public class Admissions
: Asn1Encodable
{
private readonly GeneralName admissionAuthority;
private readonly NamingAuthority namingAuthority;
private readonly Asn1Sequence professionInfos;
public static Admissions GetInstance(object obj)
{
if (obj == null || obj is Admissions)
return (Admissions)obj;
if (obj is Asn1Sequence seq)
return new Admissions(seq);
throw new ArgumentException("unknown object in factory: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
/**
* Constructor from Asn1Sequence.
* <p/>
* The sequence is of type ProcurationSyntax:
* <p/>
* <pre>
* Admissions ::= SEQUENCE
* {
* admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
* namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
* professionInfos SEQUENCE OF ProfessionInfo
* }
* </pre>
*
* @param seq The ASN.1 sequence.
*/
private Admissions(Asn1Sequence seq)
{
if (seq.Count > 3)
throw new ArgumentException("Bad sequence size: " + seq.Count);
var e = seq.GetEnumerator();
e.MoveNext();
Asn1Encodable o = e.Current;
if (o is Asn1TaggedObject tagged1)
{
switch (tagged1.TagNo)
{
case 0:
admissionAuthority = GeneralName.GetInstance((Asn1TaggedObject)o, true);
break;
case 1:
namingAuthority = NamingAuthority.GetInstance((Asn1TaggedObject)o, true);
break;
default:
throw new ArgumentException("Bad tag number: " + ((Asn1TaggedObject)o).TagNo);
}
e.MoveNext();
o = e.Current;
}
if (o is Asn1TaggedObject tagged2)
{
switch (tagged2.TagNo)
{
case 1:
namingAuthority = NamingAuthority.GetInstance((Asn1TaggedObject)o, true);
break;
default:
throw new ArgumentException("Bad tag number: " + ((Asn1TaggedObject)o).TagNo);
}
e.MoveNext();
o = e.Current;
}
professionInfos = Asn1Sequence.GetInstance(o);
if (e.MoveNext())
{
throw new ArgumentException("Bad object encountered: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(e.Current));
}
}
/**
* Constructor from a given details.
* <p/>
* Parameter <code>professionInfos</code> is mandatory.
*
* @param admissionAuthority The admission authority.
* @param namingAuthority The naming authority.
* @param professionInfos The profession infos.
*/
public Admissions(
GeneralName admissionAuthority,
NamingAuthority namingAuthority,
ProfessionInfo[] professionInfos)
{
this.admissionAuthority = admissionAuthority;
this.namingAuthority = namingAuthority;
this.professionInfos = new DerSequence(professionInfos);
}
public virtual GeneralName AdmissionAuthority
{
get { return admissionAuthority; }
}
public virtual NamingAuthority NamingAuthority
{
get { return namingAuthority; }
}
public ProfessionInfo[] GetProfessionInfos()
{
ProfessionInfo[] infos = new ProfessionInfo[professionInfos.Count];
int count = 0;
foreach (Asn1Encodable ae in professionInfos)
{
infos[count++] = ProfessionInfo.GetInstance(ae);
}
return infos;
}
/**
* Produce an object suitable for an Asn1OutputStream.
* <p/>
* Returns:
* <p/>
* <pre>
* Admissions ::= SEQUENCE
* {
* admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
* namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
* professionInfos SEQUENCE OF ProfessionInfo
* }
* <p/>
* </pre>
*
* @return an Asn1Object
*/
public override Asn1Object ToAsn1Object()
{
Asn1EncodableVector v = new Asn1EncodableVector();
v.AddOptionalTagged(true, 0, admissionAuthority);
v.AddOptionalTagged(true, 1, namingAuthority);
v.Add(professionInfos);
return new DerSequence(v);
}
}
}
#pragma warning restore
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e7a8122cc5f09da46b019dbd4bb8a39e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,176 @@
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509
{
/**
* A declaration of majority.
* <p/>
* <pre>
* DeclarationOfMajoritySyntax ::= CHOICE
* {
* notYoungerThan [0] IMPLICIT INTEGER,
* fullAgeAtCountry [1] IMPLICIT SEQUENCE
* {
* fullAge BOOLEAN DEFAULT TRUE,
* country PrintableString (SIZE(2))
* }
* dateOfBirth [2] IMPLICIT GeneralizedTime
* }
* </pre>
* <p/>
* fullAgeAtCountry indicates the majority of the owner with respect to the laws
* of a specific country.
*/
public class DeclarationOfMajority
: Asn1Encodable, IAsn1Choice
{
public enum Choice
{
NotYoungerThan = 0,
FullAgeAtCountry = 1,
DateOfBirth = 2
};
private readonly Asn1TaggedObject declaration;
public DeclarationOfMajority(
int notYoungerThan)
{
declaration = new DerTaggedObject(false, 0, new DerInteger(notYoungerThan));
}
public DeclarationOfMajority(
bool fullAge,
string country)
{
if (country.Length > 2)
throw new ArgumentException("country can only be 2 characters");
DerPrintableString countryString = new DerPrintableString(country, true);
DerSequence seq;
if (fullAge)
{
seq = new DerSequence(countryString);
}
else
{
seq = new DerSequence(DerBoolean.False, countryString);
}
this.declaration = new DerTaggedObject(false, 1, seq);
}
public DeclarationOfMajority(
Asn1GeneralizedTime dateOfBirth)
{
this.declaration = new DerTaggedObject(false, 2, dateOfBirth);
}
public static DeclarationOfMajority GetInstance(
object obj)
{
if (obj == null || obj is DeclarationOfMajority)
{
return (DeclarationOfMajority) obj;
}
if (obj is Asn1TaggedObject)
{
return new DeclarationOfMajority((Asn1TaggedObject) obj);
}
throw new ArgumentException("unknown object in factory: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
private DeclarationOfMajority(
Asn1TaggedObject o)
{
if (o.TagNo > 2)
throw new ArgumentException("Bad tag number: " + o.TagNo);
this.declaration = o;
}
/**
* Produce an object suitable for an Asn1OutputStream.
* <p/>
* Returns:
* <p/>
* <pre>
* DeclarationOfMajoritySyntax ::= CHOICE
* {
* notYoungerThan [0] IMPLICIT INTEGER,
* fullAgeAtCountry [1] IMPLICIT SEQUENCE
* {
* fullAge BOOLEAN DEFAULT TRUE,
* country PrintableString (SIZE(2))
* }
* dateOfBirth [2] IMPLICIT GeneralizedTime
* }
* </pre>
*
* @return an Asn1Object
*/
public override Asn1Object ToAsn1Object()
{
return declaration;
}
public Choice Type
{
get { return (Choice) declaration.TagNo; }
}
/**
* @return notYoungerThan if that's what we are, -1 otherwise
*/
public virtual int NotYoungerThan
{
get
{
switch ((Choice) declaration.TagNo)
{
case Choice.NotYoungerThan:
return DerInteger.GetInstance(declaration, false).IntValueExact;
default:
return -1;
}
}
}
public virtual Asn1Sequence FullAgeAtCountry
{
get
{
switch ((Choice) declaration.TagNo)
{
case Choice.FullAgeAtCountry:
return Asn1Sequence.GetInstance(declaration, false);
default:
return null;
}
}
}
public virtual Asn1GeneralizedTime DateOfBirth
{
get
{
switch ((Choice) declaration.TagNo)
{
case Choice.DateOfBirth:
return Asn1GeneralizedTime.GetInstance(declaration, false);
default:
return null;
}
}
}
}
}
#pragma warning restore
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9a846b6feaeaf6047b72348ce0f2634a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,126 @@
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509
{
/**
* Monetary limit for transactions. The QcEuMonetaryLimit QC statement MUST be
* used in new certificates in place of the extension/attribute MonetaryLimit
* since January 1, 2004. For the sake of backward compatibility with
* certificates already in use, components SHOULD support MonetaryLimit (as well
* as QcEuLimitValue).
* <p/>
* Indicates a monetary limit within which the certificate holder is authorized
* to act. (This value DOES NOT express a limit on the liability of the
* certification authority).
* <p/>
* <pre>
* MonetaryLimitSyntax ::= SEQUENCE
* {
* currency PrintableString (SIZE(3)),
* amount INTEGER,
* exponent INTEGER
* }
* </pre>
* <p/>
* currency must be the ISO code.
* <p/>
* value = amount<6E>10*exponent
*/
public class MonetaryLimit
: Asn1Encodable
{
private readonly DerPrintableString currency;
private readonly DerInteger amount;
private readonly DerInteger exponent;
public static MonetaryLimit GetInstance(
object obj)
{
if (obj == null || obj is MonetaryLimit)
{
return (MonetaryLimit) obj;
}
if (obj is Asn1Sequence)
{
return new MonetaryLimit(Asn1Sequence.GetInstance(obj));
}
throw new ArgumentException("unknown object in factory: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
private MonetaryLimit(
Asn1Sequence seq)
{
if (seq.Count != 3)
throw new ArgumentException("Bad sequence size: " + seq.Count);
currency = DerPrintableString.GetInstance(seq[0]);
amount = DerInteger.GetInstance(seq[1]);
exponent = DerInteger.GetInstance(seq[2]);
}
/**
* Constructor from a given details.
* <p/>
* <p/>
* value = amount<6E>10^exponent
*
* @param currency The currency. Must be the ISO code.
* @param amount The amount
* @param exponent The exponent
*/
public MonetaryLimit(
string currency,
int amount,
int exponent)
{
this.currency = new DerPrintableString(currency, true);
this.amount = new DerInteger(amount);
this.exponent = new DerInteger(exponent);
}
public virtual string Currency
{
get { return currency.GetString(); }
}
public virtual BigInteger Amount
{
get { return amount.Value; }
}
public virtual BigInteger Exponent
{
get { return exponent.Value; }
}
/**
* Produce an object suitable for an Asn1OutputStream.
* <p/>
* Returns:
* <p/>
* <pre>
* MonetaryLimitSyntax ::= SEQUENCE
* {
* currency PrintableString (SIZE(3)),
* amount INTEGER,
* exponent INTEGER
* }
* </pre>
*
* @return an Asn1Object
*/
public override Asn1Object ToAsn1Object()
{
return new DerSequence(currency, amount, exponent);
}
}
}
#pragma warning restore
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5d752b8efd0fd5c42a7ca40ae38d0f3c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,206 @@
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509
{
/**
* Names of authorities which are responsible for the administration of title
* registers.
*
* <pre>
* NamingAuthority ::= SEQUENCE
* {
* namingAuthorityID OBJECT IDENTIFIER OPTIONAL,
* namingAuthorityUrl IA5String OPTIONAL,
* namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
* }
* </pre>
* @see Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.AdmissionSyntax
*
*/
public class NamingAuthority
: Asn1Encodable
{
/**
* Profession OIDs should always be defined under the OID branch of the
* responsible naming authority. At the time of this writing, the work group
* <20>Recht, Wirtschaft, Steuern<72> (<28>Law, Economy, Taxes<65>) is registered as the
* first naming authority under the OID id-isismtt-at-namingAuthorities.
*/
public static readonly DerObjectIdentifier IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern
= new DerObjectIdentifier(IsisMttObjectIdentifiers.IdIsisMttATNamingAuthorities + ".1");
private readonly DerObjectIdentifier namingAuthorityID;
private readonly string namingAuthorityUrl;
private readonly DirectoryString namingAuthorityText;
public static NamingAuthority GetInstance(object obj)
{
if (obj == null || obj is NamingAuthority)
return (NamingAuthority) obj;
if (obj is Asn1Sequence seq)
return new NamingAuthority(seq);
throw new ArgumentException("unknown object in factory: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
public static NamingAuthority GetInstance(Asn1TaggedObject obj, bool isExplicit)
{
return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit));
}
/**
* Constructor from Asn1Sequence.
* <p/>
* <p/>
* <pre>
* NamingAuthority ::= SEQUENCE
* {
* namingAuthorityID OBJECT IDENTIFIER OPTIONAL,
* namingAuthorityUrl IA5String OPTIONAL,
* namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
* }
* </pre>
*
* @param seq The ASN.1 sequence.
*/
private NamingAuthority(Asn1Sequence seq)
{
if (seq.Count > 3)
throw new ArgumentException("Bad sequence size: " + seq.Count);
var e = seq.GetEnumerator();
if (e.MoveNext())
{
Asn1Encodable o = e.Current;
if (o is DerObjectIdentifier oid)
{
namingAuthorityID = oid;
}
else if (o is DerIA5String ia5)
{
namingAuthorityUrl = ia5.GetString();
}
else if (o is IAsn1String)
{
namingAuthorityText = DirectoryString.GetInstance(o);
}
else
{
throw new ArgumentException("Bad object encountered: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(o));
}
}
if (e.MoveNext())
{
Asn1Encodable o = e.Current;
if (o is DerIA5String ia5)
{
namingAuthorityUrl = ia5.GetString();
}
else if (o is IAsn1String)
{
namingAuthorityText = DirectoryString.GetInstance(o);
}
else
{
throw new ArgumentException("Bad object encountered: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(o));
}
}
if (e.MoveNext())
{
Asn1Encodable o = e.Current;
if (o is IAsn1String)
{
namingAuthorityText = DirectoryString.GetInstance(o);
}
else
{
throw new ArgumentException("Bad object encountered: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(o));
}
}
}
/**
* @return Returns the namingAuthorityID.
*/
public virtual DerObjectIdentifier NamingAuthorityID
{
get { return namingAuthorityID; }
}
/**
* @return Returns the namingAuthorityText.
*/
public virtual DirectoryString NamingAuthorityText
{
get { return namingAuthorityText; }
}
/**
* @return Returns the namingAuthorityUrl.
*/
public virtual string NamingAuthorityUrl
{
get { return namingAuthorityUrl; }
}
/**
* Constructor from given details.
* <p/>
* All parameters can be combined.
*
* @param namingAuthorityID ObjectIdentifier for naming authority.
* @param namingAuthorityUrl URL for naming authority.
* @param namingAuthorityText Textual representation of naming authority.
*/
public NamingAuthority(
DerObjectIdentifier namingAuthorityID,
string namingAuthorityUrl,
DirectoryString namingAuthorityText)
{
this.namingAuthorityID = namingAuthorityID;
this.namingAuthorityUrl = namingAuthorityUrl;
this.namingAuthorityText = namingAuthorityText;
}
/**
* Produce an object suitable for an Asn1OutputStream.
* <p/>
* Returns:
* <p/>
* <pre>
* NamingAuthority ::= SEQUENCE
* {
* namingAuthorityID OBJECT IDENTIFIER OPTIONAL,
* namingAuthorityUrl IA5String OPTIONAL,
* namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
* }
* </pre>
*
* @return an Asn1Object
*/
public override Asn1Object ToAsn1Object()
{
Asn1EncodableVector v = new Asn1EncodableVector();
v.AddOptional(namingAuthorityID);
if (namingAuthorityUrl != null)
{
v.Add(new DerIA5String(namingAuthorityUrl, true));
}
v.AddOptional(namingAuthorityText);
return new DerSequence(v);
}
}
}
#pragma warning restore
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d78ac00b78d233649bd92c29fa09f50b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,230 @@
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509
{
/**
* Attribute to indicate that the certificate holder may sign in the name of a
* third person.
* <p>
* ISIS-MTT PROFILE: The corresponding ProcurationSyntax contains either the
* name of the person who is represented (subcomponent thirdPerson) or a
* reference to his/her base certificate (in the component signingFor,
* subcomponent certRef), furthermore the optional components country and
* typeSubstitution to indicate the country whose laws apply, and respectively
* the type of procuration (e.g. manager, procuration, custody).
* </p>
* <p>
* ISIS-MTT PROFILE: The GeneralName MUST be of type directoryName and MAY only
* contain: - RFC3039 attributes, except pseudonym (countryName, commonName,
* surname, givenName, serialNumber, organizationName, organizationalUnitName,
* stateOrProvincename, localityName, postalAddress) and - SubjectDirectoryName
* attributes (title, dateOfBirth, placeOfBirth, gender, countryOfCitizenship,
* countryOfResidence and NameAtBirth).
* </p>
* <pre>
* ProcurationSyntax ::= SEQUENCE {
* country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
* typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
* signingFor [3] EXPLICIT SigningFor
* }
*
* SigningFor ::= CHOICE
* {
* thirdPerson GeneralName,
* certRef IssuerSerial
* }
* </pre>
*
*/
public class ProcurationSyntax
: Asn1Encodable
{
private readonly string country;
private readonly DirectoryString typeOfSubstitution;
private readonly GeneralName thirdPerson;
private readonly IssuerSerial certRef;
public static ProcurationSyntax GetInstance(object obj)
{
if (obj == null || obj is ProcurationSyntax)
return (ProcurationSyntax) obj;
if (obj is Asn1Sequence seq)
return new ProcurationSyntax(seq);
throw new ArgumentException("unknown object in factory: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
/**
* Constructor from Asn1Sequence.
* <p/>
* The sequence is of type ProcurationSyntax:
* <p/>
* <pre>
* ProcurationSyntax ::= SEQUENCE {
* country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
* typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
* signingFor [3] EXPLICIT SigningFor
* }
* <p/>
* SigningFor ::= CHOICE
* {
* thirdPerson GeneralName,
* certRef IssuerSerial
* }
* </pre>
*
* @param seq The ASN.1 sequence.
*/
private ProcurationSyntax(Asn1Sequence seq)
{
if (seq.Count < 1 || seq.Count > 3)
throw new ArgumentException("Bad sequence size: " + seq.Count);
var e = seq.GetEnumerator();
while (e.MoveNext())
{
Asn1TaggedObject o = Asn1TaggedObject.GetInstance(e.Current);
switch (o.TagNo)
{
case 1:
country = DerPrintableString.GetInstance(o, true).GetString();
break;
case 2:
typeOfSubstitution = DirectoryString.GetInstance(o, true);
break;
case 3:
Asn1Object signingFor = o.GetObject();
if (signingFor is Asn1TaggedObject)
{
thirdPerson = GeneralName.GetInstance(signingFor);
}
else
{
certRef = IssuerSerial.GetInstance(signingFor);
}
break;
default:
throw new ArgumentException("Bad tag number: " + o.TagNo);
}
}
}
/**
* Constructor from a given details.
* <p/>
* <p/>
* Either <code>generalName</code> or <code>certRef</code> MUST be
* <code>null</code>.
*
* @param country The country code whose laws apply.
* @param typeOfSubstitution The type of procuration.
* @param certRef Reference to certificate of the person who is represented.
*/
public ProcurationSyntax(
string country,
DirectoryString typeOfSubstitution,
IssuerSerial certRef)
{
this.country = country;
this.typeOfSubstitution = typeOfSubstitution;
this.thirdPerson = null;
this.certRef = certRef;
}
/**
* Constructor from a given details.
* <p/>
* <p/>
* Either <code>generalName</code> or <code>certRef</code> MUST be
* <code>null</code>.
*
* @param country The country code whose laws apply.
* @param typeOfSubstitution The type of procuration.
* @param thirdPerson The GeneralName of the person who is represented.
*/
public ProcurationSyntax(
string country,
DirectoryString typeOfSubstitution,
GeneralName thirdPerson)
{
this.country = country;
this.typeOfSubstitution = typeOfSubstitution;
this.thirdPerson = thirdPerson;
this.certRef = null;
}
public virtual string Country
{
get { return country; }
}
public virtual DirectoryString TypeOfSubstitution
{
get { return typeOfSubstitution; }
}
public virtual GeneralName ThirdPerson
{
get { return thirdPerson; }
}
public virtual IssuerSerial CertRef
{
get { return certRef; }
}
/**
* Produce an object suitable for an Asn1OutputStream.
* <p/>
* Returns:
* <p/>
* <pre>
* ProcurationSyntax ::= SEQUENCE {
* country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
* typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
* signingFor [3] EXPLICIT SigningFor
* }
* <p/>
* SigningFor ::= CHOICE
* {
* thirdPerson GeneralName,
* certRef IssuerSerial
* }
* </pre>
*
* @return an Asn1Object
*/
public override Asn1Object ToAsn1Object()
{
Asn1EncodableVector v = new Asn1EncodableVector();
if (country != null)
{
v.Add(new DerTaggedObject(true, 1, new DerPrintableString(country, true)));
}
v.AddOptionalTagged(true, 2, typeOfSubstitution);
if (thirdPerson != null)
{
v.Add(new DerTaggedObject(true, 3, thirdPerson));
}
else
{
v.Add(new DerTaggedObject(true, 3, certRef));
}
return new DerSequence(v);
}
}
}
#pragma warning restore
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cc708de42965f2b4da574d61f562b6a8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,376 @@
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509
{
/**
* Professions, specializations, disciplines, fields of activity, etc.
*
* <pre>
* ProfessionInfo ::= SEQUENCE
* {
* namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
* professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
* professionOids SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
* registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
* addProfessionInfo OCTET STRING OPTIONAL
* }
* </pre>
*
* @see Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.AdmissionSyntax
*/
public class ProfessionInfo
: Asn1Encodable
{
/**
* Rechtsanw<6E>ltin
*/
public static readonly DerObjectIdentifier Rechtsanwltin = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".1");
/**
* Rechtsanwalt
*/
public static readonly DerObjectIdentifier Rechtsanwalt = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".2");
/**
* Rechtsbeistand
*/
public static readonly DerObjectIdentifier Rechtsbeistand = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".3");
/**
* Steuerberaterin
*/
public static readonly DerObjectIdentifier Steuerberaterin = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".4");
/**
* Steuerberater
*/
public static readonly DerObjectIdentifier Steuerberater = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".5");
/**
* Steuerbevollm<6C>chtigte
*/
public static readonly DerObjectIdentifier Steuerbevollmchtigte = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".6");
/**
* Steuerbevollm<6C>chtigter
*/
public static readonly DerObjectIdentifier Steuerbevollmchtigter = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".7");
/**
* Notarin
*/
public static readonly DerObjectIdentifier Notarin = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".8");
/**
* Notar
*/
public static readonly DerObjectIdentifier Notar = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".9");
/**
* Notarvertreterin
*/
public static readonly DerObjectIdentifier Notarvertreterin = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".10");
/**
* Notarvertreter
*/
public static readonly DerObjectIdentifier Notarvertreter = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".11");
/**
* Notariatsverwalterin
*/
public static readonly DerObjectIdentifier Notariatsverwalterin = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".12");
/**
* Notariatsverwalter
*/
public static readonly DerObjectIdentifier Notariatsverwalter = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".13");
/**
* Wirtschaftspr<70>ferin
*/
public static readonly DerObjectIdentifier Wirtschaftsprferin = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".14");
/**
* Wirtschaftspr<70>fer
*/
public static readonly DerObjectIdentifier Wirtschaftsprfer = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".15");
/**
* Vereidigte Buchpr<70>ferin
*/
public static readonly DerObjectIdentifier VereidigteBuchprferin = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".16");
/**
* Vereidigter Buchpr<70>fer
*/
public static readonly DerObjectIdentifier VereidigterBuchprfer = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".17");
/**
* Patentanw<6E>ltin
*/
public static readonly DerObjectIdentifier Patentanwltin = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".18");
/**
* Patentanwalt
*/
public static readonly DerObjectIdentifier Patentanwalt = new DerObjectIdentifier(
NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".19");
private readonly NamingAuthority namingAuthority;
private readonly Asn1Sequence professionItems;
private readonly Asn1Sequence professionOids;
private readonly string registrationNumber;
private readonly Asn1OctetString addProfessionInfo;
public static ProfessionInfo GetInstance(object obj)
{
if (obj == null || obj is ProfessionInfo)
return (ProfessionInfo) obj;
if (obj is Asn1Sequence seq)
return new ProfessionInfo(seq);
throw new ArgumentException("unknown object in factory: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
/**
* Constructor from Asn1Sequence.
* <p/>
* <p/>
* <pre>
* ProfessionInfo ::= SEQUENCE
* {
* namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
* professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
* professionOids SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
* registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
* addProfessionInfo OCTET STRING OPTIONAL
* }
* </pre>
*
* @param seq The ASN.1 sequence.
*/
private ProfessionInfo(Asn1Sequence seq)
{
if (seq.Count > 5)
throw new ArgumentException("Bad sequence size: " + seq.Count);
var e = seq.GetEnumerator();
e.MoveNext();
Asn1Encodable o = e.Current;
if (o is Asn1TaggedObject ato)
{
if (ato.TagNo != 0)
throw new ArgumentException("Bad tag number: " + ato.TagNo);
namingAuthority = NamingAuthority.GetInstance(ato, true);
e.MoveNext();
o = e.Current;
}
professionItems = Asn1Sequence.GetInstance(o);
if (e.MoveNext())
{
o = e.Current;
if (o is Asn1Sequence sequence)
{
professionOids = sequence;
}
else if (o is DerPrintableString printable)
{
registrationNumber = printable.GetString();
}
else if (o is Asn1OctetString octets)
{
addProfessionInfo = octets;
}
else
{
throw new ArgumentException("Bad object encountered: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(o));
}
}
if (e.MoveNext())
{
o = e.Current;
if (o is DerPrintableString printable)
{
registrationNumber = printable.GetString();
}
else if (o is Asn1OctetString octets)
{
addProfessionInfo = octets;
}
else
{
throw new ArgumentException("Bad object encountered: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(o));
}
}
if (e.MoveNext())
{
o = e.Current;
if (o is Asn1OctetString octets)
{
addProfessionInfo = octets;
}
else
{
throw new ArgumentException("Bad object encountered: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(o));
}
}
}
/**
* Constructor from given details.
* <p/>
* <code>professionItems</code> is mandatory, all other parameters are
* optional.
*
* @param namingAuthority The naming authority.
* @param professionItems Directory strings of the profession.
* @param professionOids DERObjectIdentfier objects for the
* profession.
* @param registrationNumber Registration number.
* @param addProfessionInfo Additional infos in encoded form.
*/
public ProfessionInfo(
NamingAuthority namingAuthority,
DirectoryString[] professionItems,
DerObjectIdentifier[] professionOids,
string registrationNumber,
Asn1OctetString addProfessionInfo)
{
this.namingAuthority = namingAuthority;
this.professionItems = new DerSequence(professionItems);
if (professionOids != null)
{
this.professionOids = new DerSequence(professionOids);
}
this.registrationNumber = registrationNumber;
this.addProfessionInfo = addProfessionInfo;
}
/**
* Produce an object suitable for an Asn1OutputStream.
* <p/>
* Returns:
* <p/>
* <pre>
* ProfessionInfo ::= SEQUENCE
* {
* namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
* professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
* professionOids SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
* registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
* addProfessionInfo OCTET STRING OPTIONAL
* }
* </pre>
*
* @return an Asn1Object
*/
public override Asn1Object ToAsn1Object()
{
Asn1EncodableVector v = new Asn1EncodableVector();
v.AddOptionalTagged(true, 0, namingAuthority);
v.Add(professionItems);
v.AddOptional(professionOids);
if (registrationNumber != null)
{
v.Add(new DerPrintableString(registrationNumber, true));
}
v.AddOptional(addProfessionInfo);
return new DerSequence(v);
}
/**
* @return Returns the addProfessionInfo.
*/
public virtual Asn1OctetString AddProfessionInfo
{
get { return addProfessionInfo; }
}
/**
* @return Returns the namingAuthority.
*/
public virtual NamingAuthority NamingAuthority
{
get { return namingAuthority; }
}
/**
* @return Returns the professionItems.
*/
public virtual DirectoryString[] GetProfessionItems()
{
DirectoryString[] result = new DirectoryString[professionItems.Count];
for (int i = 0; i < professionItems.Count; ++i)
{
result[i] = DirectoryString.GetInstance(professionItems[i]);
}
return result;
}
/**
* @return Returns the professionOids.
*/
public virtual DerObjectIdentifier[] GetProfessionOids()
{
if (professionOids == null)
{
return new DerObjectIdentifier[0];
}
DerObjectIdentifier[] result = new DerObjectIdentifier[professionOids.Count];
for (int i = 0; i < professionOids.Count; ++i)
{
result[i] = DerObjectIdentifier.GetInstance(professionOids[i]);
}
return result;
}
/**
* @return Returns the registrationNumber.
*/
public virtual string RegistrationNumber
{
get { return registrationNumber; }
}
}
}
#pragma warning restore
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9d6814f01a13d6b4b889110032b064af
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,83 @@
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509
{
/**
* Some other restriction regarding the usage of this certificate.
* <p/>
* <pre>
* RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
* </pre>
*/
public class Restriction
: Asn1Encodable
{
private readonly DirectoryString restriction;
public static Restriction GetInstance(object obj)
{
if (obj is Restriction)
return (Restriction) obj;
if (obj is IAsn1String)
return new Restriction(DirectoryString.GetInstance(obj));
throw new ArgumentException("Unknown object in GetInstance: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
/**
* Constructor from DirectoryString.
* <p/>
* The DirectoryString is of type RestrictionSyntax:
* <p/>
* <pre>
* RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
* </pre>
*
* @param restriction A IAsn1String.
*/
private Restriction(DirectoryString restriction)
{
this.restriction = restriction;
}
/**
* Constructor from a given details.
*
* @param restriction The description of the restriction.
*/
public Restriction(string restriction)
{
this.restriction = new DirectoryString(restriction);
}
public virtual DirectoryString RestrictionString
{
get { return restriction; }
}
/**
* Produce an object suitable for an Asn1OutputStream.
* <p/>
* Returns:
* <p/>
* <pre>
* RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
* <p/>
* </pre>
*
* @return an Asn1Object
*/
public override Asn1Object ToAsn1Object()
{
return restriction.ToAsn1Object();
}
}
}
#pragma warning restore
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 87a6e7888408104458b791ec7669c5e3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: