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,108 @@
#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.X509.Qualified
{
/**
* The BiometricData object.
* <pre>
* BiometricData ::= SEQUENCE {
* typeOfBiometricData TypeOfBiometricData,
* hashAlgorithm AlgorithmIdentifier,
* biometricDataHash OCTET STRING,
* sourceDataUri IA5String OPTIONAL }
* </pre>
*/
public class BiometricData
: Asn1Encodable
{
private readonly TypeOfBiometricData typeOfBiometricData;
private readonly AlgorithmIdentifier hashAlgorithm;
private readonly Asn1OctetString biometricDataHash;
private readonly DerIA5String sourceDataUri;
public static BiometricData GetInstance(
object obj)
{
if (obj == null || obj is BiometricData)
{
return (BiometricData)obj;
}
if (obj is Asn1Sequence)
{
return new BiometricData(Asn1Sequence.GetInstance(obj));
}
throw new ArgumentException("unknown object in GetInstance: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
private BiometricData(
Asn1Sequence seq)
{
typeOfBiometricData = TypeOfBiometricData.GetInstance(seq[0]);
hashAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]);
biometricDataHash = Asn1OctetString.GetInstance(seq[2]);
if (seq.Count > 3)
{
sourceDataUri = DerIA5String.GetInstance(seq[3]);
}
}
public BiometricData(
TypeOfBiometricData typeOfBiometricData,
AlgorithmIdentifier hashAlgorithm,
Asn1OctetString biometricDataHash,
DerIA5String sourceDataUri)
{
this.typeOfBiometricData = typeOfBiometricData;
this.hashAlgorithm = hashAlgorithm;
this.biometricDataHash = biometricDataHash;
this.sourceDataUri = sourceDataUri;
}
public BiometricData(
TypeOfBiometricData typeOfBiometricData,
AlgorithmIdentifier hashAlgorithm,
Asn1OctetString biometricDataHash)
{
this.typeOfBiometricData = typeOfBiometricData;
this.hashAlgorithm = hashAlgorithm;
this.biometricDataHash = biometricDataHash;
this.sourceDataUri = null;
}
public TypeOfBiometricData TypeOfBiometricData
{
get { return typeOfBiometricData; }
}
public AlgorithmIdentifier HashAlgorithm
{
get { return hashAlgorithm; }
}
public Asn1OctetString BiometricDataHash
{
get { return biometricDataHash; }
}
public DerIA5String SourceDataUri
{
get { return sourceDataUri; }
}
public override Asn1Object ToAsn1Object()
{
Asn1EncodableVector v = new Asn1EncodableVector(typeOfBiometricData, hashAlgorithm, biometricDataHash);
v.AddOptional(sourceDataUri);
return new DerSequence(v);
}
}
}
#pragma warning restore
#endif

View File

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

View File

@@ -0,0 +1,23 @@
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1;
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.Qualified
{
public abstract class EtsiQCObjectIdentifiers
{
//
// base id
//
public static readonly DerObjectIdentifier IdEtsiQcs = new DerObjectIdentifier("0.4.0.1862.1");
public static readonly DerObjectIdentifier IdEtsiQcsQcCompliance = new DerObjectIdentifier(IdEtsiQcs+".1");
public static readonly DerObjectIdentifier IdEtsiQcsLimitValue = new DerObjectIdentifier(IdEtsiQcs+".2");
public static readonly DerObjectIdentifier IdEtsiQcsRetentionPeriod = new DerObjectIdentifier(IdEtsiQcs+".3");
public static readonly DerObjectIdentifier IdEtsiQcsQcSscd = new DerObjectIdentifier(IdEtsiQcs+".4");
}
}
#pragma warning restore
#endif

View File

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

View File

@@ -0,0 +1,88 @@
#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.X509.Qualified
{
/**
* The Iso4217CurrencyCode object.
* <pre>
* Iso4217CurrencyCode ::= CHOICE {
* alphabetic PrintableString (SIZE 3), --Recommended
* numeric INTEGER (1..999) }
* -- Alphabetic or numeric currency code as defined in ISO 4217
* -- It is recommended that the Alphabetic form is used
* </pre>
*/
public class Iso4217CurrencyCode
: Asn1Encodable, IAsn1Choice
{
internal const int AlphabeticMaxSize = 3;
internal const int NumericMinSize = 1;
internal const int NumericMaxSize = 999;
internal Asn1Encodable obj;
// internal int numeric;
public static Iso4217CurrencyCode GetInstance(
object obj)
{
if (obj == null || obj is Iso4217CurrencyCode)
{
return (Iso4217CurrencyCode) obj;
}
if (obj is DerInteger)
{
DerInteger numericobj = DerInteger.GetInstance(obj);
int numeric = numericobj.IntValueExact;
return new Iso4217CurrencyCode(numeric);
}
if (obj is DerPrintableString)
{
DerPrintableString alphabetic = DerPrintableString.GetInstance(obj);
return new Iso4217CurrencyCode(alphabetic.GetString());
}
throw new ArgumentException("unknown object in GetInstance: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
public Iso4217CurrencyCode(
int numeric)
{
if (numeric > NumericMaxSize || numeric < NumericMinSize)
{
throw new ArgumentException("wrong size in numeric code : not in (" + NumericMinSize + ".." + NumericMaxSize + ")");
}
obj = new DerInteger(numeric);
}
public Iso4217CurrencyCode(
string alphabetic)
{
if (alphabetic.Length > AlphabeticMaxSize)
{
throw new ArgumentException("wrong size in alphabetic code : max size is " + AlphabeticMaxSize);
}
obj = new DerPrintableString(alphabetic);
}
public bool IsAlphabetic { get { return obj is DerPrintableString; } }
public string Alphabetic { get { return ((DerPrintableString) obj).GetString(); } }
public int Numeric { get { return ((DerInteger)obj).IntValueExact; } }
public override Asn1Object ToAsn1Object()
{
return obj.ToAsn1Object();
}
}
}
#pragma warning restore
#endif

View File

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

View File

@@ -0,0 +1,86 @@
#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.X509.Qualified
{
/**
* The MonetaryValue object.
* <pre>
* MonetaryValue ::= SEQUENCE {
* currency Iso4217CurrencyCode,
* amount INTEGER,
* exponent INTEGER }
* -- value = amount * 10^exponent
* </pre>
*/
public class MonetaryValue
: Asn1Encodable
{
internal Iso4217CurrencyCode currency;
internal DerInteger amount;
internal DerInteger exponent;
public static MonetaryValue GetInstance(
object obj)
{
if (obj == null || obj is MonetaryValue)
{
return (MonetaryValue) obj;
}
if (obj is Asn1Sequence)
{
return new MonetaryValue(Asn1Sequence.GetInstance(obj));
}
throw new ArgumentException("unknown object in GetInstance: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
private MonetaryValue(
Asn1Sequence seq)
{
if (seq.Count != 3)
throw new ArgumentException("Bad sequence size: " + seq.Count, "seq");
currency = Iso4217CurrencyCode.GetInstance(seq[0]);
amount = DerInteger.GetInstance(seq[1]);
exponent = DerInteger.GetInstance(seq[2]);
}
public MonetaryValue(
Iso4217CurrencyCode currency,
int amount,
int exponent)
{
this.currency = currency;
this.amount = new DerInteger(amount);
this.exponent = new DerInteger(exponent);
}
public Iso4217CurrencyCode Currency
{
get { return currency; }
}
public BigInteger Amount
{
get { return amount.Value; }
}
public BigInteger Exponent
{
get { return exponent.Value; }
}
public override Asn1Object ToAsn1Object()
{
return new DerSequence(currency, amount, exponent);
}
}
}
#pragma warning restore
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 05abe8d6890993045b707154d57aadf3
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.Utilities;
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.Qualified
{
/**
* The QCStatement object.
* <pre>
* QCStatement ::= SEQUENCE {
* statementId OBJECT IDENTIFIER,
* statementInfo ANY DEFINED BY statementId OPTIONAL}
* </pre>
*/
public class QCStatement
: Asn1Encodable
{
private readonly DerObjectIdentifier qcStatementId;
private readonly Asn1Encodable qcStatementInfo;
public static QCStatement GetInstance(
object obj)
{
if (obj == null || obj is QCStatement)
{
return (QCStatement) obj;
}
if (obj is Asn1Sequence)
{
return new QCStatement(Asn1Sequence.GetInstance(obj));
}
throw new ArgumentException("unknown object in GetInstance: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
private QCStatement(
Asn1Sequence seq)
{
qcStatementId = DerObjectIdentifier.GetInstance(seq[0]);
if (seq.Count > 1)
{
qcStatementInfo = seq[1];
}
}
public QCStatement(
DerObjectIdentifier qcStatementId)
{
this.qcStatementId = qcStatementId;
}
public QCStatement(
DerObjectIdentifier qcStatementId,
Asn1Encodable qcStatementInfo)
{
this.qcStatementId = qcStatementId;
this.qcStatementInfo = qcStatementInfo;
}
public DerObjectIdentifier StatementId
{
get { return qcStatementId; }
}
public Asn1Encodable StatementInfo
{
get { return qcStatementInfo; }
}
public override Asn1Object ToAsn1Object()
{
Asn1EncodableVector v = new Asn1EncodableVector(qcStatementId);
v.AddOptional(qcStatementInfo);
return new DerSequence(v);
}
}
}
#pragma warning restore
#endif

View File

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

View File

@@ -0,0 +1,25 @@
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1;
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.Qualified
{
public sealed class Rfc3739QCObjectIdentifiers
{
private Rfc3739QCObjectIdentifiers()
{
}
//
// base id
//
public static readonly DerObjectIdentifier IdQcs = new DerObjectIdentifier("1.3.6.1.5.5.7.11");
public static readonly DerObjectIdentifier IdQcsPkixQCSyntaxV1 = new DerObjectIdentifier(IdQcs+".1");
public static readonly DerObjectIdentifier IdQcsPkixQCSyntaxV2 = new DerObjectIdentifier(IdQcs+".2");
}
}
#pragma warning restore
#endif

View File

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

View File

@@ -0,0 +1,122 @@
#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.X509.Qualified
{
/**
* The SemanticsInformation object.
* <pre>
* SemanticsInformation ::= SEQUENCE {
* semanticsIdentifier OBJECT IDENTIFIER OPTIONAL,
* nameRegistrationAuthorities NameRegistrationAuthorities
* OPTIONAL }
* (WITH COMPONENTS {..., semanticsIdentifier PRESENT}|
* WITH COMPONENTS {..., nameRegistrationAuthorities PRESENT})
*
* NameRegistrationAuthorities ::= SEQUENCE SIZE (1..MAX) OF
* GeneralName
* </pre>
*/
public class SemanticsInformation
: Asn1Encodable
{
private readonly DerObjectIdentifier semanticsIdentifier;
private readonly GeneralName[] nameRegistrationAuthorities;
public static SemanticsInformation GetInstance(
object obj)
{
if (obj == null || obj is SemanticsInformation)
{
return (SemanticsInformation) obj;
}
if (obj is Asn1Sequence)
{
return new SemanticsInformation(Asn1Sequence.GetInstance(obj));
}
throw new ArgumentException("unknown object in GetInstance: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
public SemanticsInformation(Asn1Sequence seq)
{
if (seq.Count < 1)
throw new ArgumentException("no objects in SemanticsInformation");
var e = seq.GetEnumerator();
e.MoveNext();
var obj = e.Current;
if (obj is DerObjectIdentifier oid)
{
semanticsIdentifier = oid;
if (e.MoveNext())
{
obj = e.Current;
}
else
{
obj = null;
}
}
if (obj != null)
{
Asn1Sequence generalNameSeq = Asn1Sequence.GetInstance(obj);
nameRegistrationAuthorities = new GeneralName[generalNameSeq.Count];
for (int i= 0; i < generalNameSeq.Count; i++)
{
nameRegistrationAuthorities[i] = GeneralName.GetInstance(generalNameSeq[i]);
}
}
}
public SemanticsInformation(
DerObjectIdentifier semanticsIdentifier,
GeneralName[] generalNames)
{
this.semanticsIdentifier = semanticsIdentifier;
this.nameRegistrationAuthorities = generalNames;
}
public SemanticsInformation(
DerObjectIdentifier semanticsIdentifier)
{
this.semanticsIdentifier = semanticsIdentifier;
}
public SemanticsInformation(
GeneralName[] generalNames)
{
this.nameRegistrationAuthorities = generalNames;
}
public DerObjectIdentifier SemanticsIdentifier
{
get { return semanticsIdentifier; }
}
public GeneralName[] GetNameRegistrationAuthorities()
{
return nameRegistrationAuthorities;
}
public override Asn1Object ToAsn1Object()
{
Asn1EncodableVector v = new Asn1EncodableVector();
v.AddOptional(semanticsIdentifier);
if (null != nameRegistrationAuthorities)
{
v.Add(new DerSequence(nameRegistrationAuthorities));
}
return new DerSequence(v);
}
}
}
#pragma warning restore
#endif

View File

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

View File

@@ -0,0 +1,95 @@
#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.X509.Qualified
{
/**
* The TypeOfBiometricData object.
* <pre>
* TypeOfBiometricData ::= CHOICE {
* predefinedBiometricType PredefinedBiometricType,
* biometricDataOid OBJECT IDENTIFIER }
*
* PredefinedBiometricType ::= INTEGER {
* picture(0),handwritten-signature(1)}
* (picture|handwritten-signature)
* </pre>
*/
public class TypeOfBiometricData
: Asn1Encodable, IAsn1Choice
{
public const int Picture = 0;
public const int HandwrittenSignature = 1;
internal Asn1Encodable obj;
public static TypeOfBiometricData GetInstance(
object obj)
{
if (obj == null || obj is TypeOfBiometricData)
{
return (TypeOfBiometricData) obj;
}
if (obj is DerInteger)
{
DerInteger predefinedBiometricTypeObj = DerInteger.GetInstance(obj);
int predefinedBiometricType = predefinedBiometricTypeObj.IntValueExact;
return new TypeOfBiometricData(predefinedBiometricType);
}
if (obj is DerObjectIdentifier)
{
DerObjectIdentifier BiometricDataOid = DerObjectIdentifier.GetInstance(obj);
return new TypeOfBiometricData(BiometricDataOid);
}
throw new ArgumentException("unknown object in GetInstance: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
}
public TypeOfBiometricData(
int predefinedBiometricType)
{
if (predefinedBiometricType == Picture || predefinedBiometricType == HandwrittenSignature)
{
obj = new DerInteger(predefinedBiometricType);
}
else
{
throw new ArgumentException("unknow PredefinedBiometricType : " + predefinedBiometricType);
}
}
public TypeOfBiometricData(
DerObjectIdentifier biometricDataOid)
{
obj = biometricDataOid;
}
public bool IsPredefined
{
get { return obj is DerInteger; }
}
public int PredefinedBiometricType
{
get { return ((DerInteger)obj).IntValueExact; }
}
public DerObjectIdentifier BiometricDataOid
{
get { return (DerObjectIdentifier) obj; }
}
public override Asn1Object ToAsn1Object()
{
return obj.ToAsn1Object();
}
}
}
#pragma warning restore
#endif

View File

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