- Initial commit
This commit is contained in:
57
Runtime/3rdParty/BouncyCastle/asn1/cmp/CAKeyUpdAnnContent.cs
vendored
Normal file
57
Runtime/3rdParty/BouncyCastle/asn1/cmp/CAKeyUpdAnnContent.cs
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
#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.Cmp
|
||||
{
|
||||
public class CAKeyUpdAnnContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static CAKeyUpdAnnContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is CAKeyUpdAnnContent content)
|
||||
return content;
|
||||
|
||||
if (obj is Asn1Sequence seq)
|
||||
return new CAKeyUpdAnnContent(seq);
|
||||
|
||||
throw new ArgumentException("Invalid object: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), nameof(obj));
|
||||
}
|
||||
|
||||
private readonly CmpCertificate m_oldWithNew;
|
||||
private readonly CmpCertificate m_newWithOld;
|
||||
private readonly CmpCertificate m_newWithNew;
|
||||
|
||||
private CAKeyUpdAnnContent(Asn1Sequence seq)
|
||||
{
|
||||
m_oldWithNew = CmpCertificate.GetInstance(seq[0]);
|
||||
m_newWithOld = CmpCertificate.GetInstance(seq[1]);
|
||||
m_newWithNew = CmpCertificate.GetInstance(seq[2]);
|
||||
}
|
||||
|
||||
public virtual CmpCertificate OldWithNew => m_oldWithNew;
|
||||
|
||||
public virtual CmpCertificate NewWithOld => m_newWithOld;
|
||||
|
||||
public virtual CmpCertificate NewWithNew => m_newWithNew;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* CAKeyUpdAnnContent ::= SEQUENCE {
|
||||
* oldWithNew CmpCertificate, -- old pub signed with new priv
|
||||
* newWithOld CmpCertificate, -- new pub signed with old priv
|
||||
* newWithNew CmpCertificate -- new pub signed with new priv
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return new DerSequence(m_oldWithNew, m_newWithOld, m_newWithNew);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CAKeyUpdAnnContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CAKeyUpdAnnContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57d4f662ef9f4e94c8f85ae891f3b22c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/CAKeyUpdAnnContent.cs
|
||||
uploadId: 783279
|
||||
76
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertAnnContent.cs
vendored
Normal file
76
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertAnnContent.cs
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* CertAnnContent ::= CMPCertificate
|
||||
*/
|
||||
public class CertAnnContent
|
||||
: CmpCertificate
|
||||
{
|
||||
public static new CertAnnContent GetInstance(object obj)
|
||||
{
|
||||
// TODO[cmp]
|
||||
if (obj == null)
|
||||
return null;
|
||||
|
||||
if (obj is CertAnnContent content)
|
||||
return content;
|
||||
|
||||
if (obj is CmpCertificate cmpCertificate)
|
||||
return GetInstance(cmpCertificate.GetEncoded());
|
||||
|
||||
if (obj is byte[] bs)
|
||||
{
|
||||
try
|
||||
{
|
||||
obj = Asn1Object.FromByteArray(bs);
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
throw new ArgumentException("Invalid encoding in CertAnnContent");
|
||||
}
|
||||
}
|
||||
|
||||
if (obj is Asn1Sequence)
|
||||
return new CertAnnContent(X509CertificateStructure.GetInstance(obj));
|
||||
|
||||
// TODO[cmp]
|
||||
if (obj is Asn1TaggedObject taggedObject)
|
||||
return new CertAnnContent(taggedObject.TagNo, taggedObject.GetObject());
|
||||
|
||||
throw new ArgumentException("Invalid object: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), nameof(obj));
|
||||
}
|
||||
|
||||
public static new CertAnnContent GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
|
||||
{
|
||||
// TODO[cmp]
|
||||
if (taggedObject == null)
|
||||
return null;
|
||||
|
||||
if (!declaredExplicit)
|
||||
throw new ArgumentException("tag must be explicit");
|
||||
|
||||
// TODO[cmp]
|
||||
return GetInstance(taggedObject.GetObject());
|
||||
}
|
||||
|
||||
public CertAnnContent(int type, Asn1Object otherCert)
|
||||
: base(type, otherCert)
|
||||
{
|
||||
}
|
||||
|
||||
public CertAnnContent(X509CertificateStructure x509v3PKCert)
|
||||
: base(x509v3PKCert)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertAnnContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertAnnContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5528beb2cf14d3f4b8fe42441aa9eed6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/CertAnnContent.cs
|
||||
uploadId: 783279
|
||||
48
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertConfirmContent.cs
vendored
Normal file
48
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertConfirmContent.cs
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
#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.Cmp
|
||||
{
|
||||
public class CertConfirmContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static CertConfirmContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is CertConfirmContent content)
|
||||
return content;
|
||||
|
||||
if (obj is Asn1Sequence seq)
|
||||
return new CertConfirmContent(seq);
|
||||
|
||||
throw new ArgumentException("Invalid object: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), nameof(obj));
|
||||
}
|
||||
|
||||
private readonly Asn1Sequence m_content;
|
||||
|
||||
private CertConfirmContent(Asn1Sequence seq)
|
||||
{
|
||||
m_content = seq;
|
||||
}
|
||||
|
||||
public virtual CertStatus[] ToCertStatusArray()
|
||||
{
|
||||
return m_content.MapElements(CertStatus.GetInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* CertConfirmContent ::= SEQUENCE OF CertStatus
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return m_content;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertConfirmContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertConfirmContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 806651b6f8cc9794e89ef40e3281c494
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/CertConfirmContent.cs
|
||||
uploadId: 783279
|
||||
90
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertOrEncCert.cs
vendored
Normal file
90
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertOrEncCert.cs
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class CertOrEncCert
|
||||
: Asn1Encodable, IAsn1Choice
|
||||
{
|
||||
public static CertOrEncCert GetInstance(object obj)
|
||||
{
|
||||
if (obj is CertOrEncCert certOrEncCert)
|
||||
return certOrEncCert;
|
||||
|
||||
if (obj is Asn1TaggedObject taggedObject)
|
||||
return new CertOrEncCert(taggedObject);
|
||||
|
||||
throw new ArgumentException("Invalid object: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), nameof(obj));
|
||||
}
|
||||
|
||||
private readonly CmpCertificate m_certificate;
|
||||
private readonly EncryptedKey m_encryptedCert;
|
||||
|
||||
private CertOrEncCert(Asn1TaggedObject taggedObject)
|
||||
{
|
||||
if (taggedObject.TagNo == 0)
|
||||
{
|
||||
m_certificate = CmpCertificate.GetInstance(taggedObject.GetObject());
|
||||
}
|
||||
else if (taggedObject.TagNo == 1)
|
||||
{
|
||||
m_encryptedCert = EncryptedKey.GetInstance(taggedObject.GetObject());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("unknown tag: " + taggedObject.TagNo, nameof(taggedObject));
|
||||
}
|
||||
}
|
||||
|
||||
public CertOrEncCert(CmpCertificate certificate)
|
||||
{
|
||||
if (certificate == null)
|
||||
throw new ArgumentNullException(nameof(certificate));
|
||||
|
||||
m_certificate = certificate;
|
||||
}
|
||||
|
||||
public CertOrEncCert(EncryptedValue encryptedValue)
|
||||
{
|
||||
if (encryptedValue == null)
|
||||
throw new ArgumentNullException(nameof(encryptedValue));
|
||||
|
||||
m_encryptedCert = new EncryptedKey(encryptedValue);
|
||||
}
|
||||
|
||||
public CertOrEncCert(EncryptedKey encryptedKey)
|
||||
{
|
||||
if (encryptedKey == null)
|
||||
throw new ArgumentNullException(nameof(encryptedKey));
|
||||
|
||||
m_encryptedCert = encryptedKey;
|
||||
}
|
||||
|
||||
public virtual CmpCertificate Certificate => m_certificate;
|
||||
|
||||
public virtual EncryptedKey EncryptedCert => m_encryptedCert;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* CertOrEncCert ::= CHOICE {
|
||||
* certificate [0] CMPCertificate,
|
||||
* encryptedCert [1] EncryptedKey
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
if (m_certificate != null)
|
||||
return new DerTaggedObject(true, 0, m_certificate);
|
||||
|
||||
return new DerTaggedObject(true, 1, m_encryptedCert);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertOrEncCert.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertOrEncCert.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a143c3b2ffb42f94c841a934c47faa04
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/CertOrEncCert.cs
|
||||
uploadId: 783279
|
||||
81
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertRepMessage.cs
vendored
Normal file
81
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertRepMessage.cs
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
#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.Cmp
|
||||
{
|
||||
public class CertRepMessage
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static CertRepMessage GetInstance(object obj)
|
||||
{
|
||||
if (obj is CertRepMessage certRepMessage)
|
||||
return certRepMessage;
|
||||
|
||||
if (obj != null)
|
||||
return new CertRepMessage(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly Asn1Sequence m_caPubs;
|
||||
private readonly Asn1Sequence m_response;
|
||||
|
||||
private CertRepMessage(Asn1Sequence seq)
|
||||
{
|
||||
int index = 0;
|
||||
|
||||
if (seq.Count > 1)
|
||||
{
|
||||
m_caPubs = Asn1Sequence.GetInstance((Asn1TaggedObject)seq[index++], true);
|
||||
}
|
||||
|
||||
m_response = Asn1Sequence.GetInstance(seq[index]);
|
||||
}
|
||||
|
||||
public CertRepMessage(CmpCertificate[] caPubs, CertResponse[] response)
|
||||
{
|
||||
if (response == null)
|
||||
throw new ArgumentNullException(nameof(response));
|
||||
|
||||
if (caPubs != null)
|
||||
{
|
||||
m_caPubs = new DerSequence(caPubs);
|
||||
}
|
||||
|
||||
m_response = new DerSequence(response);
|
||||
}
|
||||
|
||||
public virtual CmpCertificate[] GetCAPubs()
|
||||
{
|
||||
return m_caPubs == null ? null : m_caPubs.MapElements(CmpCertificate.GetInstance);
|
||||
}
|
||||
|
||||
public virtual CertResponse[] GetResponse()
|
||||
{
|
||||
return m_response.MapElements(CertResponse.GetInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* CertRepMessage ::= SEQUENCE {
|
||||
* caPubs [1] SEQUENCE SIZE (1..MAX) OF CMPCertificate
|
||||
* OPTIONAL,
|
||||
* response SEQUENCE OF CertResponse
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(2);
|
||||
v.AddOptionalTagged(true, 1, m_caPubs);
|
||||
v.Add(m_response);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertRepMessage.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertRepMessage.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1d20678a246c7e94a812b42475ff5992
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/CertRepMessage.cs
|
||||
uploadId: 783279
|
||||
71
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertReqTemplateContent.cs
vendored
Normal file
71
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertReqTemplateContent.cs
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* GenMsg: {id-it 19}, < absent >
|
||||
* GenRep: {id-it 19}, CertReqTemplateContent | < absent >
|
||||
* <p>
|
||||
* CertReqTemplateValue ::= CertReqTemplateContent
|
||||
* </p><p>
|
||||
* CertReqTemplateContent ::= SEQUENCE {
|
||||
* certTemplate CertTemplate,
|
||||
* keySpec Controls OPTIONAL }
|
||||
* </p><p>
|
||||
* Controls ::= SEQUENCE SIZE (1..MAX) OF AttributeTypeAndValue
|
||||
* </p>
|
||||
*/
|
||||
public class CertReqTemplateContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static CertReqTemplateContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is CertReqTemplateContent certReqTemplateContent)
|
||||
return certReqTemplateContent;
|
||||
|
||||
if (obj != null)
|
||||
return new CertReqTemplateContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly CertTemplate m_certTemplate;
|
||||
private readonly Asn1Sequence m_keySpec;
|
||||
|
||||
private CertReqTemplateContent(Asn1Sequence seq)
|
||||
{
|
||||
if (seq.Count != 1 && seq.Count != 2)
|
||||
throw new ArgumentException("expected sequence size of 1 or 2");
|
||||
|
||||
m_certTemplate = CertTemplate.GetInstance(seq[0]);
|
||||
|
||||
if (seq.Count > 1)
|
||||
{
|
||||
m_keySpec = Asn1Sequence.GetInstance(seq[1]);
|
||||
}
|
||||
}
|
||||
|
||||
public CertReqTemplateContent(CertTemplate certTemplate, Asn1Sequence keySpec)
|
||||
{
|
||||
m_certTemplate = certTemplate;
|
||||
m_keySpec = keySpec;
|
||||
}
|
||||
|
||||
public virtual CertTemplate CertTemplate => m_certTemplate;
|
||||
|
||||
public virtual Asn1Sequence KeySpec => m_keySpec;
|
||||
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(m_certTemplate);
|
||||
v.AddOptional(m_keySpec);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertReqTemplateContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertReqTemplateContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07b23d09e986bb142a18b0598079970f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/CertReqTemplateContent.cs
|
||||
uploadId: 783279
|
||||
104
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertResponse.cs
vendored
Normal file
104
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertResponse.cs
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class CertResponse
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static CertResponse GetInstance(object obj)
|
||||
{
|
||||
if (obj is CertResponse certResponse)
|
||||
return certResponse;
|
||||
|
||||
if (obj != null)
|
||||
return new CertResponse(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly DerInteger m_certReqId;
|
||||
private readonly PkiStatusInfo m_status;
|
||||
private readonly CertifiedKeyPair m_certifiedKeyPair;
|
||||
private readonly Asn1OctetString m_rspInfo;
|
||||
|
||||
private CertResponse(Asn1Sequence seq)
|
||||
{
|
||||
m_certReqId = DerInteger.GetInstance(seq[0]);
|
||||
m_status = PkiStatusInfo.GetInstance(seq[1]);
|
||||
|
||||
if (seq.Count >= 3)
|
||||
{
|
||||
if (seq.Count == 3)
|
||||
{
|
||||
Asn1Encodable o = seq[2];
|
||||
if (o is Asn1OctetString)
|
||||
{
|
||||
m_rspInfo = Asn1OctetString.GetInstance(o);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_certifiedKeyPair = CertifiedKeyPair.GetInstance(o);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_certifiedKeyPair = CertifiedKeyPair.GetInstance(seq[2]);
|
||||
m_rspInfo = Asn1OctetString.GetInstance(seq[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CertResponse(DerInteger certReqId, PkiStatusInfo status)
|
||||
: this(certReqId, status, null, null)
|
||||
{
|
||||
}
|
||||
|
||||
public CertResponse(DerInteger certReqId, PkiStatusInfo status, CertifiedKeyPair certifiedKeyPair,
|
||||
Asn1OctetString rspInfo)
|
||||
{
|
||||
if (certReqId == null)
|
||||
throw new ArgumentNullException(nameof(certReqId));
|
||||
|
||||
if (status == null)
|
||||
throw new ArgumentNullException(nameof(status));
|
||||
|
||||
m_certReqId = certReqId;
|
||||
m_status = status;
|
||||
m_certifiedKeyPair = certifiedKeyPair;
|
||||
m_rspInfo = rspInfo;
|
||||
}
|
||||
|
||||
public virtual DerInteger CertReqID => m_certReqId;
|
||||
|
||||
public virtual PkiStatusInfo Status => m_status;
|
||||
|
||||
public virtual CertifiedKeyPair CertifiedKeyPair => m_certifiedKeyPair;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* CertResponse ::= SEQUENCE {
|
||||
* certReqId INTEGER,
|
||||
* -- to match this response with corresponding request (a value
|
||||
* -- of -1 is to be used if certReqId is not specified in the
|
||||
* -- corresponding request)
|
||||
* status PKIStatusInfo,
|
||||
* certifiedKeyPair CertifiedKeyPair OPTIONAL,
|
||||
* rspInfo OCTET STRING OPTIONAL
|
||||
* -- analogous to the id-regInfo-utf8Pairs string defined
|
||||
* -- for regInfo in CertReqMsg [CRMF]
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(m_certReqId, m_status);
|
||||
v.AddOptional(m_certifiedKeyPair, m_rspInfo);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertResponse.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertResponse.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 01689c05e132a6548ac537485333564a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/CertResponse.cs
|
||||
uploadId: 783279
|
||||
107
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertStatus.cs
vendored
Normal file
107
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertStatus.cs
vendored
Normal file
@ -0,0 +1,107 @@
|
||||
#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.Math;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class CertStatus
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static CertStatus GetInstance(object obj)
|
||||
{
|
||||
if (obj is CertStatus certStatus)
|
||||
return certStatus;
|
||||
|
||||
if (obj != null)
|
||||
return new CertStatus(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly Asn1OctetString m_certHash;
|
||||
private readonly DerInteger m_certReqID;
|
||||
private readonly PkiStatusInfo m_statusInfo;
|
||||
private readonly AlgorithmIdentifier m_hashAlg;
|
||||
|
||||
private CertStatus(Asn1Sequence seq)
|
||||
{
|
||||
m_certHash = Asn1OctetString.GetInstance(seq[0]);
|
||||
m_certReqID = DerInteger.GetInstance(seq[1]);
|
||||
|
||||
if (seq.Count > 2)
|
||||
{
|
||||
for (int t = 2; t < seq.Count; t++)
|
||||
{
|
||||
Asn1Object p = seq[t].ToAsn1Object();
|
||||
if (p is Asn1Sequence s)
|
||||
{
|
||||
m_statusInfo = PkiStatusInfo.GetInstance(s);
|
||||
}
|
||||
if (p is Asn1TaggedObject dto)
|
||||
{
|
||||
if (dto.TagNo != 0)
|
||||
throw new ArgumentException("unknown tag " + dto.TagNo);
|
||||
|
||||
m_hashAlg = AlgorithmIdentifier.GetInstance(dto, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CertStatus(byte[] certHash, BigInteger certReqID)
|
||||
{
|
||||
m_certHash = new DerOctetString(certHash);
|
||||
m_certReqID = new DerInteger(certReqID);
|
||||
}
|
||||
|
||||
public CertStatus(byte[] certHash, BigInteger certReqID, PkiStatusInfo statusInfo)
|
||||
{
|
||||
m_certHash = new DerOctetString(certHash);
|
||||
m_certReqID = new DerInteger(certReqID);
|
||||
m_statusInfo = statusInfo;
|
||||
}
|
||||
|
||||
public CertStatus(byte[] certHash, BigInteger certReqID, PkiStatusInfo statusInfo, AlgorithmIdentifier hashAlg)
|
||||
{
|
||||
m_certHash = new DerOctetString(certHash);
|
||||
m_certReqID = new DerInteger(certReqID);
|
||||
m_statusInfo = statusInfo;
|
||||
m_hashAlg = hashAlg;
|
||||
}
|
||||
|
||||
public virtual Asn1OctetString CertHash => m_certHash;
|
||||
|
||||
public virtual DerInteger CertReqID => m_certReqID;
|
||||
|
||||
public virtual PkiStatusInfo StatusInfo => m_statusInfo;
|
||||
|
||||
public virtual AlgorithmIdentifier HashAlg => m_hashAlg;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
*
|
||||
* CertStatus ::= SEQUENCE {
|
||||
* certHash OCTET STRING,
|
||||
* certReqId INTEGER,
|
||||
* statusInfo PKIStatusInfo OPTIONAL,
|
||||
* hashAlg [0] AlgorithmIdentifier{DIGEST-ALGORITHM, {...}} OPTIONAL
|
||||
* }
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(m_certHash, m_certReqID);
|
||||
v.AddOptional(m_statusInfo);
|
||||
v.AddOptionalTagged(true, 0, m_hashAlg);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertStatus.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertStatus.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0efe7846acc4774418d88c81a9f46a55
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/CertStatus.cs
|
||||
uploadId: 783279
|
||||
102
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertifiedKeyPair.cs
vendored
Normal file
102
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertifiedKeyPair.cs
vendored
Normal file
@ -0,0 +1,102 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class CertifiedKeyPair
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static CertifiedKeyPair GetInstance(object obj)
|
||||
{
|
||||
if (obj is CertifiedKeyPair certifiedKeyPair)
|
||||
return certifiedKeyPair;
|
||||
|
||||
if (obj != null)
|
||||
return new CertifiedKeyPair(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly CertOrEncCert m_certOrEncCert;
|
||||
private readonly EncryptedKey m_privateKey;
|
||||
private readonly PkiPublicationInfo m_publicationInfo;
|
||||
|
||||
private CertifiedKeyPair(Asn1Sequence seq)
|
||||
{
|
||||
m_certOrEncCert = CertOrEncCert.GetInstance(seq[0]);
|
||||
|
||||
if (seq.Count >= 2)
|
||||
{
|
||||
if (seq.Count == 2)
|
||||
{
|
||||
Asn1TaggedObject tagged = Asn1TaggedObject.GetInstance(seq[1]);
|
||||
if (tagged.TagNo == 0)
|
||||
{
|
||||
m_privateKey = EncryptedKey.GetInstance(tagged.GetObject());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_publicationInfo = PkiPublicationInfo.GetInstance(tagged.GetObject());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_privateKey = EncryptedKey.GetInstance(Asn1TaggedObject.GetInstance(seq[1]).GetObject());
|
||||
m_publicationInfo = PkiPublicationInfo.GetInstance(Asn1TaggedObject.GetInstance(seq[2]).GetObject());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CertifiedKeyPair(CertOrEncCert certOrEncCert)
|
||||
: this(certOrEncCert, (EncryptedKey)null, null)
|
||||
{
|
||||
}
|
||||
|
||||
public CertifiedKeyPair(CertOrEncCert certOrEncCert, EncryptedValue privateKey,
|
||||
PkiPublicationInfo publicationInfo)
|
||||
: this(certOrEncCert, privateKey == null ? null : new EncryptedKey(privateKey), publicationInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public CertifiedKeyPair(CertOrEncCert certOrEncCert, EncryptedKey privateKey,
|
||||
PkiPublicationInfo publicationInfo)
|
||||
{
|
||||
if (certOrEncCert == null)
|
||||
throw new ArgumentNullException(nameof(certOrEncCert));
|
||||
|
||||
m_certOrEncCert = certOrEncCert;
|
||||
m_privateKey = privateKey;
|
||||
m_publicationInfo = publicationInfo;
|
||||
}
|
||||
|
||||
public virtual CertOrEncCert CertOrEncCert => m_certOrEncCert;
|
||||
|
||||
public virtual EncryptedKey PrivateKey => m_privateKey;
|
||||
|
||||
public virtual PkiPublicationInfo PublicationInfo => m_publicationInfo;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* CertifiedKeyPair ::= SEQUENCE {
|
||||
* certOrEncCert CertOrEncCert,
|
||||
* privateKey [0] EncryptedValue OPTIONAL,
|
||||
* -- see [CRMF] for comment on encoding
|
||||
* publicationInfo [1] PKIPublicationInfo OPTIONAL
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(m_certOrEncCert);
|
||||
v.AddOptionalTagged(true, 0, m_privateKey);
|
||||
v.AddOptionalTagged(true, 1, m_publicationInfo);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertifiedKeyPair.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CertifiedKeyPair.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 679079ba357f9f54780c4f094af9d15a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/CertifiedKeyPair.cs
|
||||
uploadId: 783279
|
||||
166
Runtime/3rdParty/BouncyCastle/asn1/cmp/Challenge.cs
vendored
Normal file
166
Runtime/3rdParty/BouncyCastle/asn1/cmp/Challenge.cs
vendored
Normal file
@ -0,0 +1,166 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* <pre>
|
||||
* Challenge ::= SEQUENCE {
|
||||
* owf AlgorithmIdentifier OPTIONAL,
|
||||
*
|
||||
* -- MUST be present in the first Challenge; MAY be omitted in
|
||||
* -- any subsequent Challenge in POPODecKeyChallContent (if
|
||||
* -- omitted, then the owf used in the immediately preceding
|
||||
* -- Challenge is to be used).
|
||||
*
|
||||
* witness OCTET STRING,
|
||||
* -- the result of applying the one-way function (owf) to a
|
||||
* -- randomly-generated INTEGER, A. [Note that a different
|
||||
* -- INTEGER MUST be used for each Challenge.]
|
||||
* challenge OCTET STRING
|
||||
* -- the encryption (under the public key for which the cert.
|
||||
* -- request is being made) of Rand, where Rand is specified as
|
||||
* -- Rand ::= SEQUENCE {
|
||||
* -- int INTEGER,
|
||||
* -- - the randomly-generated INTEGER A (above)
|
||||
* -- sender GeneralName
|
||||
* -- - the sender's name (as included in PKIHeader)
|
||||
* -- }
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public class Challenge
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static Challenge GetInstance(object obj)
|
||||
{
|
||||
if (obj is Challenge challenge)
|
||||
return challenge;
|
||||
|
||||
if (obj != null)
|
||||
return new Challenge(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly AlgorithmIdentifier m_owf;
|
||||
private readonly Asn1OctetString m_witness;
|
||||
private readonly Asn1OctetString m_challenge;
|
||||
|
||||
private Challenge(Asn1Sequence seq)
|
||||
{
|
||||
int index = 0;
|
||||
|
||||
if (seq.Count == 3)
|
||||
{
|
||||
m_owf = AlgorithmIdentifier.GetInstance(seq[index++]);
|
||||
}
|
||||
|
||||
m_witness = Asn1OctetString.GetInstance(seq[index++]);
|
||||
m_challenge = Asn1OctetString.GetInstance(seq[index]);
|
||||
}
|
||||
|
||||
public Challenge(byte[] witness, byte[] challenge)
|
||||
: this(null, witness, challenge)
|
||||
{
|
||||
}
|
||||
|
||||
public Challenge(AlgorithmIdentifier owf, byte[] witness, byte[] challenge)
|
||||
{
|
||||
m_owf = owf;
|
||||
m_witness = new DerOctetString(witness);
|
||||
m_challenge = new DerOctetString(challenge);
|
||||
}
|
||||
|
||||
public virtual AlgorithmIdentifier Owf => m_owf;
|
||||
|
||||
public virtual Asn1OctetString Witness => m_witness;
|
||||
|
||||
public virtual Asn1OctetString ChallengeValue => m_challenge;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Challenge ::= SEQUENCE {
|
||||
* owf AlgorithmIdentifier OPTIONAL,
|
||||
*
|
||||
* -- MUST be present in the first Challenge; MAY be omitted in
|
||||
* -- any subsequent Challenge in POPODecKeyChallContent (if
|
||||
* -- omitted, then the owf used in the immediately preceding
|
||||
* -- Challenge is to be used).
|
||||
*
|
||||
* witness OCTET STRING,
|
||||
* -- the result of applying the one-way function (owf) to a
|
||||
* -- randomly-generated INTEGER, A. [Note that a different
|
||||
* -- INTEGER MUST be used for each Challenge.]
|
||||
* challenge OCTET STRING
|
||||
* -- the encryption (under the public key for which the cert.
|
||||
* -- request is being made) of Rand, where Rand is specified as
|
||||
* -- Rand ::= SEQUENCE {
|
||||
* -- int INTEGER,
|
||||
* -- - the randomly-generated INTEGER A (above)
|
||||
* -- sender GeneralName
|
||||
* -- - the sender's name (as included in PKIHeader)
|
||||
* -- }
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector();
|
||||
v.AddOptional(m_owf);
|
||||
v.Add(m_witness, m_challenge);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rand is the inner type
|
||||
*/
|
||||
public class Rand
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static Rand GetInstance(object obj)
|
||||
{
|
||||
if (obj is Rand rand)
|
||||
return rand;
|
||||
|
||||
if (obj != null)
|
||||
return new Rand(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly DerInteger m_intVal;
|
||||
private readonly GeneralName m_sender;
|
||||
|
||||
public Rand(DerInteger intVal, GeneralName sender)
|
||||
{
|
||||
m_intVal = intVal;
|
||||
m_sender = sender;
|
||||
}
|
||||
|
||||
public Rand(Asn1Sequence seq)
|
||||
{
|
||||
if (seq.Count != 2)
|
||||
throw new ArgumentException("expected sequence size of 2");
|
||||
|
||||
m_intVal = DerInteger.GetInstance(seq[0]);
|
||||
m_sender = GeneralName.GetInstance(seq[1]);
|
||||
}
|
||||
|
||||
public virtual DerInteger IntVal => m_intVal;
|
||||
|
||||
public virtual GeneralName Sender => m_sender;
|
||||
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return new DerSequence(m_intVal, m_sender);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/Challenge.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/Challenge.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fcf21e414c8b368428aeda9d6a20b398
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/Challenge.cs
|
||||
uploadId: 783279
|
||||
116
Runtime/3rdParty/BouncyCastle/asn1/cmp/CmpCertificate.cs
vendored
Normal file
116
Runtime/3rdParty/BouncyCastle/asn1/cmp/CmpCertificate.cs
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class CmpCertificate
|
||||
: Asn1Encodable, IAsn1Choice
|
||||
{
|
||||
public static CmpCertificate GetInstance(object obj)
|
||||
{
|
||||
// TODO[cmp] Review this whole metho
|
||||
|
||||
if (obj == null)
|
||||
return null;
|
||||
|
||||
if (obj is CmpCertificate cmpCertificate)
|
||||
return cmpCertificate;
|
||||
|
||||
if (obj is byte[] bs)
|
||||
{
|
||||
try
|
||||
{
|
||||
obj = Asn1Object.FromByteArray(bs);
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
throw new ArgumentException("Invalid encoding in CmpCertificate");
|
||||
}
|
||||
}
|
||||
|
||||
if (obj is Asn1Sequence)
|
||||
return new CmpCertificate(X509CertificateStructure.GetInstance(obj));
|
||||
|
||||
if (obj is Asn1TaggedObject taggedObject)
|
||||
return new CmpCertificate(taggedObject.TagNo, taggedObject.GetObject());
|
||||
|
||||
throw new ArgumentException("Invalid object: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), nameof(obj));
|
||||
}
|
||||
|
||||
public static CmpCertificate GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
|
||||
{
|
||||
// TODO[cmp]
|
||||
if (taggedObject == null)
|
||||
return null;
|
||||
|
||||
if (!declaredExplicit)
|
||||
throw new ArgumentException("tag must be explicit");
|
||||
|
||||
// TODO[cmp]
|
||||
return GetInstance(taggedObject.GetObject());
|
||||
}
|
||||
|
||||
private readonly X509CertificateStructure m_x509v3PKCert;
|
||||
|
||||
private readonly int m_otherTagValue;
|
||||
private readonly Asn1Encodable m_otherCert;
|
||||
|
||||
/**
|
||||
* Note: the addition of other certificates is a BC extension. If you use this constructor they
|
||||
* will be added with an explicit tag value of type.
|
||||
*
|
||||
* @param type the type of the certificate (used as a tag value).
|
||||
* @param otherCert the object representing the certificate
|
||||
*/
|
||||
public CmpCertificate(int type, Asn1Encodable otherCert)
|
||||
{
|
||||
m_otherTagValue = type;
|
||||
m_otherCert = otherCert;
|
||||
}
|
||||
|
||||
public CmpCertificate(X509CertificateStructure x509v3PKCert)
|
||||
{
|
||||
if (x509v3PKCert.Version != 3)
|
||||
throw new ArgumentException("only version 3 certificates allowed", nameof(x509v3PKCert));
|
||||
|
||||
m_x509v3PKCert = x509v3PKCert;
|
||||
}
|
||||
|
||||
public virtual bool IsX509v3PKCert => m_x509v3PKCert != null;
|
||||
|
||||
public virtual X509CertificateStructure X509v3PKCert => m_x509v3PKCert;
|
||||
|
||||
public virtual int OtherCertTag => m_otherTagValue;
|
||||
|
||||
public virtual Asn1Encodable OtherCert => m_otherCert;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* CMPCertificate ::= CHOICE {
|
||||
* x509v3PKCert Certificate
|
||||
* x509v2AttrCert [1] AttributeCertificate
|
||||
* }
|
||||
* </pre>
|
||||
* Note: the addition of attribute certificates is a BC extension.
|
||||
*
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
if (m_otherCert != null)
|
||||
{
|
||||
// explicit following CMP conventions
|
||||
return new DerTaggedObject(true, m_otherTagValue, m_otherCert);
|
||||
}
|
||||
|
||||
return m_x509v3PKCert.ToAsn1Object();
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CmpCertificate.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CmpCertificate.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a09d19b54d9fad14daf62903f6c98a70
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/CmpCertificate.cs
|
||||
uploadId: 783279
|
||||
262
Runtime/3rdParty/BouncyCastle/asn1/cmp/CmpObjectIdentifiers.cs
vendored
Normal file
262
Runtime/3rdParty/BouncyCastle/asn1/cmp/CmpObjectIdentifiers.cs
vendored
Normal file
@ -0,0 +1,262 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public static class CmpObjectIdentifiers
|
||||
{
|
||||
// RFC 4210
|
||||
|
||||
/**
|
||||
* id-PasswordBasedMac OBJECT IDENTIFIER ::= {1 2 840 113533 7 66 13}
|
||||
*/
|
||||
public static readonly DerObjectIdentifier passwordBasedMac = new DerObjectIdentifier("1.2.840.113533.7.66.13");
|
||||
|
||||
/**
|
||||
* id-DHBasedMac OBJECT IDENTIFIER ::= {1 2 840 113533 7 66 30}
|
||||
*/
|
||||
public static readonly DerObjectIdentifier dhBasedMac = new DerObjectIdentifier("1.2.840.113533.7.66.30");
|
||||
|
||||
// Example InfoTypeAndValue contents include, but are not limited
|
||||
// to, the following (un-comment in this ASN.1 module and use as
|
||||
// appropriate for a given environment):
|
||||
//
|
||||
// id-it-caProtEncCert OBJECT IDENTIFIER ::= {id-it 1}
|
||||
// CAProtEncCertValue ::= CMPCertificate
|
||||
// id-it-signKeyPairTypes OBJECT IDENTIFIER ::= {id-it 2}
|
||||
// SignKeyPairTypesValue ::= SEQUENCE OF AlgorithmIdentifier
|
||||
// id-it-encKeyPairTypes OBJECT IDENTIFIER ::= {id-it 3}
|
||||
// EncKeyPairTypesValue ::= SEQUENCE OF AlgorithmIdentifier
|
||||
// id-it-preferredSymmAlg OBJECT IDENTIFIER ::= {id-it 4}
|
||||
// PreferredSymmAlgValue ::= AlgorithmIdentifier
|
||||
// id-it-caKeyUpdateInfo OBJECT IDENTIFIER ::= {id-it 5}
|
||||
// CAKeyUpdateInfoValue ::= CAKeyUpdAnnContent
|
||||
// id-it-currentCRL OBJECT IDENTIFIER ::= {id-it 6}
|
||||
// CurrentCRLValue ::= CertificateList
|
||||
// id-it-unsupportedOIDs OBJECT IDENTIFIER ::= {id-it 7}
|
||||
// UnsupportedOIDsValue ::= SEQUENCE OF OBJECT IDENTIFIER
|
||||
// id-it-keyPairParamReq OBJECT IDENTIFIER ::= {id-it 10}
|
||||
// KeyPairParamReqValue ::= OBJECT IDENTIFIER
|
||||
// id-it-keyPairParamRep OBJECT IDENTIFIER ::= {id-it 11}
|
||||
// KeyPairParamRepValue ::= AlgorithmIdentifer
|
||||
// id-it-revPassphrase OBJECT IDENTIFIER ::= {id-it 12}
|
||||
// RevPassphraseValue ::= EncryptedValue
|
||||
// id-it-implicitConfirm OBJECT IDENTIFIER ::= {id-it 13}
|
||||
// ImplicitConfirmValue ::= NULL
|
||||
// id-it-confirmWaitTime OBJECT IDENTIFIER ::= {id-it 14}
|
||||
// ConfirmWaitTimeValue ::= GeneralizedTime
|
||||
// id-it-origPKIMessage OBJECT IDENTIFIER ::= {id-it 15}
|
||||
// OrigPKIMessageValue ::= PKIMessages
|
||||
// id-it-suppLangTags OBJECT IDENTIFIER ::= {id-it 16}
|
||||
// SuppLangTagsValue ::= SEQUENCE OF UTF8String
|
||||
// id-it-certProfile OBJECT IDENTIFIER ::= {id-it 21}
|
||||
// CertProfileValue ::= SEQUENCE SIZE (1..MAX) OF UTF8String
|
||||
// where
|
||||
//
|
||||
// id-pkix OBJECT IDENTIFIER ::= {
|
||||
// iso(1) identified-organization(3)
|
||||
// dod(6) internet(1) security(5) mechanisms(5) pkix(7)}
|
||||
// and
|
||||
// id-it OBJECT IDENTIFIER ::= {id-pkix 4}
|
||||
|
||||
/** RFC 4120: it-id: PKIX.4 = 1.3.6.1.5.5.7.4 */
|
||||
|
||||
|
||||
/**
|
||||
* RFC 4120: 1.3.6.1.5.5.7.4.1
|
||||
*/
|
||||
public static readonly DerObjectIdentifier it_caProtEncCert = new DerObjectIdentifier("1.3.6.1.5.5.7.4.1");
|
||||
/**
|
||||
* RFC 4120: 1.3.6.1.5.5.7.4.2
|
||||
*/
|
||||
public static readonly DerObjectIdentifier it_signKeyPairTypes = new DerObjectIdentifier("1.3.6.1.5.5.7.4.2");
|
||||
/**
|
||||
* RFC 4120: 1.3.6.1.5.5.7.4.3
|
||||
*/
|
||||
public static readonly DerObjectIdentifier it_encKeyPairTypes = new DerObjectIdentifier("1.3.6.1.5.5.7.4.3");
|
||||
/**
|
||||
* RFC 4120: 1.3.6.1.5.5.7.4.4
|
||||
*/
|
||||
public static readonly DerObjectIdentifier it_preferredSymAlg = new DerObjectIdentifier("1.3.6.1.5.5.7.4.4");
|
||||
/**
|
||||
* RFC 4120: 1.3.6.1.5.5.7.4.5
|
||||
*/
|
||||
public static readonly DerObjectIdentifier it_caKeyUpdateInfo = new DerObjectIdentifier("1.3.6.1.5.5.7.4.5");
|
||||
/**
|
||||
* RFC 4120: 1.3.6.1.5.5.7.4.6
|
||||
*/
|
||||
public static readonly DerObjectIdentifier it_currentCRL = new DerObjectIdentifier("1.3.6.1.5.5.7.4.6");
|
||||
/**
|
||||
* RFC 4120: 1.3.6.1.5.5.7.4.7
|
||||
*/
|
||||
public static readonly DerObjectIdentifier it_unsupportedOIDs = new DerObjectIdentifier("1.3.6.1.5.5.7.4.7");
|
||||
/**
|
||||
* RFC 4120: 1.3.6.1.5.5.7.4.10
|
||||
*/
|
||||
public static readonly DerObjectIdentifier it_keyPairParamReq = new DerObjectIdentifier("1.3.6.1.5.5.7.4.10");
|
||||
/**
|
||||
* RFC 4120: 1.3.6.1.5.5.7.4.11
|
||||
*/
|
||||
public static readonly DerObjectIdentifier it_keyPairParamRep = new DerObjectIdentifier("1.3.6.1.5.5.7.4.11");
|
||||
/**
|
||||
* RFC 4120: 1.3.6.1.5.5.7.4.12
|
||||
*/
|
||||
public static readonly DerObjectIdentifier it_revPassphrase = new DerObjectIdentifier("1.3.6.1.5.5.7.4.12");
|
||||
/**
|
||||
* RFC 4120: 1.3.6.1.5.5.7.4.13
|
||||
*/
|
||||
public static readonly DerObjectIdentifier it_implicitConfirm = new DerObjectIdentifier("1.3.6.1.5.5.7.4.13");
|
||||
/**
|
||||
* RFC 4120: 1.3.6.1.5.5.7.4.14
|
||||
*/
|
||||
public static readonly DerObjectIdentifier it_confirmWaitTime = new DerObjectIdentifier("1.3.6.1.5.5.7.4.14");
|
||||
/**
|
||||
* RFC 4120: 1.3.6.1.5.5.7.4.15
|
||||
*/
|
||||
public static readonly DerObjectIdentifier it_origPKIMessage = new DerObjectIdentifier("1.3.6.1.5.5.7.4.15");
|
||||
/**
|
||||
* RFC 4120: 1.3.6.1.5.5.7.4.16
|
||||
*/
|
||||
public static readonly DerObjectIdentifier it_suppLangTags = new DerObjectIdentifier("1.3.6.1.5.5.7.4.16");
|
||||
|
||||
/**
|
||||
* Update 16, RFC 4210
|
||||
* {id-it 17}
|
||||
*/
|
||||
public static readonly DerObjectIdentifier id_it_caCerts = new DerObjectIdentifier("1.3.6.1.5.5.7.4.17");
|
||||
|
||||
|
||||
/**
|
||||
* Update 16, RFC 4210
|
||||
* GenRep: {id-it 18}, RootCaKeyUpdateContent
|
||||
*/
|
||||
public static readonly DerObjectIdentifier id_it_rootCaKeyUpdate = new DerObjectIdentifier("1.3.6.1.5.5.7.4.18");
|
||||
|
||||
|
||||
/**
|
||||
* Update 16, RFC 4210
|
||||
* {id-it 19}
|
||||
*/
|
||||
public static readonly DerObjectIdentifier id_it_certReqTemplate = new DerObjectIdentifier("1.3.6.1.5.5.7.4.19");
|
||||
|
||||
|
||||
/**
|
||||
* Update 16, RFC 4210
|
||||
* GenMsg: {id-it 20}, RootCaCertValue
|
||||
*/
|
||||
public static readonly DerObjectIdentifier id_it_rootCaCert = new DerObjectIdentifier("1.3.6.1.5.5.7.4.20");
|
||||
|
||||
/**
|
||||
* Update-16 to RFC 4210
|
||||
* id-it-certProfile OBJECT IDENTIFIER ::= {id-it 21}
|
||||
*/
|
||||
public static readonly DerObjectIdentifier id_it_certProfile = new DerObjectIdentifier("1.3.6.1.5.5.7.4.21");
|
||||
|
||||
public static readonly DerObjectIdentifier id_it_crlStatusList = new DerObjectIdentifier("1.3.6.1.5.5.7.4.22");
|
||||
|
||||
public static readonly DerObjectIdentifier id_it_crls = new DerObjectIdentifier("1.3.6.1.5.5.7.4.23");
|
||||
|
||||
// Not yet formally defined.
|
||||
|
||||
//public static readonly DerObjectIdentifier id_it_crlStatusList = null;
|
||||
//public static readonly DerObjectIdentifier id_it_crls = null;
|
||||
|
||||
|
||||
// RFC 4211
|
||||
|
||||
// id-pkix OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
|
||||
// dod(6) internet(1) security(5) mechanisms(5) pkix(7) }
|
||||
//
|
||||
// arc for Internet X.509 PKI protocols and their components
|
||||
// id-pkip OBJECT IDENTIFIER :: { id-pkix pkip(5) }
|
||||
//
|
||||
// arc for Registration Controls in CRMF
|
||||
// id-regCtrl OBJECT IDENTIFIER ::= { id-pkip regCtrl(1) }
|
||||
//
|
||||
// arc for Registration Info in CRMF
|
||||
// id-regInfo OBJECT IDENTIFIER ::= { id-pkip id-regInfo(2) }
|
||||
|
||||
/**
|
||||
* RFC 4211: it-pkip: PKIX.5 = 1.3.6.1.5.5.7.5
|
||||
*/
|
||||
public static readonly DerObjectIdentifier id_pkip = new DerObjectIdentifier("1.3.6.1.5.5.7.5");
|
||||
|
||||
/**
|
||||
* RFC 4211: it-regCtrl: 1.3.6.1.5.5.7.5.1
|
||||
*/
|
||||
public static readonly DerObjectIdentifier id_regCtrl = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1");
|
||||
/**
|
||||
* RFC 4211: it-regInfo: 1.3.6.1.5.5.7.5.2
|
||||
*/
|
||||
public static readonly DerObjectIdentifier id_regInfo = new DerObjectIdentifier("1.3.6.1.5.5.7.5.2");
|
||||
|
||||
|
||||
/**
|
||||
* 1.3.6.1.5.5.7.5.1.1
|
||||
*/
|
||||
public static readonly DerObjectIdentifier regCtrl_regToken = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1.1");
|
||||
/**
|
||||
* 1.3.6.1.5.5.7.5.1.2
|
||||
*/
|
||||
public static readonly DerObjectIdentifier regCtrl_authenticator = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1.2");
|
||||
/**
|
||||
* 1.3.6.1.5.5.7.5.1.3
|
||||
*/
|
||||
public static readonly DerObjectIdentifier regCtrl_pkiPublicationInfo = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1.3");
|
||||
/**
|
||||
* 1.3.6.1.5.5.7.5.1.4
|
||||
*/
|
||||
public static readonly DerObjectIdentifier regCtrl_pkiArchiveOptions = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1.4");
|
||||
/**
|
||||
* 1.3.6.1.5.5.7.5.1.5
|
||||
*/
|
||||
public static readonly DerObjectIdentifier regCtrl_oldCertID = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1.5");
|
||||
/**
|
||||
* 1.3.6.1.5.5.7.5.1.6
|
||||
*/
|
||||
public static readonly DerObjectIdentifier regCtrl_protocolEncrKey = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1.6");
|
||||
|
||||
/**
|
||||
* From RFC4210:
|
||||
* id-regCtrl-altCertTemplate OBJECT IDENTIFIER ::= {id-regCtrl 7}; 1.3.6.1.5.5.7.1.7
|
||||
*/
|
||||
public static readonly DerObjectIdentifier regCtrl_altCertTemplate = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1.7");
|
||||
|
||||
/**
|
||||
* RFC 4211: it-regInfo-utf8Pairs: 1.3.6.1.5.5.7.5.2.1
|
||||
*/
|
||||
public static readonly DerObjectIdentifier regInfo_utf8Pairs = new DerObjectIdentifier("1.3.6.1.5.5.7.5.2.1");
|
||||
/**
|
||||
* RFC 4211: it-regInfo-certReq: 1.3.6.1.5.5.7.5.2.1
|
||||
*/
|
||||
public static readonly DerObjectIdentifier regInfo_certReq = new DerObjectIdentifier("1.3.6.1.5.5.7.5.2.2");
|
||||
|
||||
/**
|
||||
* 1.2.840.113549.1.9.16.1.21
|
||||
* <p>
|
||||
* id-ct OBJECT IDENTIFIER ::= { id-smime 1 } -- content types
|
||||
* </p><p>
|
||||
* id-ct-encKeyWithID OBJECT IDENTIFIER ::= {id-ct 21}
|
||||
* </p>
|
||||
*/
|
||||
public static readonly DerObjectIdentifier ct_encKeyWithID = new DerObjectIdentifier("1.2.840.113549.1.9.16.1.21");
|
||||
|
||||
|
||||
/**
|
||||
* id-regCtrl-algId OBJECT IDENTIFIER ::= { iso(1)
|
||||
* identified-organization(3) dod(6) internet(1) security(5)
|
||||
* mechanisms(5) pkix(7) pkip(5) regCtrl(1) 11 }
|
||||
*/
|
||||
public static readonly DerObjectIdentifier id_regCtrl_algId = id_pkip.Branch("1.11");
|
||||
|
||||
/**
|
||||
* id-regCtrl-rsaKeyLen OBJECT IDENTIFIER ::= { iso(1)
|
||||
* identified-organization(3) dod(6) internet(1) security(5)
|
||||
* mechanisms(5) pkix(7) pkip(5) regCtrl(1) 12 }
|
||||
*/
|
||||
public static readonly DerObjectIdentifier id_regCtrl_rsaKeyLen = id_pkip.Branch("1.12");
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CmpObjectIdentifiers.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CmpObjectIdentifiers.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 67d51d1e662ef944b9ecf34bebe6a4cc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/CmpObjectIdentifiers.cs
|
||||
uploadId: 783279
|
||||
51
Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlAnnContent.cs
vendored
Normal file
51
Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlAnnContent.cs
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class CrlAnnContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static CrlAnnContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is CrlAnnContent crlAnnContent)
|
||||
return crlAnnContent;
|
||||
|
||||
if (obj != null)
|
||||
return new CrlAnnContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly Asn1Sequence m_content;
|
||||
|
||||
private CrlAnnContent(Asn1Sequence seq)
|
||||
{
|
||||
m_content = seq;
|
||||
}
|
||||
|
||||
public CrlAnnContent(CertificateList crl)
|
||||
{
|
||||
m_content = new DerSequence(crl);
|
||||
}
|
||||
|
||||
public virtual CertificateList[] ToCertificateListArray()
|
||||
{
|
||||
return m_content.MapElements(CertificateList.GetInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* CrlAnnContent ::= SEQUENCE OF CertificateList
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return m_content;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlAnnContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlAnnContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6b3ceb87b6ac3e444b5ce59b0dcc8aee
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlAnnContent.cs
|
||||
uploadId: 783279
|
||||
76
Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlSource.cs
vendored
Normal file
76
Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlSource.cs
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* GenMsg: {id-it TBD1}, SEQUENCE SIZE (1..MAX) OF CRLStatus
|
||||
* GenRep: {id-it TBD2}, SEQUENCE SIZE (1..MAX) OF
|
||||
* CertificateList | < absent >
|
||||
* <p>
|
||||
* CRLSource ::= CHOICE {
|
||||
* dpn [0] DistributionPointName,
|
||||
* issuer [1] GeneralNames }
|
||||
* </p>
|
||||
*/
|
||||
public class CrlSource
|
||||
: Asn1Encodable, IAsn1Choice
|
||||
{
|
||||
public static CrlSource GetInstance(object obj)
|
||||
{
|
||||
if (obj is CrlSource crlSource)
|
||||
return crlSource;
|
||||
|
||||
if (obj != null)
|
||||
return new CrlSource(Asn1TaggedObject.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly DistributionPointName m_dpn;
|
||||
private readonly GeneralNames m_issuer;
|
||||
|
||||
private CrlSource(Asn1TaggedObject taggedObject)
|
||||
{
|
||||
switch (taggedObject.TagNo)
|
||||
{
|
||||
case 0:
|
||||
m_dpn = DistributionPointName.GetInstance(taggedObject, true);
|
||||
m_issuer = null;
|
||||
break;
|
||||
case 1:
|
||||
m_dpn = null;
|
||||
m_issuer = GeneralNames.GetInstance(taggedObject, true);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException("unknown tag: " + Asn1Utilities.GetTagText(taggedObject));
|
||||
}
|
||||
}
|
||||
|
||||
public CrlSource(DistributionPointName dpn, GeneralNames issuer)
|
||||
{
|
||||
if ((dpn == null) == (issuer == null))
|
||||
throw new ArgumentException("either dpn or issuer must be set");
|
||||
|
||||
m_dpn = dpn;
|
||||
m_issuer = issuer;
|
||||
}
|
||||
|
||||
public virtual DistributionPointName Dpn => m_dpn;
|
||||
|
||||
public virtual GeneralNames Issuer => m_issuer;
|
||||
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
if (m_dpn != null)
|
||||
return new DerTaggedObject(true, 0, m_dpn);
|
||||
|
||||
return new DerTaggedObject(true, 1, m_issuer);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlSource.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlSource.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d78b1f2c335bedc4da114a48080d16dd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlSource.cs
|
||||
uploadId: 783279
|
||||
65
Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlStatus.cs
vendored
Normal file
65
Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlStatus.cs
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* CRLStatus ::= SEQUENCE {
|
||||
* source CRLSource,
|
||||
* thisUpdate Time OPTIONAL }
|
||||
*/
|
||||
public class CrlStatus
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static CrlStatus GetInstance(object obj)
|
||||
{
|
||||
if (obj is CrlStatus crlStatus)
|
||||
return crlStatus;
|
||||
|
||||
if (obj != null)
|
||||
return new CrlStatus(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly CrlSource m_source;
|
||||
private readonly Time m_thisUpdate;
|
||||
|
||||
private CrlStatus(Asn1Sequence sequence)
|
||||
{
|
||||
int count = sequence.Count;
|
||||
if (count < 1 || count > 2)
|
||||
throw new ArgumentException("expected sequence size of 1 or 2, got " + count);
|
||||
|
||||
m_source = CrlSource.GetInstance(sequence[0]);
|
||||
|
||||
if (sequence.Count == 2)
|
||||
{
|
||||
m_thisUpdate = Time.GetInstance(sequence[1]);
|
||||
}
|
||||
}
|
||||
|
||||
public CrlStatus(CrlSource source, Time thisUpdate)
|
||||
{
|
||||
m_source = source;
|
||||
m_thisUpdate = thisUpdate;
|
||||
}
|
||||
|
||||
public virtual CrlSource Source => m_source;
|
||||
|
||||
public virtual Time ThisUpdate => m_thisUpdate;
|
||||
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
if (m_thisUpdate == null)
|
||||
return new DerSequence(m_source);
|
||||
|
||||
return new DerSequence(m_source, m_thisUpdate);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlStatus.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlStatus.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52cb7b06f5c4825439f29b0bd117df7a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/CrlStatus.cs
|
||||
uploadId: 783279
|
||||
60
Runtime/3rdParty/BouncyCastle/asn1/cmp/DhbmParameter.cs
vendored
Normal file
60
Runtime/3rdParty/BouncyCastle/asn1/cmp/DhbmParameter.cs
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* DHBMParameter ::= SEQUENCE {
|
||||
* owf AlgorithmIdentifier,
|
||||
* -- AlgId for a One-Way Function (SHA-1 recommended)
|
||||
* mac AlgorithmIdentifier
|
||||
* -- the MAC AlgId (e.g., DES-MAC, Triple-DES-MAC [PKCS11],
|
||||
* } -- or HMAC [RFC2104, RFC2202])
|
||||
*/
|
||||
public class DhbmParameter
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static DhbmParameter GetInstance(object obj)
|
||||
{
|
||||
if (obj is DhbmParameter dhbmParameter)
|
||||
return dhbmParameter;
|
||||
|
||||
if (obj != null)
|
||||
return new DhbmParameter(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly AlgorithmIdentifier m_owf;
|
||||
private readonly AlgorithmIdentifier m_mac;
|
||||
|
||||
private DhbmParameter(Asn1Sequence sequence)
|
||||
{
|
||||
if (sequence.Count != 2)
|
||||
throw new ArgumentException("expecting sequence size of 2");
|
||||
|
||||
m_owf = AlgorithmIdentifier.GetInstance(sequence[0]);
|
||||
m_mac = AlgorithmIdentifier.GetInstance(sequence[1]);
|
||||
}
|
||||
|
||||
public DhbmParameter(AlgorithmIdentifier owf, AlgorithmIdentifier mac)
|
||||
{
|
||||
m_owf = owf;
|
||||
m_mac = mac;
|
||||
}
|
||||
|
||||
public virtual AlgorithmIdentifier Owf => m_owf;
|
||||
|
||||
public virtual AlgorithmIdentifier Mac => m_mac;
|
||||
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return new DerSequence(m_owf, m_mac);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/DhbmParameter.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/DhbmParameter.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 300d96581f173764084a386a2ac53f7d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/DhbmParameter.cs
|
||||
uploadId: 783279
|
||||
99
Runtime/3rdParty/BouncyCastle/asn1/cmp/ErrorMsgContent.cs
vendored
Normal file
99
Runtime/3rdParty/BouncyCastle/asn1/cmp/ErrorMsgContent.cs
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* <pre>
|
||||
* ErrorMsgContent ::= SEQUENCE {
|
||||
* pKIStatusInfo PKIStatusInfo,
|
||||
* errorCode INTEGER OPTIONAL,
|
||||
* -- implementation-specific error codes
|
||||
* errorDetails PKIFreeText OPTIONAL
|
||||
* -- implementation-specific error details
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public class ErrorMsgContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static ErrorMsgContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is ErrorMsgContent errorMsgContent)
|
||||
return errorMsgContent;
|
||||
|
||||
if (obj != null)
|
||||
return new ErrorMsgContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly PkiStatusInfo m_pkiStatusInfo;
|
||||
private readonly DerInteger m_errorCode;
|
||||
private readonly PkiFreeText m_errorDetails;
|
||||
|
||||
private ErrorMsgContent(Asn1Sequence seq)
|
||||
{
|
||||
m_pkiStatusInfo = PkiStatusInfo.GetInstance(seq[0]);
|
||||
|
||||
for (int pos = 1; pos < seq.Count; ++pos)
|
||||
{
|
||||
Asn1Encodable ae = seq[pos];
|
||||
if (ae is DerInteger)
|
||||
{
|
||||
m_errorCode = DerInteger.GetInstance(ae);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_errorDetails = PkiFreeText.GetInstance(ae);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ErrorMsgContent(PkiStatusInfo pkiStatusInfo)
|
||||
: this(pkiStatusInfo, null, null)
|
||||
{
|
||||
}
|
||||
|
||||
public ErrorMsgContent(
|
||||
PkiStatusInfo pkiStatusInfo,
|
||||
DerInteger errorCode,
|
||||
PkiFreeText errorDetails)
|
||||
{
|
||||
if (pkiStatusInfo == null)
|
||||
throw new ArgumentNullException(nameof(pkiStatusInfo));
|
||||
|
||||
m_pkiStatusInfo = pkiStatusInfo;
|
||||
m_errorCode = errorCode;
|
||||
m_errorDetails = errorDetails;
|
||||
}
|
||||
|
||||
public virtual PkiStatusInfo PkiStatusInfo => m_pkiStatusInfo;
|
||||
|
||||
public virtual DerInteger ErrorCode => m_errorCode;
|
||||
|
||||
public virtual PkiFreeText ErrorDetails => m_errorDetails;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* ErrorMsgContent ::= SEQUENCE {
|
||||
* pKIStatusInfo PKIStatusInfo,
|
||||
* errorCode INTEGER OPTIONAL,
|
||||
* -- implementation-specific error codes
|
||||
* errorDetails PKIFreeText OPTIONAL
|
||||
* -- implementation-specific error details
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(m_pkiStatusInfo);
|
||||
v.AddOptional(m_errorCode, m_errorDetails);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/ErrorMsgContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/ErrorMsgContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 223c8b85c7e2f3f42b4a5de603d5f19a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/ErrorMsgContent.cs
|
||||
uploadId: 783279
|
||||
57
Runtime/3rdParty/BouncyCastle/asn1/cmp/GenMsgContent.cs
vendored
Normal file
57
Runtime/3rdParty/BouncyCastle/asn1/cmp/GenMsgContent.cs
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* <pre>GenMsgContent ::= SEQUENCE OF InfoTypeAndValue</pre>
|
||||
*/
|
||||
public class GenMsgContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static GenMsgContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is GenMsgContent genMsgContent)
|
||||
return genMsgContent;
|
||||
|
||||
if (obj != null)
|
||||
return new GenMsgContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly Asn1Sequence m_content;
|
||||
|
||||
private GenMsgContent(Asn1Sequence seq)
|
||||
{
|
||||
m_content = seq;
|
||||
}
|
||||
|
||||
public GenMsgContent(InfoTypeAndValue itv)
|
||||
{
|
||||
m_content = new DerSequence(itv);
|
||||
}
|
||||
|
||||
public GenMsgContent(params InfoTypeAndValue[] itvs)
|
||||
{
|
||||
m_content = new DerSequence(itvs);
|
||||
}
|
||||
|
||||
public virtual InfoTypeAndValue[] ToInfoTypeAndValueArray()
|
||||
{
|
||||
return m_content.MapElements(InfoTypeAndValue.GetInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* GenMsgContent ::= SEQUENCE OF InfoTypeAndValue
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return m_content;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/GenMsgContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/GenMsgContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: adf9aeef68859ff43965340be1c9a07f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/GenMsgContent.cs
|
||||
uploadId: 783279
|
||||
54
Runtime/3rdParty/BouncyCastle/asn1/cmp/GenRepContent.cs
vendored
Normal file
54
Runtime/3rdParty/BouncyCastle/asn1/cmp/GenRepContent.cs
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class GenRepContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static GenRepContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is GenRepContent genRepContent)
|
||||
return genRepContent;
|
||||
|
||||
if (obj != null)
|
||||
return new GenRepContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly Asn1Sequence m_content;
|
||||
|
||||
private GenRepContent(Asn1Sequence seq)
|
||||
{
|
||||
m_content = seq;
|
||||
}
|
||||
|
||||
public GenRepContent(InfoTypeAndValue itv)
|
||||
{
|
||||
m_content = new DerSequence(itv);
|
||||
}
|
||||
|
||||
public GenRepContent(params InfoTypeAndValue[] itvs)
|
||||
{
|
||||
m_content = new DerSequence(itvs);
|
||||
}
|
||||
|
||||
public virtual InfoTypeAndValue[] ToInfoTypeAndValueArray()
|
||||
{
|
||||
return m_content.MapElements(InfoTypeAndValue.GetInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* GenRepContent ::= SEQUENCE OF InfoTypeAndValue
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return m_content;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/GenRepContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/GenRepContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35b01055823536940ad781d6f35b3c82
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/GenRepContent.cs
|
||||
uploadId: 783279
|
||||
116
Runtime/3rdParty/BouncyCastle/asn1/cmp/InfoTypeAndValue.cs
vendored
Normal file
116
Runtime/3rdParty/BouncyCastle/asn1/cmp/InfoTypeAndValue.cs
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
#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.Cmp
|
||||
{
|
||||
/**
|
||||
* Example InfoTypeAndValue contents include, but are not limited
|
||||
* to, the following (un-comment in this ASN.1 module and use as
|
||||
* appropriate for a given environment):
|
||||
* <pre>
|
||||
* id-it-caProtEncCert OBJECT IDENTIFIER ::= {id-it 1}
|
||||
* CAProtEncCertValue ::= CMPCertificate
|
||||
* id-it-signKeyPairTypes OBJECT IDENTIFIER ::= {id-it 2}
|
||||
* SignKeyPairTypesValue ::= SEQUENCE OF AlgorithmIdentifier
|
||||
* id-it-encKeyPairTypes OBJECT IDENTIFIER ::= {id-it 3}
|
||||
* EncKeyPairTypesValue ::= SEQUENCE OF AlgorithmIdentifier
|
||||
* id-it-preferredSymmAlg OBJECT IDENTIFIER ::= {id-it 4}
|
||||
* PreferredSymmAlgValue ::= AlgorithmIdentifier
|
||||
* id-it-caKeyUpdateInfo OBJECT IDENTIFIER ::= {id-it 5}
|
||||
* CAKeyUpdateInfoValue ::= CAKeyUpdAnnContent
|
||||
* id-it-currentCRL OBJECT IDENTIFIER ::= {id-it 6}
|
||||
* CurrentCRLValue ::= CertificateList
|
||||
* id-it-unsupportedOIDs OBJECT IDENTIFIER ::= {id-it 7}
|
||||
* UnsupportedOIDsValue ::= SEQUENCE OF OBJECT IDENTIFIER
|
||||
* id-it-keyPairParamReq OBJECT IDENTIFIER ::= {id-it 10}
|
||||
* KeyPairParamReqValue ::= OBJECT IDENTIFIER
|
||||
* id-it-keyPairParamRep OBJECT IDENTIFIER ::= {id-it 11}
|
||||
* KeyPairParamRepValue ::= AlgorithmIdentifer
|
||||
* id-it-revPassphrase OBJECT IDENTIFIER ::= {id-it 12}
|
||||
* RevPassphraseValue ::= EncryptedValue
|
||||
* id-it-implicitConfirm OBJECT IDENTIFIER ::= {id-it 13}
|
||||
* ImplicitConfirmValue ::= NULL
|
||||
* id-it-confirmWaitTime OBJECT IDENTIFIER ::= {id-it 14}
|
||||
* ConfirmWaitTimeValue ::= GeneralizedTime
|
||||
* id-it-origPKIMessage OBJECT IDENTIFIER ::= {id-it 15}
|
||||
* OrigPKIMessageValue ::= PKIMessages
|
||||
* id-it-suppLangTags OBJECT IDENTIFIER ::= {id-it 16}
|
||||
* SuppLangTagsValue ::= SEQUENCE OF UTF8String
|
||||
*
|
||||
* where
|
||||
*
|
||||
* id-pkix OBJECT IDENTIFIER ::= {
|
||||
* iso(1) identified-organization(3)
|
||||
* dod(6) internet(1) security(5) mechanisms(5) pkix(7)}
|
||||
* and
|
||||
* id-it OBJECT IDENTIFIER ::= {id-pkix 4}
|
||||
* </pre>
|
||||
*/
|
||||
public class InfoTypeAndValue
|
||||
: Asn1Encodable
|
||||
{
|
||||
private readonly DerObjectIdentifier m_infoType;
|
||||
private readonly Asn1Encodable m_infoValue;
|
||||
|
||||
private InfoTypeAndValue(Asn1Sequence seq)
|
||||
{
|
||||
m_infoType = DerObjectIdentifier.GetInstance(seq[0]);
|
||||
|
||||
if (seq.Count > 1)
|
||||
{
|
||||
m_infoValue = seq[1];
|
||||
}
|
||||
}
|
||||
|
||||
public static InfoTypeAndValue GetInstance(object obj)
|
||||
{
|
||||
if (obj is InfoTypeAndValue infoTypeAndValue)
|
||||
return infoTypeAndValue;
|
||||
|
||||
if (obj != null)
|
||||
return new InfoTypeAndValue(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public InfoTypeAndValue(DerObjectIdentifier infoType)
|
||||
: this(infoType, null)
|
||||
{
|
||||
}
|
||||
|
||||
public InfoTypeAndValue(DerObjectIdentifier infoType, Asn1Encodable infoValue)
|
||||
{
|
||||
if (infoType == null)
|
||||
throw new ArgumentNullException(nameof(infoType));
|
||||
|
||||
m_infoType = infoType;
|
||||
m_infoValue = infoValue;
|
||||
}
|
||||
|
||||
public virtual DerObjectIdentifier InfoType => m_infoType;
|
||||
|
||||
public virtual Asn1Encodable InfoValue => m_infoValue;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* InfoTypeAndValue ::= SEQUENCE {
|
||||
* infoType OBJECT IDENTIFIER,
|
||||
* infoValue ANY DEFINED BY infoType OPTIONAL
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
if (m_infoValue == null)
|
||||
return new DerSequence(m_infoType);
|
||||
|
||||
return new DerSequence(m_infoType, m_infoValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/InfoTypeAndValue.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/InfoTypeAndValue.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f080219935a78543b30e20caf3e76cf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/InfoTypeAndValue.cs
|
||||
uploadId: 783279
|
||||
95
Runtime/3rdParty/BouncyCastle/asn1/cmp/KeyRecRepContent.cs
vendored
Normal file
95
Runtime/3rdParty/BouncyCastle/asn1/cmp/KeyRecRepContent.cs
vendored
Normal file
@ -0,0 +1,95 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class KeyRecRepContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static KeyRecRepContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is KeyRecRepContent keyRecRepContent)
|
||||
return keyRecRepContent;
|
||||
|
||||
if (obj != null)
|
||||
return new KeyRecRepContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly PkiStatusInfo m_status;
|
||||
private readonly CmpCertificate m_newSigCert;
|
||||
private readonly Asn1Sequence m_caCerts;
|
||||
private readonly Asn1Sequence m_keyPairHist;
|
||||
|
||||
private KeyRecRepContent(Asn1Sequence seq)
|
||||
{
|
||||
m_status = PkiStatusInfo.GetInstance(seq[0]);
|
||||
|
||||
for (int pos = 1; pos < seq.Count; ++pos)
|
||||
{
|
||||
Asn1TaggedObject tObj = Asn1TaggedObject.GetInstance(seq[pos]);
|
||||
|
||||
switch (tObj.TagNo)
|
||||
{
|
||||
case 0:
|
||||
m_newSigCert = CmpCertificate.GetInstance(tObj.GetObject());
|
||||
break;
|
||||
case 1:
|
||||
m_caCerts = Asn1Sequence.GetInstance(tObj.GetObject());
|
||||
break;
|
||||
case 2:
|
||||
m_keyPairHist = Asn1Sequence.GetInstance(tObj.GetObject());
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException("unknown tag number: " + tObj.TagNo, "seq");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual PkiStatusInfo Status => m_status;
|
||||
|
||||
public virtual CmpCertificate NewSigCert => m_newSigCert;
|
||||
|
||||
public virtual CmpCertificate[] GetCACerts()
|
||||
{
|
||||
if (m_caCerts == null)
|
||||
return null;
|
||||
|
||||
return m_caCerts.MapElements(CmpCertificate.GetInstance);
|
||||
}
|
||||
|
||||
public virtual CertifiedKeyPair[] GetKeyPairHist()
|
||||
{
|
||||
if (m_keyPairHist == null)
|
||||
return null;
|
||||
|
||||
return m_keyPairHist.MapElements(CertifiedKeyPair.GetInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* KeyRecRepContent ::= SEQUENCE {
|
||||
* status PKIStatusInfo,
|
||||
* newSigCert [0] CMPCertificate OPTIONAL,
|
||||
* caCerts [1] SEQUENCE SIZE (1..MAX) OF
|
||||
* CMPCertificate OPTIONAL,
|
||||
* keyPairHist [2] SEQUENCE SIZE (1..MAX) OF
|
||||
* CertifiedKeyPair OPTIONAL
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(m_status);
|
||||
v.AddOptionalTagged(true, 0, m_newSigCert);
|
||||
v.AddOptionalTagged(true, 1, m_caCerts);
|
||||
v.AddOptionalTagged(true, 2, m_keyPairHist);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/KeyRecRepContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/KeyRecRepContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25d6550531e2d484dabf2a4845730218
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/KeyRecRepContent.cs
|
||||
uploadId: 783279
|
||||
39
Runtime/3rdParty/BouncyCastle/asn1/cmp/NestedMessageContent.cs
vendored
Normal file
39
Runtime/3rdParty/BouncyCastle/asn1/cmp/NestedMessageContent.cs
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* NestedMessageContent ::= PKIMessages
|
||||
*/
|
||||
public class NestedMessageContent
|
||||
: PkiMessages
|
||||
{
|
||||
public static new NestedMessageContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is NestedMessageContent nestedMessageContent)
|
||||
return nestedMessageContent;
|
||||
|
||||
if (obj != null)
|
||||
return new NestedMessageContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public NestedMessageContent(PkiMessage msg)
|
||||
: base(msg)
|
||||
{
|
||||
}
|
||||
|
||||
public NestedMessageContent(PkiMessage[] msgs)
|
||||
: base(msgs)
|
||||
{
|
||||
}
|
||||
|
||||
public NestedMessageContent(Asn1Sequence seq)
|
||||
: base(seq)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/NestedMessageContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/NestedMessageContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 836d63ef9195b904787d4f0125ddbcea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/NestedMessageContent.cs
|
||||
uploadId: 783279
|
||||
72
Runtime/3rdParty/BouncyCastle/asn1/cmp/OobCert.cs
vendored
Normal file
72
Runtime/3rdParty/BouncyCastle/asn1/cmp/OobCert.cs
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* OOBCert ::= CMPCertificate
|
||||
*/
|
||||
public class OobCert
|
||||
: CmpCertificate
|
||||
{
|
||||
public static new OobCert GetInstance(object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return null;
|
||||
|
||||
if (obj is OobCert oobCert)
|
||||
return oobCert;
|
||||
|
||||
if (obj is CmpCertificate cmpCertificate)
|
||||
return GetInstance(cmpCertificate.GetEncoded());
|
||||
|
||||
if (obj is byte[] bs)
|
||||
{
|
||||
try
|
||||
{
|
||||
obj = Asn1Object.FromByteArray(bs);
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
throw new ArgumentException("Invalid encoding in OobCert");
|
||||
}
|
||||
}
|
||||
|
||||
if (obj is Asn1Sequence seq)
|
||||
return new OobCert(X509CertificateStructure.GetInstance(obj));
|
||||
|
||||
if (obj is Asn1TaggedObject taggedObject)
|
||||
return new OobCert(taggedObject.TagNo, taggedObject.GetObject());
|
||||
|
||||
throw new ArgumentException("Invalid object: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), nameof(obj));
|
||||
}
|
||||
|
||||
public static new OobCert GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
|
||||
{
|
||||
if (taggedObject == null)
|
||||
return null;
|
||||
|
||||
if (!declaredExplicit)
|
||||
throw new ArgumentException("tag must be explicit");
|
||||
|
||||
return GetInstance(taggedObject.GetObject());
|
||||
}
|
||||
|
||||
public OobCert(int type, Asn1Encodable otherCert)
|
||||
: base(type, otherCert)
|
||||
{
|
||||
}
|
||||
|
||||
public OobCert(X509CertificateStructure x509v3PKCert)
|
||||
: base(x509v3PKCert)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/OobCert.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/OobCert.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb775e2d7757c7c47b194f7d6fcd200d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/OobCert.cs
|
||||
uploadId: 783279
|
||||
90
Runtime/3rdParty/BouncyCastle/asn1/cmp/OobCertHash.cs
vendored
Normal file
90
Runtime/3rdParty/BouncyCastle/asn1/cmp/OobCertHash.cs
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* <pre>
|
||||
* OOBCertHash ::= SEQUENCE {
|
||||
* hashAlg [0] AlgorithmIdentifier OPTIONAL,
|
||||
* certId [1] CertId OPTIONAL,
|
||||
* hashVal BIT STRING
|
||||
* -- hashVal is calculated over the DER encoding of the
|
||||
* -- self-signed certificate with the identifier certID.
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public class OobCertHash
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static OobCertHash GetInstance(object obj)
|
||||
{
|
||||
if (obj is OobCertHash oobCertHash)
|
||||
return oobCertHash;
|
||||
|
||||
if (obj != null)
|
||||
return new OobCertHash(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly AlgorithmIdentifier m_hashAlg;
|
||||
private readonly CertId m_certId;
|
||||
private readonly DerBitString m_hashVal;
|
||||
|
||||
private OobCertHash(Asn1Sequence seq)
|
||||
{
|
||||
int index = seq.Count - 1;
|
||||
|
||||
m_hashVal = DerBitString.GetInstance(seq[index--]);
|
||||
|
||||
for (int i = index; i >= 0; i--)
|
||||
{
|
||||
Asn1TaggedObject tObj = (Asn1TaggedObject)seq[i];
|
||||
|
||||
if (tObj.TagNo == 0)
|
||||
{
|
||||
m_hashAlg = AlgorithmIdentifier.GetInstance(tObj, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_certId = CertId.GetInstance(tObj, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual CertId CertID => m_certId;
|
||||
|
||||
public virtual AlgorithmIdentifier HashAlg => m_hashAlg;
|
||||
|
||||
public virtual DerBitString HashVal => m_hashVal;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* OobCertHash ::= SEQUENCE {
|
||||
* hashAlg [0] AlgorithmIdentifier OPTIONAL,
|
||||
* certId [1] CertId OPTIONAL,
|
||||
* hashVal BIT STRING
|
||||
* -- hashVal is calculated over the Der encoding of the
|
||||
* -- self-signed certificate with the identifier certID.
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector();
|
||||
v.AddOptionalTagged(true, 0, m_hashAlg);
|
||||
v.AddOptionalTagged(true, 1, m_certId);
|
||||
v.Add(m_hashVal);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/OobCertHash.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/OobCertHash.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f791678c53a2bf49a7b8095bd8739d4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/OobCertHash.cs
|
||||
uploadId: 783279
|
||||
215
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIBody.cs
vendored
Normal file
215
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIBody.cs
vendored
Normal file
@ -0,0 +1,215 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* PKIBody ::= CHOICE { -- message-specific body elements
|
||||
* ir [0] CertReqMessages, --Initialization Request
|
||||
* ip [1] CertRepMessage, --Initialization Response
|
||||
* cr [2] CertReqMessages, --Certification Request
|
||||
* cp [3] CertRepMessage, --Certification Response
|
||||
* p10cr [4] CertificationRequest, --imported from [PKCS10]
|
||||
* popdecc [5] POPODecKeyChallContent, --pop Challenge
|
||||
* popdecr [6] POPODecKeyRespContent, --pop Response
|
||||
* kur [7] CertReqMessages, --Key Update Request
|
||||
* kup [8] CertRepMessage, --Key Update Response
|
||||
* krr [9] CertReqMessages, --Key Recovery Request
|
||||
* krp [10] KeyRecRepContent, --Key Recovery Response
|
||||
* rr [11] RevReqContent, --Revocation Request
|
||||
* rp [12] RevRepContent, --Revocation Response
|
||||
* ccr [13] CertReqMessages, --Cross-Cert. Request
|
||||
* ccp [14] CertRepMessage, --Cross-Cert. Response
|
||||
* ckuann [15] CAKeyUpdAnnContent, --CA Key Update Ann.
|
||||
* cann [16] CertAnnContent, --Certificate Ann.
|
||||
* rann [17] RevAnnContent, --Revocation Ann.
|
||||
* crlann [18] CRLAnnContent, --CRL Announcement
|
||||
* pkiconf [19] PKIConfirmContent, --Confirmation
|
||||
* nested [20] NestedMessageContent, --Nested Message
|
||||
* genm [21] GenMsgContent, --General Message
|
||||
* genp [22] GenRepContent, --General Response
|
||||
* error [23] ErrorMsgContent, --Error Message
|
||||
* certConf [24] CertConfirmContent, --Certificate confirm
|
||||
* pollReq [25] PollReqContent, --Polling request
|
||||
* pollRep [26] PollRepContent --Polling response
|
||||
* }
|
||||
*/
|
||||
public class PkiBody
|
||||
: Asn1Encodable, IAsn1Choice
|
||||
{
|
||||
public const int TYPE_INIT_REQ = 0;
|
||||
public const int TYPE_INIT_REP = 1;
|
||||
public const int TYPE_CERT_REQ = 2;
|
||||
public const int TYPE_CERT_REP = 3;
|
||||
public const int TYPE_P10_CERT_REQ = 4;
|
||||
public const int TYPE_POPO_CHALL = 5;
|
||||
public const int TYPE_POPO_REP = 6;
|
||||
public const int TYPE_KEY_UPDATE_REQ = 7;
|
||||
public const int TYPE_KEY_UPDATE_REP = 8;
|
||||
public const int TYPE_KEY_RECOVERY_REQ = 9;
|
||||
public const int TYPE_KEY_RECOVERY_REP = 10;
|
||||
public const int TYPE_REVOCATION_REQ = 11;
|
||||
public const int TYPE_REVOCATION_REP = 12;
|
||||
public const int TYPE_CROSS_CERT_REQ = 13;
|
||||
public const int TYPE_CROSS_CERT_REP = 14;
|
||||
public const int TYPE_CA_KEY_UPDATE_ANN = 15;
|
||||
public const int TYPE_CERT_ANN = 16;
|
||||
public const int TYPE_REVOCATION_ANN = 17;
|
||||
public const int TYPE_CRL_ANN = 18;
|
||||
public const int TYPE_CONFIRM = 19;
|
||||
public const int TYPE_NESTED = 20;
|
||||
public const int TYPE_GEN_MSG = 21;
|
||||
public const int TYPE_GEN_REP = 22;
|
||||
public const int TYPE_ERROR = 23;
|
||||
public const int TYPE_CERT_CONFIRM = 24;
|
||||
public const int TYPE_POLL_REQ = 25;
|
||||
public const int TYPE_POLL_REP = 26;
|
||||
|
||||
public static PkiBody GetInstance(object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return null;
|
||||
|
||||
if (obj is PkiBody pkiBody)
|
||||
return pkiBody;
|
||||
|
||||
if (obj is Asn1TaggedObject taggedObject)
|
||||
return new PkiBody(taggedObject);
|
||||
|
||||
throw new ArgumentException("Invalid object: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), nameof(obj));
|
||||
}
|
||||
|
||||
private readonly int m_tagNo;
|
||||
private readonly Asn1Encodable m_body;
|
||||
|
||||
private PkiBody(Asn1TaggedObject taggedObject)
|
||||
{
|
||||
m_tagNo = taggedObject.TagNo;
|
||||
m_body = GetBodyForType(m_tagNo, taggedObject.GetObject());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new PkiBody.
|
||||
* @param type one of the TYPE_* constants
|
||||
* @param content message content
|
||||
*/
|
||||
public PkiBody(int type, Asn1Encodable content)
|
||||
{
|
||||
m_tagNo = type;
|
||||
m_body = GetBodyForType(type, content);
|
||||
}
|
||||
|
||||
private static Asn1Encodable GetBodyForType(int type, Asn1Encodable o)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_INIT_REQ:
|
||||
return CertReqMessages.GetInstance(o);
|
||||
case TYPE_INIT_REP:
|
||||
return CertRepMessage.GetInstance(o);
|
||||
case TYPE_CERT_REQ:
|
||||
return CertReqMessages.GetInstance(o);
|
||||
case TYPE_CERT_REP:
|
||||
return CertRepMessage.GetInstance(o);
|
||||
case TYPE_P10_CERT_REQ:
|
||||
return CertificationRequest.GetInstance(o);
|
||||
case TYPE_POPO_CHALL:
|
||||
return PopoDecKeyChallContent.GetInstance(o);
|
||||
case TYPE_POPO_REP:
|
||||
return PopoDecKeyRespContent.GetInstance(o);
|
||||
case TYPE_KEY_UPDATE_REQ:
|
||||
return CertReqMessages.GetInstance(o);
|
||||
case TYPE_KEY_UPDATE_REP:
|
||||
return CertRepMessage.GetInstance(o);
|
||||
case TYPE_KEY_RECOVERY_REQ:
|
||||
return CertReqMessages.GetInstance(o);
|
||||
case TYPE_KEY_RECOVERY_REP:
|
||||
return KeyRecRepContent.GetInstance(o);
|
||||
case TYPE_REVOCATION_REQ:
|
||||
return RevReqContent.GetInstance(o);
|
||||
case TYPE_REVOCATION_REP:
|
||||
return RevRepContent.GetInstance(o);
|
||||
case TYPE_CROSS_CERT_REQ:
|
||||
return CertReqMessages.GetInstance(o);
|
||||
case TYPE_CROSS_CERT_REP:
|
||||
return CertRepMessage.GetInstance(o);
|
||||
case TYPE_CA_KEY_UPDATE_ANN:
|
||||
return CAKeyUpdAnnContent.GetInstance(o);
|
||||
case TYPE_CERT_ANN:
|
||||
return CmpCertificate.GetInstance(o);
|
||||
case TYPE_REVOCATION_ANN:
|
||||
return RevAnnContent.GetInstance(o);
|
||||
case TYPE_CRL_ANN:
|
||||
return CrlAnnContent.GetInstance(o);
|
||||
case TYPE_CONFIRM:
|
||||
return PkiConfirmContent.GetInstance(o);
|
||||
case TYPE_NESTED:
|
||||
return PkiMessages.GetInstance(o);
|
||||
case TYPE_GEN_MSG:
|
||||
return GenMsgContent.GetInstance(o);
|
||||
case TYPE_GEN_REP:
|
||||
return GenRepContent.GetInstance(o);
|
||||
case TYPE_ERROR:
|
||||
return ErrorMsgContent.GetInstance(o);
|
||||
case TYPE_CERT_CONFIRM:
|
||||
return CertConfirmContent.GetInstance(o);
|
||||
case TYPE_POLL_REQ:
|
||||
return PollReqContent.GetInstance(o);
|
||||
case TYPE_POLL_REP:
|
||||
return PollRepContent.GetInstance(o);
|
||||
default:
|
||||
throw new ArgumentException("unknown tag number: " + type, nameof(type));
|
||||
}
|
||||
}
|
||||
|
||||
public virtual Asn1Encodable Content => m_body;
|
||||
|
||||
public virtual int Type => m_tagNo;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* PkiBody ::= CHOICE { -- message-specific body elements
|
||||
* ir [0] CertReqMessages, --Initialization Request
|
||||
* ip [1] CertRepMessage, --Initialization Response
|
||||
* cr [2] CertReqMessages, --Certification Request
|
||||
* cp [3] CertRepMessage, --Certification Response
|
||||
* p10cr [4] CertificationRequest, --imported from [PKCS10]
|
||||
* popdecc [5] POPODecKeyChallContent, --pop Challenge
|
||||
* popdecr [6] POPODecKeyRespContent, --pop Response
|
||||
* kur [7] CertReqMessages, --Key Update Request
|
||||
* kup [8] CertRepMessage, --Key Update Response
|
||||
* krr [9] CertReqMessages, --Key Recovery Request
|
||||
* krp [10] KeyRecRepContent, --Key Recovery Response
|
||||
* rr [11] RevReqContent, --Revocation Request
|
||||
* rp [12] RevRepContent, --Revocation Response
|
||||
* ccr [13] CertReqMessages, --Cross-Cert. Request
|
||||
* ccp [14] CertRepMessage, --Cross-Cert. Response
|
||||
* ckuann [15] CAKeyUpdAnnContent, --CA Key Update Ann.
|
||||
* cann [16] CertAnnContent, --Certificate Ann.
|
||||
* rann [17] RevAnnContent, --Revocation Ann.
|
||||
* crlann [18] CRLAnnContent, --CRL Announcement
|
||||
* pkiconf [19] PKIConfirmContent, --Confirmation
|
||||
* nested [20] NestedMessageContent, --Nested Message
|
||||
* genm [21] GenMsgContent, --General Message
|
||||
* genp [22] GenRepContent, --General Response
|
||||
* error [23] ErrorMsgContent, --Error Message
|
||||
* certConf [24] CertConfirmContent, --Certificate confirm
|
||||
* pollReq [25] PollReqContent, --Polling request
|
||||
* pollRep [26] PollRepContent --Polling response
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return new DerTaggedObject(true, m_tagNo, m_body);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIBody.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIBody.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 100678a52df8fee4aa9e190c3548f1e6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIBody.cs
|
||||
uploadId: 783279
|
||||
54
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIConfirmContent.cs
vendored
Normal file
54
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIConfirmContent.cs
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
#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.Cmp
|
||||
{
|
||||
/**
|
||||
* PKIConfirmContent ::= NULL
|
||||
*/
|
||||
public class PkiConfirmContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static PkiConfirmContent GetInstance(object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return null;
|
||||
|
||||
if (obj is PkiConfirmContent pkiConfirmContent)
|
||||
return pkiConfirmContent;
|
||||
|
||||
if (obj is Asn1Null asn1Null)
|
||||
return new PkiConfirmContent(asn1Null);
|
||||
|
||||
throw new ArgumentException("Invalid object: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), nameof(obj));
|
||||
}
|
||||
|
||||
private readonly Asn1Null m_val;
|
||||
|
||||
public PkiConfirmContent()
|
||||
: this(DerNull.Instance)
|
||||
{
|
||||
}
|
||||
|
||||
private PkiConfirmContent(Asn1Null val)
|
||||
{
|
||||
m_val = val;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* PkiConfirmContent ::= NULL
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return m_val;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIConfirmContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIConfirmContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ba8173b7bd86d5f4c85e84ad002431b7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIConfirmContent.cs
|
||||
uploadId: 783279
|
||||
100
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIFailureInfo.cs
vendored
Normal file
100
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIFailureInfo.cs
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* <pre>
|
||||
* PKIFailureInfo ::= BIT STRING {
|
||||
* badAlg (0),
|
||||
* -- unrecognized or unsupported Algorithm Identifier
|
||||
* badMessageCheck (1), -- integrity check failed (e.g., signature did not verify)
|
||||
* badRequest (2),
|
||||
* -- transaction not permitted or supported
|
||||
* badTime (3), -- messageTime was not sufficiently close to the system time, as defined by local policy
|
||||
* badCertId (4), -- no certificate could be found matching the provided criteria
|
||||
* badDataFormat (5),
|
||||
* -- the data submitted has the wrong format
|
||||
* wrongAuthority (6), -- the authority indicated in the request is different from the one creating the response token
|
||||
* incorrectData (7), -- the requester's data is incorrect (for notary services)
|
||||
* missingTimeStamp (8), -- when the timestamp is missing but should be there (by policy)
|
||||
* badPOP (9) -- the proof-of-possession failed
|
||||
* certRevoked (10),
|
||||
* certConfirmed (11),
|
||||
* wrongIntegrity (12),
|
||||
* badRecipientNonce (13),
|
||||
* timeNotAvailable (14),
|
||||
* -- the TSA's time source is not available
|
||||
* unacceptedPolicy (15),
|
||||
* -- the requested TSA policy is not supported by the TSA
|
||||
* unacceptedExtension (16),
|
||||
* -- the requested extension is not supported by the TSA
|
||||
* addInfoNotAvailable (17)
|
||||
* -- the additional information requested could not be understood
|
||||
* -- or is not available
|
||||
* badSenderNonce (18),
|
||||
* badCertTemplate (19),
|
||||
* signerNotTrusted (20),
|
||||
* transactionIdInUse (21),
|
||||
* unsupportedVersion (22),
|
||||
* notAuthorized (23),
|
||||
* systemUnavail (24),
|
||||
* systemFailure (25),
|
||||
* -- the request cannot be handled due to system failure
|
||||
* duplicateCertReq (26)
|
||||
* </pre>
|
||||
*/
|
||||
public class PkiFailureInfo
|
||||
: DerBitString
|
||||
{
|
||||
public const int BadAlg = (1 << 7); // unrecognized or unsupported Algorithm Identifier
|
||||
public const int BadMessageCheck = (1 << 6); // integrity check failed (e.g., signature did not verify)
|
||||
public const int BadRequest = (1 << 5);
|
||||
public const int BadTime = (1 << 4); // -- messageTime was not sufficiently close to the system time, as defined by local policy
|
||||
public const int BadCertId = (1 << 3); // no certificate could be found matching the provided criteria
|
||||
public const int BadDataFormat = (1 << 2);
|
||||
public const int WrongAuthority = (1 << 1); // the authority indicated in the request is different from the one creating the response token
|
||||
public const int IncorrectData = 1; // the requester's data is incorrect (for notary services)
|
||||
public const int MissingTimeStamp = (1 << 15); // when the timestamp is missing but should be there (by policy)
|
||||
public const int BadPop = (1 << 14); // the proof-of-possession failed
|
||||
public const int CertRevoked = (1 << 13);
|
||||
public const int CertConfirmed = (1 << 12);
|
||||
public const int WrongIntegrity = (1 << 11);
|
||||
public const int BadRecipientNonce = (1 << 10);
|
||||
public const int TimeNotAvailable = (1 << 9); // the TSA's time source is not available
|
||||
public const int UnacceptedPolicy = (1 << 8); // the requested TSA policy is not supported by the TSA
|
||||
public const int UnacceptedExtension = (1 << 23); //the requested extension is not supported by the TSA
|
||||
public const int AddInfoNotAvailable = (1 << 22); //the additional information requested could not be understood or is not available
|
||||
public const int BadSenderNonce = (1 << 21);
|
||||
public const int BadCertTemplate = (1 << 20);
|
||||
public const int SignerNotTrusted = (1 << 19);
|
||||
public const int TransactionIdInUse = (1 << 18);
|
||||
public const int UnsupportedVersion = (1 << 17);
|
||||
public const int NotAuthorized = (1 << 16);
|
||||
public const int SystemUnavail = (1 << 31);
|
||||
public const int SystemFailure = (1 << 30); //the request cannot be handled due to system failure
|
||||
public const int DuplicateCertReq = (1 << 29);
|
||||
|
||||
/**
|
||||
* Basic constructor.
|
||||
*/
|
||||
public PkiFailureInfo(int info)
|
||||
: base(info)
|
||||
{
|
||||
}
|
||||
|
||||
public PkiFailureInfo(
|
||||
DerBitString info)
|
||||
: base(info.GetBytes(), info.PadBits)
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "PkiFailureInfo: 0x" + this.IntValue.ToString("X");
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIFailureInfo.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIFailureInfo.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad154923d7ccf2747bc9b2de360c755e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIFailureInfo.cs
|
||||
uploadId: 783279
|
||||
89
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIFreeText.cs
vendored
Normal file
89
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIFreeText.cs
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class PkiFreeText
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static PkiFreeText GetInstance(object obj)
|
||||
{
|
||||
if (obj is PkiFreeText pkiFreeText)
|
||||
return pkiFreeText;
|
||||
|
||||
if (obj != null)
|
||||
return new PkiFreeText(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static PkiFreeText GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
|
||||
{
|
||||
return GetInstance(Asn1Sequence.GetInstance(taggedObject, declaredExplicit));
|
||||
}
|
||||
|
||||
internal Asn1Sequence m_strings;
|
||||
|
||||
internal PkiFreeText(Asn1Sequence seq)
|
||||
{
|
||||
foreach (var element in seq)
|
||||
{
|
||||
if (!(element is DerUtf8String))
|
||||
throw new ArgumentException("attempt to insert non UTF8 STRING into PkiFreeText");
|
||||
}
|
||||
|
||||
m_strings = seq;
|
||||
}
|
||||
|
||||
public PkiFreeText(DerUtf8String p)
|
||||
{
|
||||
m_strings = new DerSequence(p);
|
||||
}
|
||||
|
||||
public PkiFreeText(string p)
|
||||
: this(new DerUtf8String(p))
|
||||
{
|
||||
}
|
||||
|
||||
public PkiFreeText(DerUtf8String[] strs)
|
||||
{
|
||||
m_strings = new DerSequence(strs);
|
||||
}
|
||||
|
||||
public PkiFreeText(string[] strs)
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(strs.Length);
|
||||
for (int i = 0; i < strs.Length; i++)
|
||||
{
|
||||
v.Add(new DerUtf8String(strs[i]));
|
||||
}
|
||||
m_strings = new DerSequence(v);
|
||||
}
|
||||
|
||||
public virtual int Count => m_strings.Count;
|
||||
|
||||
/**
|
||||
* Return the UTF8STRING at index.
|
||||
*
|
||||
* @param index index of the string of interest
|
||||
* @return the string at index.
|
||||
*/
|
||||
public DerUtf8String this[int index]
|
||||
{
|
||||
get { return (DerUtf8String)m_strings[index]; }
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* PkiFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String
|
||||
* </pre>
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return m_strings;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIFreeText.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIFreeText.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e77f847664938404cbf3fd462c2af358
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIFreeText.cs
|
||||
uploadId: 783279
|
||||
232
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIHeader.cs
vendored
Normal file
232
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIHeader.cs
vendored
Normal file
@ -0,0 +1,232 @@
|
||||
#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.Cmp
|
||||
{
|
||||
public class PkiHeader
|
||||
: Asn1Encodable
|
||||
{
|
||||
/**
|
||||
* Value for a "null" recipient or sender.
|
||||
*/
|
||||
public static readonly GeneralName NULL_NAME = new GeneralName(X509Name.GetInstance(new DerSequence()));
|
||||
|
||||
public static readonly int CMP_1999 = 1;
|
||||
public static readonly int CMP_2000 = 2;
|
||||
|
||||
private readonly DerInteger pvno;
|
||||
private readonly GeneralName sender;
|
||||
private readonly GeneralName recipient;
|
||||
private readonly Asn1GeneralizedTime messageTime;
|
||||
private readonly AlgorithmIdentifier protectionAlg;
|
||||
private readonly Asn1OctetString senderKID; // KeyIdentifier
|
||||
private readonly Asn1OctetString recipKID; // KeyIdentifier
|
||||
private readonly Asn1OctetString transactionID;
|
||||
private readonly Asn1OctetString senderNonce;
|
||||
private readonly Asn1OctetString recipNonce;
|
||||
private readonly PkiFreeText freeText;
|
||||
private readonly Asn1Sequence generalInfo;
|
||||
|
||||
private PkiHeader(Asn1Sequence seq)
|
||||
{
|
||||
pvno = DerInteger.GetInstance(seq[0]);
|
||||
sender = GeneralName.GetInstance(seq[1]);
|
||||
recipient = GeneralName.GetInstance(seq[2]);
|
||||
|
||||
for (int pos = 3; pos < seq.Count; ++pos)
|
||||
{
|
||||
Asn1TaggedObject tObj = (Asn1TaggedObject)seq[pos];
|
||||
|
||||
switch (tObj.TagNo)
|
||||
{
|
||||
case 0:
|
||||
messageTime = Asn1GeneralizedTime.GetInstance(tObj, true);
|
||||
break;
|
||||
case 1:
|
||||
protectionAlg = AlgorithmIdentifier.GetInstance(tObj, true);
|
||||
break;
|
||||
case 2:
|
||||
senderKID = Asn1OctetString.GetInstance(tObj, true);
|
||||
break;
|
||||
case 3:
|
||||
recipKID = Asn1OctetString.GetInstance(tObj, true);
|
||||
break;
|
||||
case 4:
|
||||
transactionID = Asn1OctetString.GetInstance(tObj, true);
|
||||
break;
|
||||
case 5:
|
||||
senderNonce = Asn1OctetString.GetInstance(tObj, true);
|
||||
break;
|
||||
case 6:
|
||||
recipNonce = Asn1OctetString.GetInstance(tObj, true);
|
||||
break;
|
||||
case 7:
|
||||
freeText = PkiFreeText.GetInstance(tObj, true);
|
||||
break;
|
||||
case 8:
|
||||
generalInfo = Asn1Sequence.GetInstance(tObj, true);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException("unknown tag number: " + tObj.TagNo, nameof(seq));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static PkiHeader GetInstance(object obj)
|
||||
{
|
||||
if (obj is PkiHeader)
|
||||
return (PkiHeader)obj;
|
||||
|
||||
if (obj is Asn1Sequence)
|
||||
return new PkiHeader((Asn1Sequence)obj);
|
||||
|
||||
throw new ArgumentException("Invalid object: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
|
||||
}
|
||||
|
||||
public PkiHeader(
|
||||
int pvno,
|
||||
GeneralName sender,
|
||||
GeneralName recipient)
|
||||
: this(new DerInteger(pvno), sender, recipient)
|
||||
{
|
||||
}
|
||||
|
||||
private PkiHeader(
|
||||
DerInteger pvno,
|
||||
GeneralName sender,
|
||||
GeneralName recipient)
|
||||
{
|
||||
this.pvno = pvno;
|
||||
this.sender = sender;
|
||||
this.recipient = recipient;
|
||||
}
|
||||
|
||||
public virtual DerInteger Pvno
|
||||
{
|
||||
get { return pvno; }
|
||||
}
|
||||
|
||||
public virtual GeneralName Sender
|
||||
{
|
||||
get { return sender; }
|
||||
}
|
||||
|
||||
public virtual GeneralName Recipient
|
||||
{
|
||||
get { return recipient; }
|
||||
}
|
||||
|
||||
public virtual Asn1GeneralizedTime MessageTime
|
||||
{
|
||||
get { return messageTime; }
|
||||
}
|
||||
|
||||
public virtual AlgorithmIdentifier ProtectionAlg
|
||||
{
|
||||
get { return protectionAlg; }
|
||||
}
|
||||
|
||||
public virtual Asn1OctetString SenderKID
|
||||
{
|
||||
get { return senderKID; }
|
||||
}
|
||||
|
||||
public virtual Asn1OctetString RecipKID
|
||||
{
|
||||
get { return recipKID; }
|
||||
}
|
||||
|
||||
public virtual Asn1OctetString TransactionID
|
||||
{
|
||||
get { return transactionID; }
|
||||
}
|
||||
|
||||
public virtual Asn1OctetString SenderNonce
|
||||
{
|
||||
get { return senderNonce; }
|
||||
}
|
||||
|
||||
public virtual Asn1OctetString RecipNonce
|
||||
{
|
||||
get { return recipNonce; }
|
||||
}
|
||||
|
||||
public virtual PkiFreeText FreeText
|
||||
{
|
||||
get { return freeText; }
|
||||
}
|
||||
|
||||
public virtual InfoTypeAndValue[] GetGeneralInfo()
|
||||
{
|
||||
if (generalInfo == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
InfoTypeAndValue[] results = new InfoTypeAndValue[generalInfo.Count];
|
||||
for (int i = 0; i < results.Length; i++)
|
||||
{
|
||||
results[i] = InfoTypeAndValue.GetInstance(generalInfo[i]);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* PkiHeader ::= SEQUENCE {
|
||||
* pvno INTEGER { cmp1999(1), cmp2000(2) },
|
||||
* sender GeneralName,
|
||||
* -- identifies the sender
|
||||
* recipient GeneralName,
|
||||
* -- identifies the intended recipient
|
||||
* messageTime [0] GeneralizedTime OPTIONAL,
|
||||
* -- time of production of this message (used when sender
|
||||
* -- believes that the transport will be "suitable"; i.e.,
|
||||
* -- that the time will still be meaningful upon receipt)
|
||||
* protectionAlg [1] AlgorithmIdentifier OPTIONAL,
|
||||
* -- algorithm used for calculation of protection bits
|
||||
* senderKID [2] KeyIdentifier OPTIONAL,
|
||||
* recipKID [3] KeyIdentifier OPTIONAL,
|
||||
* -- to identify specific keys used for protection
|
||||
* transactionID [4] OCTET STRING OPTIONAL,
|
||||
* -- identifies the transaction; i.e., this will be the same in
|
||||
* -- corresponding request, response, certConf, and PKIConf
|
||||
* -- messages
|
||||
* senderNonce [5] OCTET STRING OPTIONAL,
|
||||
* recipNonce [6] OCTET STRING OPTIONAL,
|
||||
* -- nonces used to provide replay protection, senderNonce
|
||||
* -- is inserted by the creator of this message; recipNonce
|
||||
* -- is a nonce previously inserted in a related message by
|
||||
* -- the intended recipient of this message
|
||||
* freeText [7] PKIFreeText OPTIONAL,
|
||||
* -- this may be used to indicate context-specific instructions
|
||||
* -- (this field is intended for human consumption)
|
||||
* generalInfo [8] SEQUENCE SIZE (1..MAX) OF
|
||||
* InfoTypeAndValue OPTIONAL
|
||||
* -- this may be used to convey context-specific information
|
||||
* -- (this field not primarily intended for human consumption)
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(pvno, sender, recipient);
|
||||
v.AddOptionalTagged(true, 0, messageTime);
|
||||
v.AddOptionalTagged(true, 1, protectionAlg);
|
||||
v.AddOptionalTagged(true, 2, senderKID);
|
||||
v.AddOptionalTagged(true, 3, recipKID);
|
||||
v.AddOptionalTagged(true, 4, transactionID);
|
||||
v.AddOptionalTagged(true, 5, senderNonce);
|
||||
v.AddOptionalTagged(true, 6, recipNonce);
|
||||
v.AddOptionalTagged(true, 7, freeText);
|
||||
v.AddOptionalTagged(true, 8, generalInfo);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIHeader.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIHeader.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9077f3c98ec2b1a49b9754bd175a9c4d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIHeader.cs
|
||||
uploadId: 783279
|
||||
227
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIHeaderBuilder.cs
vendored
Normal file
227
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIHeaderBuilder.cs
vendored
Normal file
@ -0,0 +1,227 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class PkiHeaderBuilder
|
||||
{
|
||||
private DerInteger pvno;
|
||||
private GeneralName sender;
|
||||
private GeneralName recipient;
|
||||
private Asn1GeneralizedTime messageTime;
|
||||
private AlgorithmIdentifier protectionAlg;
|
||||
private Asn1OctetString senderKID; // KeyIdentifier
|
||||
private Asn1OctetString recipKID; // KeyIdentifier
|
||||
private Asn1OctetString transactionID;
|
||||
private Asn1OctetString senderNonce;
|
||||
private Asn1OctetString recipNonce;
|
||||
private PkiFreeText freeText;
|
||||
private Asn1Sequence generalInfo;
|
||||
|
||||
public PkiHeaderBuilder(
|
||||
int pvno,
|
||||
GeneralName sender,
|
||||
GeneralName recipient)
|
||||
: this(new DerInteger(pvno), sender, recipient)
|
||||
{
|
||||
}
|
||||
|
||||
private PkiHeaderBuilder(
|
||||
DerInteger pvno,
|
||||
GeneralName sender,
|
||||
GeneralName recipient)
|
||||
{
|
||||
this.pvno = pvno;
|
||||
this.sender = sender;
|
||||
this.recipient = recipient;
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetMessageTime(Asn1GeneralizedTime time)
|
||||
{
|
||||
messageTime = time;
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetProtectionAlg(AlgorithmIdentifier aid)
|
||||
{
|
||||
protectionAlg = aid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetSenderKID(byte[] kid)
|
||||
{
|
||||
return SetSenderKID(kid == null ? null : new DerOctetString(kid));
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetSenderKID(Asn1OctetString kid)
|
||||
{
|
||||
senderKID = kid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetRecipKID(byte[] kid)
|
||||
{
|
||||
return SetRecipKID(kid == null ? null : new DerOctetString(kid));
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetRecipKID(Asn1OctetString kid)
|
||||
{
|
||||
recipKID = kid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetTransactionID(byte[] tid)
|
||||
{
|
||||
return SetTransactionID(tid == null ? null : new DerOctetString(tid));
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetTransactionID(Asn1OctetString tid)
|
||||
{
|
||||
transactionID = tid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetSenderNonce(byte[] nonce)
|
||||
{
|
||||
return SetSenderNonce(nonce == null ? null : new DerOctetString(nonce));
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetSenderNonce(Asn1OctetString nonce)
|
||||
{
|
||||
senderNonce = nonce;
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetRecipNonce(byte[] nonce)
|
||||
{
|
||||
return SetRecipNonce(nonce == null ? null : new DerOctetString(nonce));
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetRecipNonce(Asn1OctetString nonce)
|
||||
{
|
||||
recipNonce = nonce;
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetFreeText(PkiFreeText text)
|
||||
{
|
||||
freeText = text;
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetGeneralInfo(InfoTypeAndValue genInfo)
|
||||
{
|
||||
return SetGeneralInfo(MakeGeneralInfoSeq(genInfo));
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetGeneralInfo(InfoTypeAndValue[] genInfos)
|
||||
{
|
||||
return SetGeneralInfo(MakeGeneralInfoSeq(genInfos));
|
||||
}
|
||||
|
||||
public virtual PkiHeaderBuilder SetGeneralInfo(Asn1Sequence seqOfInfoTypeAndValue)
|
||||
{
|
||||
generalInfo = seqOfInfoTypeAndValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
private static Asn1Sequence MakeGeneralInfoSeq(
|
||||
InfoTypeAndValue generalInfo)
|
||||
{
|
||||
return new DerSequence(generalInfo);
|
||||
}
|
||||
|
||||
private static Asn1Sequence MakeGeneralInfoSeq(
|
||||
InfoTypeAndValue[] generalInfos)
|
||||
{
|
||||
Asn1Sequence genInfoSeq = null;
|
||||
if (generalInfos != null)
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector();
|
||||
for (int i = 0; i < generalInfos.Length; ++i)
|
||||
{
|
||||
v.Add(generalInfos[i]);
|
||||
}
|
||||
genInfoSeq = new DerSequence(v);
|
||||
}
|
||||
return genInfoSeq;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* PKIHeader ::= SEQUENCE {
|
||||
* pvno INTEGER { cmp1999(1), cmp2000(2) },
|
||||
* sender GeneralName,
|
||||
* -- identifies the sender
|
||||
* recipient GeneralName,
|
||||
* -- identifies the intended recipient
|
||||
* messageTime [0] GeneralizedTime OPTIONAL,
|
||||
* -- time of production of this message (used when sender
|
||||
* -- believes that the transport will be "suitable"; i.e.,
|
||||
* -- that the time will still be meaningful upon receipt)
|
||||
* protectionAlg [1] AlgorithmIdentifier OPTIONAL,
|
||||
* -- algorithm used for calculation of protection bits
|
||||
* senderKID [2] KeyIdentifier OPTIONAL,
|
||||
* recipKID [3] KeyIdentifier OPTIONAL,
|
||||
* -- to identify specific keys used for protection
|
||||
* transactionID [4] OCTET STRING OPTIONAL,
|
||||
* -- identifies the transaction; i.e., this will be the same in
|
||||
* -- corresponding request, response, certConf, and PKIConf
|
||||
* -- messages
|
||||
* senderNonce [5] OCTET STRING OPTIONAL,
|
||||
* recipNonce [6] OCTET STRING OPTIONAL,
|
||||
* -- nonces used to provide replay protection, senderNonce
|
||||
* -- is inserted by the creator of this message; recipNonce
|
||||
* -- is a nonce previously inserted in a related message by
|
||||
* -- the intended recipient of this message
|
||||
* freeText [7] PKIFreeText OPTIONAL,
|
||||
* -- this may be used to indicate context-specific instructions
|
||||
* -- (this field is intended for human consumption)
|
||||
* generalInfo [8] SEQUENCE SIZE (1..MAX) OF
|
||||
* InfoTypeAndValue OPTIONAL
|
||||
* -- this may be used to convey context-specific information
|
||||
* -- (this field not primarily intended for human consumption)
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public virtual PkiHeader Build()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(pvno, sender, recipient);
|
||||
AddOptional(v, 0, messageTime);
|
||||
AddOptional(v, 1, protectionAlg);
|
||||
AddOptional(v, 2, senderKID);
|
||||
AddOptional(v, 3, recipKID);
|
||||
AddOptional(v, 4, transactionID);
|
||||
AddOptional(v, 5, senderNonce);
|
||||
AddOptional(v, 6, recipNonce);
|
||||
AddOptional(v, 7, freeText);
|
||||
AddOptional(v, 8, generalInfo);
|
||||
|
||||
messageTime = null;
|
||||
protectionAlg = null;
|
||||
senderKID = null;
|
||||
recipKID = null;
|
||||
transactionID = null;
|
||||
senderNonce = null;
|
||||
recipNonce = null;
|
||||
freeText = null;
|
||||
generalInfo = null;
|
||||
|
||||
return PkiHeader.GetInstance(new DerSequence(v));
|
||||
}
|
||||
|
||||
private void AddOptional(Asn1EncodableVector v, int tagNo, Asn1Encodable obj)
|
||||
{
|
||||
if (obj != null)
|
||||
{
|
||||
v.Add(new DerTaggedObject(true, tagNo, obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIHeaderBuilder.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIHeaderBuilder.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a85274fc962a4eb40b0193f5d7ff5ccb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIHeaderBuilder.cs
|
||||
uploadId: 783279
|
||||
134
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIMessage.cs
vendored
Normal file
134
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIMessage.cs
vendored
Normal file
@ -0,0 +1,134 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class PkiMessage
|
||||
: Asn1Encodable
|
||||
{
|
||||
private readonly PkiHeader header;
|
||||
private readonly PkiBody body;
|
||||
private readonly DerBitString protection;
|
||||
private readonly Asn1Sequence extraCerts;
|
||||
|
||||
private PkiMessage(Asn1Sequence seq)
|
||||
{
|
||||
header = PkiHeader.GetInstance(seq[0]);
|
||||
body = PkiBody.GetInstance(seq[1]);
|
||||
|
||||
for (int pos = 2; pos < seq.Count; ++pos)
|
||||
{
|
||||
Asn1TaggedObject tObj = (Asn1TaggedObject)seq[pos].ToAsn1Object();
|
||||
|
||||
if (tObj.TagNo == 0)
|
||||
{
|
||||
protection = DerBitString.GetInstance(tObj, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
extraCerts = Asn1Sequence.GetInstance(tObj, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static PkiMessage GetInstance(object obj)
|
||||
{
|
||||
if (obj is PkiMessage)
|
||||
return (PkiMessage)obj;
|
||||
|
||||
if (obj != null)
|
||||
return new PkiMessage(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new PkiMessage.
|
||||
*
|
||||
* @param header message header
|
||||
* @param body message body
|
||||
* @param protection message protection (may be null)
|
||||
* @param extraCerts extra certificates (may be null)
|
||||
*/
|
||||
public PkiMessage(
|
||||
PkiHeader header,
|
||||
PkiBody body,
|
||||
DerBitString protection,
|
||||
CmpCertificate[] extraCerts)
|
||||
{
|
||||
this.header = header;
|
||||
this.body = body;
|
||||
this.protection = protection;
|
||||
if (extraCerts != null)
|
||||
{
|
||||
this.extraCerts = new DerSequence(extraCerts);
|
||||
}
|
||||
}
|
||||
|
||||
public PkiMessage(
|
||||
PkiHeader header,
|
||||
PkiBody body,
|
||||
DerBitString protection)
|
||||
: this(header, body, protection, null)
|
||||
{
|
||||
}
|
||||
|
||||
public PkiMessage(
|
||||
PkiHeader header,
|
||||
PkiBody body)
|
||||
: this(header, body, null, null)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual PkiHeader Header
|
||||
{
|
||||
get { return header; }
|
||||
}
|
||||
|
||||
public virtual PkiBody Body
|
||||
{
|
||||
get { return body; }
|
||||
}
|
||||
|
||||
public virtual DerBitString Protection
|
||||
{
|
||||
get { return protection; }
|
||||
}
|
||||
|
||||
public virtual CmpCertificate[] GetExtraCerts()
|
||||
{
|
||||
if (extraCerts == null)
|
||||
return null;
|
||||
|
||||
CmpCertificate[] results = new CmpCertificate[extraCerts.Count];
|
||||
for (int i = 0; i < results.Length; ++i)
|
||||
{
|
||||
results[i] = CmpCertificate.GetInstance(extraCerts[i]);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* PkiMessage ::= SEQUENCE {
|
||||
* header PKIHeader,
|
||||
* body PKIBody,
|
||||
* protection [0] PKIProtection OPTIONAL,
|
||||
* extraCerts [1] SEQUENCE SIZE (1..MAX) OF CMPCertificate
|
||||
* OPTIONAL
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(header, body);
|
||||
v.AddOptionalTagged(true, 0, protection);
|
||||
v.AddOptionalTagged(true, 1, extraCerts);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIMessage.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIMessage.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c766bc81d0a58f04dbd305ed7364de06
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIMessage.cs
|
||||
uploadId: 783279
|
||||
58
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIMessages.cs
vendored
Normal file
58
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIMessages.cs
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
#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.Cmp
|
||||
{
|
||||
public class PkiMessages
|
||||
: Asn1Encodable
|
||||
{
|
||||
private Asn1Sequence content;
|
||||
|
||||
internal PkiMessages(Asn1Sequence seq)
|
||||
{
|
||||
content = seq;
|
||||
}
|
||||
|
||||
public static PkiMessages GetInstance(object obj)
|
||||
{
|
||||
if (obj is PkiMessages)
|
||||
return (PkiMessages)obj;
|
||||
|
||||
if (obj is Asn1Sequence)
|
||||
return new PkiMessages((Asn1Sequence)obj);
|
||||
|
||||
throw new ArgumentException("Invalid object: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
|
||||
}
|
||||
|
||||
public PkiMessages(params PkiMessage[] msgs)
|
||||
{
|
||||
content = new DerSequence(msgs);
|
||||
}
|
||||
|
||||
public virtual PkiMessage[] ToPkiMessageArray()
|
||||
{
|
||||
PkiMessage[] result = new PkiMessage[content.Count];
|
||||
for (int i = 0; i != result.Length; ++i)
|
||||
{
|
||||
result[i] = PkiMessage.GetInstance(content[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* PkiMessages ::= SEQUENCE SIZE (1..MAX) OF PkiMessage
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return content;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIMessages.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIMessages.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6aa6d080265a8284389d7b43a19e8fea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIMessages.cs
|
||||
uploadId: 783279
|
||||
67
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIStatus.cs
vendored
Normal file
67
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIStatus.cs
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
#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.Cmp
|
||||
{
|
||||
public enum PkiStatus
|
||||
{
|
||||
Granted = 0,
|
||||
GrantedWithMods = 1,
|
||||
Rejection = 2,
|
||||
Waiting = 3,
|
||||
RevocationWarning = 4,
|
||||
RevocationNotification = 5,
|
||||
KeyUpdateWarning = 6,
|
||||
}
|
||||
|
||||
public class PkiStatusEncodable
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static readonly PkiStatusEncodable granted = new PkiStatusEncodable(PkiStatus.Granted);
|
||||
public static readonly PkiStatusEncodable grantedWithMods = new PkiStatusEncodable(PkiStatus.GrantedWithMods);
|
||||
public static readonly PkiStatusEncodable rejection = new PkiStatusEncodable(PkiStatus.Rejection);
|
||||
public static readonly PkiStatusEncodable waiting = new PkiStatusEncodable(PkiStatus.Waiting);
|
||||
public static readonly PkiStatusEncodable revocationWarning = new PkiStatusEncodable(PkiStatus.RevocationWarning);
|
||||
public static readonly PkiStatusEncodable revocationNotification = new PkiStatusEncodable(PkiStatus.RevocationNotification);
|
||||
public static readonly PkiStatusEncodable keyUpdateWaiting = new PkiStatusEncodable(PkiStatus.KeyUpdateWarning);
|
||||
|
||||
private readonly DerInteger status;
|
||||
|
||||
private PkiStatusEncodable(PkiStatus status)
|
||||
: this(new DerInteger((int)status))
|
||||
{
|
||||
}
|
||||
|
||||
private PkiStatusEncodable(DerInteger status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public static PkiStatusEncodable GetInstance(object obj)
|
||||
{
|
||||
if (obj is PkiStatusEncodable)
|
||||
return (PkiStatusEncodable)obj;
|
||||
|
||||
if (obj is DerInteger)
|
||||
return new PkiStatusEncodable((DerInteger)obj);
|
||||
|
||||
throw new ArgumentException("Invalid object: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
|
||||
}
|
||||
|
||||
public virtual BigInteger Value
|
||||
{
|
||||
get { return status.Value; }
|
||||
}
|
||||
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIStatus.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIStatus.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ab11c44e454a734abe83489016d91ce
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIStatus.cs
|
||||
uploadId: 783279
|
||||
160
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIStatusInfo.cs
vendored
Normal file
160
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIStatusInfo.cs
vendored
Normal file
@ -0,0 +1,160 @@
|
||||
#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.Cmp
|
||||
{
|
||||
public class PkiStatusInfo
|
||||
: Asn1Encodable
|
||||
{
|
||||
DerInteger status;
|
||||
PkiFreeText statusString;
|
||||
DerBitString failInfo;
|
||||
|
||||
public static PkiStatusInfo GetInstance(
|
||||
Asn1TaggedObject obj,
|
||||
bool isExplicit)
|
||||
{
|
||||
return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit));
|
||||
}
|
||||
|
||||
public static PkiStatusInfo GetInstance(
|
||||
object obj)
|
||||
{
|
||||
if (obj is PkiStatusInfo)
|
||||
{
|
||||
return (PkiStatusInfo)obj;
|
||||
}
|
||||
else if (obj is Asn1Sequence)
|
||||
{
|
||||
return new PkiStatusInfo((Asn1Sequence)obj);
|
||||
}
|
||||
|
||||
throw new ArgumentException("Unknown object in factory: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
|
||||
}
|
||||
|
||||
public PkiStatusInfo(
|
||||
Asn1Sequence seq)
|
||||
{
|
||||
this.status = DerInteger.GetInstance(seq[0]);
|
||||
|
||||
this.statusString = null;
|
||||
this.failInfo = null;
|
||||
|
||||
if (seq.Count > 2)
|
||||
{
|
||||
this.statusString = PkiFreeText.GetInstance(seq[1]);
|
||||
this.failInfo = DerBitString.GetInstance(seq[2]);
|
||||
}
|
||||
else if (seq.Count > 1)
|
||||
{
|
||||
object obj = seq[1];
|
||||
if (obj is DerBitString)
|
||||
{
|
||||
this.failInfo = DerBitString.GetInstance(obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.statusString = PkiFreeText.GetInstance(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param status
|
||||
*/
|
||||
public PkiStatusInfo(int status)
|
||||
{
|
||||
this.status = new DerInteger(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param status
|
||||
* @param statusString
|
||||
*/
|
||||
public PkiStatusInfo(
|
||||
int status,
|
||||
PkiFreeText statusString)
|
||||
{
|
||||
this.status = new DerInteger(status);
|
||||
this.statusString = statusString;
|
||||
}
|
||||
|
||||
public PkiStatusInfo(
|
||||
int status,
|
||||
PkiFreeText statusString,
|
||||
PkiFailureInfo failInfo)
|
||||
{
|
||||
this.status = new DerInteger(status);
|
||||
this.statusString = statusString;
|
||||
this.failInfo = failInfo;
|
||||
}
|
||||
|
||||
public BigInteger Status
|
||||
{
|
||||
get
|
||||
{
|
||||
return status.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public PkiFreeText StatusString
|
||||
{
|
||||
get
|
||||
{
|
||||
return statusString;
|
||||
}
|
||||
}
|
||||
|
||||
public DerBitString FailInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return failInfo;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* PkiStatusInfo ::= SEQUENCE {
|
||||
* status PKIStatus, (INTEGER)
|
||||
* statusString PkiFreeText OPTIONAL,
|
||||
* failInfo PkiFailureInfo OPTIONAL (BIT STRING)
|
||||
* }
|
||||
*
|
||||
* PKIStatus:
|
||||
* granted (0), -- you got exactly what you asked for
|
||||
* grantedWithMods (1), -- you got something like what you asked for
|
||||
* rejection (2), -- you don't get it, more information elsewhere in the message
|
||||
* waiting (3), -- the request body part has not yet been processed, expect to hear more later
|
||||
* revocationWarning (4), -- this message contains a warning that a revocation is imminent
|
||||
* revocationNotification (5), -- notification that a revocation has occurred
|
||||
* keyUpdateWarning (6) -- update already done for the oldCertId specified in CertReqMsg
|
||||
*
|
||||
* PkiFailureInfo:
|
||||
* badAlg (0), -- unrecognized or unsupported Algorithm Identifier
|
||||
* badMessageCheck (1), -- integrity check failed (e.g., signature did not verify)
|
||||
* badRequest (2), -- transaction not permitted or supported
|
||||
* badTime (3), -- messageTime was not sufficiently close to the system time, as defined by local policy
|
||||
* badCertId (4), -- no certificate could be found matching the provided criteria
|
||||
* badDataFormat (5), -- the data submitted has the wrong format
|
||||
* wrongAuthority (6), -- the authority indicated in the request is different from the one creating the response token
|
||||
* incorrectData (7), -- the requester's data is incorrect (for notary services)
|
||||
* missingTimeStamp (8), -- when the timestamp is missing but should be there (by policy)
|
||||
* badPOP (9) -- the proof-of-possession failed
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(status);
|
||||
v.AddOptional(statusString, failInfo);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIStatusInfo.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIStatusInfo.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e920049330b4c543a988929e11dada6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PKIStatusInfo.cs
|
||||
uploadId: 783279
|
||||
102
Runtime/3rdParty/BouncyCastle/asn1/cmp/PbmParameter.cs
vendored
Normal file
102
Runtime/3rdParty/BouncyCastle/asn1/cmp/PbmParameter.cs
vendored
Normal file
@ -0,0 +1,102 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* PBMParameter ::= SEQUENCE {
|
||||
* salt OCTET STRING,
|
||||
* -- note: implementations MAY wish to limit acceptable sizes
|
||||
* -- of this string to values appropriate for their environment
|
||||
* -- in order to reduce the risk of denial-of-service attacks
|
||||
* owf AlgorithmIdentifier,
|
||||
* -- AlgId for a One-Way Function (SHA-1 recommended)
|
||||
* iterationCount INTEGER,
|
||||
* -- number of times the OWF is applied
|
||||
* -- note: implementations MAY wish to limit acceptable sizes
|
||||
* -- of this integer to values appropriate for their environment
|
||||
* -- in order to reduce the risk of denial-of-service attacks
|
||||
* mac AlgorithmIdentifier
|
||||
* -- the MAC AlgId (e.g., DES-MAC, Triple-DES-MAC [PKCS11],
|
||||
* } -- or HMAC [RFC2104, RFC2202])
|
||||
*/
|
||||
public class PbmParameter
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static PbmParameter GetInstance(object obj)
|
||||
{
|
||||
if (obj is PbmParameter pbmParameter)
|
||||
return pbmParameter;
|
||||
|
||||
if (obj != null)
|
||||
return new PbmParameter(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly Asn1OctetString m_salt;
|
||||
private readonly AlgorithmIdentifier m_owf;
|
||||
private readonly DerInteger m_iterationCount;
|
||||
private readonly AlgorithmIdentifier m_mac;
|
||||
|
||||
private PbmParameter(Asn1Sequence seq)
|
||||
{
|
||||
m_salt = Asn1OctetString.GetInstance(seq[0]);
|
||||
m_owf = AlgorithmIdentifier.GetInstance(seq[1]);
|
||||
m_iterationCount = DerInteger.GetInstance(seq[2]);
|
||||
m_mac = AlgorithmIdentifier.GetInstance(seq[3]);
|
||||
}
|
||||
|
||||
public PbmParameter(byte[] salt, AlgorithmIdentifier owf, int iterationCount, AlgorithmIdentifier mac)
|
||||
: this(new DerOctetString(salt), owf, new DerInteger(iterationCount), mac)
|
||||
{
|
||||
}
|
||||
|
||||
public PbmParameter(Asn1OctetString salt, AlgorithmIdentifier owf, DerInteger iterationCount,
|
||||
AlgorithmIdentifier mac)
|
||||
{
|
||||
m_salt = salt;
|
||||
m_owf = owf;
|
||||
m_iterationCount = iterationCount;
|
||||
m_mac = mac;
|
||||
}
|
||||
|
||||
public virtual DerInteger IterationCount => m_iterationCount;
|
||||
|
||||
public virtual AlgorithmIdentifier Mac => m_mac;
|
||||
|
||||
public virtual AlgorithmIdentifier Owf => m_owf;
|
||||
|
||||
public virtual Asn1OctetString Salt => m_salt;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* PbmParameter ::= SEQUENCE {
|
||||
* salt OCTET STRING,
|
||||
* -- note: implementations MAY wish to limit acceptable sizes
|
||||
* -- of this string to values appropriate for their environment
|
||||
* -- in order to reduce the risk of denial-of-service attacks
|
||||
* owf AlgorithmIdentifier,
|
||||
* -- AlgId for a One-Way Function (SHA-1 recommended)
|
||||
* iterationCount INTEGER,
|
||||
* -- number of times the OWF is applied
|
||||
* -- note: implementations MAY wish to limit acceptable sizes
|
||||
* -- of this integer to values appropriate for their environment
|
||||
* -- in order to reduce the risk of denial-of-service attacks
|
||||
* mac AlgorithmIdentifier
|
||||
* -- the MAC AlgId (e.g., DES-MAC, Triple-DES-MAC [PKCS11],
|
||||
* } -- or HMAC [RFC2104, RFC2202])
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return new DerSequence(m_salt, m_owf, m_iterationCount, m_mac);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PbmParameter.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PbmParameter.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d820fb493c2e3b448eea9f6935804a0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PbmParameter.cs
|
||||
uploadId: 783279
|
||||
100
Runtime/3rdParty/BouncyCastle/asn1/cmp/PollRepContent.cs
vendored
Normal file
100
Runtime/3rdParty/BouncyCastle/asn1/cmp/PollRepContent.cs
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* PollRepContent ::= SEQUENCE OF SEQUENCE {
|
||||
* certReqId INTEGER,
|
||||
* checkAfter INTEGER, -- time in seconds
|
||||
* reason PKIFreeText OPTIONAL }
|
||||
*/
|
||||
public class PollRepContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static PollRepContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is PollRepContent pollRepContent)
|
||||
return pollRepContent;
|
||||
|
||||
if (obj != null)
|
||||
return new PollRepContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly DerInteger[] m_certReqID;
|
||||
private readonly DerInteger[] m_checkAfter;
|
||||
private readonly PkiFreeText[] m_reason;
|
||||
|
||||
private PollRepContent(Asn1Sequence seq)
|
||||
{
|
||||
int count = seq.Count;
|
||||
m_certReqID = new DerInteger[count];
|
||||
m_checkAfter = new DerInteger[count];
|
||||
m_reason = new PkiFreeText[count];
|
||||
|
||||
for (int i = 0; i != count; i++)
|
||||
{
|
||||
Asn1Sequence s = Asn1Sequence.GetInstance(seq[i]);
|
||||
|
||||
m_certReqID[i] = DerInteger.GetInstance(s[0]);
|
||||
m_checkAfter[i] = DerInteger.GetInstance(s[1]);
|
||||
|
||||
if (s.Count > 2)
|
||||
{
|
||||
m_reason[i] = PkiFreeText.GetInstance(s[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public PollRepContent(DerInteger certReqID, DerInteger checkAfter)
|
||||
: this(certReqID, checkAfter, null)
|
||||
{
|
||||
}
|
||||
|
||||
public PollRepContent(DerInteger certReqID, DerInteger checkAfter, PkiFreeText reason)
|
||||
{
|
||||
m_certReqID = new DerInteger[1]{ certReqID };
|
||||
m_checkAfter = new DerInteger[1]{ checkAfter };
|
||||
m_reason = new PkiFreeText[1]{ reason };
|
||||
}
|
||||
|
||||
public virtual int Count => m_certReqID.Length;
|
||||
|
||||
public virtual DerInteger GetCertReqID(int index) => m_certReqID[index];
|
||||
|
||||
public virtual DerInteger GetCheckAfter(int index) => m_checkAfter[index];
|
||||
|
||||
public virtual PkiFreeText GetReason(int index) => m_reason[index];
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* PollRepContent ::= SEQUENCE OF SEQUENCE {
|
||||
* certReqId INTEGER,
|
||||
* checkAfter INTEGER, -- time in seconds
|
||||
* reason PKIFreeText OPTIONAL
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector outer = new Asn1EncodableVector(m_certReqID.Length);
|
||||
|
||||
for (int i = 0; i != m_certReqID.Length; i++)
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(3);
|
||||
|
||||
v.Add(m_certReqID[i]);
|
||||
v.Add(m_checkAfter[i]);
|
||||
v.AddOptional(m_reason[i]);
|
||||
|
||||
outer.Add(new DerSequence(v));
|
||||
}
|
||||
|
||||
return new DerSequence(outer);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PollRepContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PollRepContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d4c7c5d740ed224588b9122ba4db074
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PollRepContent.cs
|
||||
uploadId: 783279
|
||||
134
Runtime/3rdParty/BouncyCastle/asn1/cmp/PollReqContent.cs
vendored
Normal file
134
Runtime/3rdParty/BouncyCastle/asn1/cmp/PollReqContent.cs
vendored
Normal file
@ -0,0 +1,134 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class PollReqContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static PollReqContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is PollReqContent pollReqContent)
|
||||
return pollReqContent;
|
||||
|
||||
if (obj != null)
|
||||
return new PollReqContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly Asn1Sequence m_content;
|
||||
|
||||
private PollReqContent(Asn1Sequence seq)
|
||||
{
|
||||
m_content = seq;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a pollReqContent for a single certReqId.
|
||||
*
|
||||
* @param certReqId the certificate request ID.
|
||||
*/
|
||||
public PollReqContent(DerInteger certReqId)
|
||||
: this(new DerSequence(new DerSequence(certReqId)))
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a pollReqContent for a multiple certReqIds.
|
||||
*
|
||||
* @param certReqIds the certificate request IDs.
|
||||
*/
|
||||
public PollReqContent(DerInteger[] certReqIds)
|
||||
: this(new DerSequence(IntsToSequence(certReqIds)))
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a pollReqContent for a single certReqId.
|
||||
*
|
||||
* @param certReqId the certificate request ID.
|
||||
*/
|
||||
public PollReqContent(BigInteger certReqId)
|
||||
: this(new DerInteger(certReqId))
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a pollReqContent for a multiple certReqIds.
|
||||
*
|
||||
* @param certReqIds the certificate request IDs.
|
||||
*/
|
||||
public PollReqContent(BigInteger[] certReqIds)
|
||||
: this(IntsToAsn1(certReqIds))
|
||||
{
|
||||
}
|
||||
|
||||
public virtual DerInteger[][] GetCertReqIDs()
|
||||
{
|
||||
DerInteger[][] result = new DerInteger[m_content.Count][];
|
||||
for (int i = 0; i != result.Length; ++i)
|
||||
{
|
||||
result[i] = SequenceToDerIntegerArray((Asn1Sequence)m_content[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual BigInteger[] GetCertReqIDValues()
|
||||
{
|
||||
BigInteger[] result = new BigInteger[m_content.Count];
|
||||
|
||||
for (int i = 0; i != result.Length; i++)
|
||||
{
|
||||
result[i] = DerInteger.GetInstance(Asn1Sequence.GetInstance(m_content[i])[0]).Value;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* PollReqContent ::= SEQUENCE OF SEQUENCE {
|
||||
* certReqId INTEGER
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return m_content;
|
||||
}
|
||||
|
||||
private static DerInteger[] SequenceToDerIntegerArray(Asn1Sequence seq)
|
||||
{
|
||||
return seq.MapElements(DerInteger.GetInstance);
|
||||
}
|
||||
|
||||
private static DerSequence[] IntsToSequence(DerInteger[] ids)
|
||||
{
|
||||
DerSequence[] result = new DerSequence[ids.Length];
|
||||
|
||||
for (int i = 0; i != result.Length; i++)
|
||||
{
|
||||
result[i] = new DerSequence(ids[i]);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static DerInteger[] IntsToAsn1(BigInteger[] ids)
|
||||
{
|
||||
DerInteger[] result = new DerInteger[ids.Length];
|
||||
|
||||
for (int i = 0; i != result.Length; i++)
|
||||
{
|
||||
result[i] = new DerInteger(ids[i]);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PollReqContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PollReqContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89db50e925544cc4bb8035575757618a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PollReqContent.cs
|
||||
uploadId: 783279
|
||||
46
Runtime/3rdParty/BouncyCastle/asn1/cmp/PopoDecKeyChallContent.cs
vendored
Normal file
46
Runtime/3rdParty/BouncyCastle/asn1/cmp/PopoDecKeyChallContent.cs
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class PopoDecKeyChallContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static PopoDecKeyChallContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is PopoDecKeyChallContent popoDecKeyChallContent)
|
||||
return popoDecKeyChallContent;
|
||||
|
||||
if (obj != null)
|
||||
return new PopoDecKeyChallContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly Asn1Sequence m_content;
|
||||
|
||||
private PopoDecKeyChallContent(Asn1Sequence seq)
|
||||
{
|
||||
m_content = seq;
|
||||
}
|
||||
|
||||
public virtual Challenge[] ToChallengeArray()
|
||||
{
|
||||
return m_content.MapElements(Challenge.GetInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* PopoDecKeyChallContent ::= SEQUENCE OF Challenge
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return m_content;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PopoDecKeyChallContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PopoDecKeyChallContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca6e2dbcd0353db4e9e07fab689b6db0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PopoDecKeyChallContent.cs
|
||||
uploadId: 783279
|
||||
44
Runtime/3rdParty/BouncyCastle/asn1/cmp/PopoDecKeyRespContent.cs
vendored
Normal file
44
Runtime/3rdParty/BouncyCastle/asn1/cmp/PopoDecKeyRespContent.cs
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class PopoDecKeyRespContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static PopoDecKeyRespContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is PopoDecKeyRespContent popoDecKeyRespContent)
|
||||
return popoDecKeyRespContent;
|
||||
|
||||
if (obj != null)
|
||||
return new PopoDecKeyRespContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly Asn1Sequence m_content;
|
||||
|
||||
private PopoDecKeyRespContent(Asn1Sequence seq)
|
||||
{
|
||||
m_content = seq;
|
||||
}
|
||||
|
||||
public virtual DerInteger[] ToIntegerArray()
|
||||
{
|
||||
return m_content.MapElements(DerInteger.GetInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* PopoDecKeyRespContent ::= SEQUENCE OF INTEGER
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return m_content;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PopoDecKeyRespContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/PopoDecKeyRespContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 285540a2dd3350b4dba1bb41d57b1f9b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/PopoDecKeyRespContent.cs
|
||||
uploadId: 783279
|
||||
54
Runtime/3rdParty/BouncyCastle/asn1/cmp/ProtectedPart.cs
vendored
Normal file
54
Runtime/3rdParty/BouncyCastle/asn1/cmp/ProtectedPart.cs
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class ProtectedPart
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static ProtectedPart GetInstance(object obj)
|
||||
{
|
||||
if (obj is ProtectedPart protectedPart)
|
||||
return protectedPart;
|
||||
|
||||
if (obj != null)
|
||||
return new ProtectedPart(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly PkiHeader m_header;
|
||||
private readonly PkiBody m_body;
|
||||
|
||||
private ProtectedPart(Asn1Sequence seq)
|
||||
{
|
||||
m_header = PkiHeader.GetInstance(seq[0]);
|
||||
m_body = PkiBody.GetInstance(seq[1]);
|
||||
}
|
||||
|
||||
public ProtectedPart(PkiHeader header, PkiBody body)
|
||||
{
|
||||
m_header = header;
|
||||
m_body = body;
|
||||
}
|
||||
|
||||
public virtual PkiHeader Header => m_header;
|
||||
|
||||
public virtual PkiBody Body => m_body;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* ProtectedPart ::= SEQUENCE {
|
||||
* header PKIHeader,
|
||||
* body PKIBody
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return new DerSequence(m_header, m_body);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/ProtectedPart.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/ProtectedPart.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79565afff7b32cf498e67edf130c2fa1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/ProtectedPart.cs
|
||||
uploadId: 783279
|
||||
89
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevAnnContent.cs
vendored
Normal file
89
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevAnnContent.cs
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class RevAnnContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static RevAnnContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is RevAnnContent revAnnContent)
|
||||
return revAnnContent;
|
||||
|
||||
if (obj != null)
|
||||
return new RevAnnContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly PkiStatusEncodable m_status;
|
||||
private readonly CertId m_certID;
|
||||
private readonly Asn1GeneralizedTime m_willBeRevokedAt;
|
||||
private readonly Asn1GeneralizedTime m_badSinceDate;
|
||||
private readonly X509Extensions m_crlDetails;
|
||||
|
||||
public RevAnnContent(PkiStatusEncodable status, CertId certID, Asn1GeneralizedTime willBeRevokedAt,
|
||||
Asn1GeneralizedTime badSinceDate)
|
||||
: this(status, certID, willBeRevokedAt, badSinceDate, null)
|
||||
{
|
||||
}
|
||||
|
||||
public RevAnnContent(PkiStatusEncodable status, CertId certID, Asn1GeneralizedTime willBeRevokedAt,
|
||||
Asn1GeneralizedTime badSinceDate, X509Extensions crlDetails)
|
||||
{
|
||||
m_status = status;
|
||||
m_certID = certID;
|
||||
m_willBeRevokedAt = willBeRevokedAt;
|
||||
m_badSinceDate = badSinceDate;
|
||||
m_crlDetails = crlDetails;
|
||||
}
|
||||
|
||||
private RevAnnContent(Asn1Sequence seq)
|
||||
{
|
||||
m_status = PkiStatusEncodable.GetInstance(seq[0]);
|
||||
m_certID = CertId.GetInstance(seq[1]);
|
||||
m_willBeRevokedAt = Asn1GeneralizedTime.GetInstance(seq[2]);
|
||||
m_badSinceDate = Asn1GeneralizedTime.GetInstance(seq[3]);
|
||||
|
||||
if (seq.Count > 4)
|
||||
{
|
||||
m_crlDetails = X509Extensions.GetInstance(seq[4]);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual PkiStatusEncodable Status => m_status;
|
||||
|
||||
public virtual CertId CertID => m_certID;
|
||||
|
||||
public virtual Asn1GeneralizedTime WillBeRevokedAt => m_willBeRevokedAt;
|
||||
|
||||
public virtual Asn1GeneralizedTime BadSinceDate => m_badSinceDate;
|
||||
|
||||
public virtual X509Extensions CrlDetails => m_crlDetails;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* RevAnnContent ::= SEQUENCE {
|
||||
* status PKIStatus,
|
||||
* certId CertId,
|
||||
* willBeRevokedAt GeneralizedTime,
|
||||
* badSinceDate GeneralizedTime,
|
||||
* crlDetails Extensions OPTIONAL
|
||||
* -- extra CRL details (e.g., crl number, reason, location, etc.)
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(m_status, m_certID, m_willBeRevokedAt, m_badSinceDate);
|
||||
v.AddOptional(m_crlDetails);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevAnnContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevAnnContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec0ea9c18865c29439dc8cb75ed463ea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/RevAnnContent.cs
|
||||
uploadId: 783279
|
||||
84
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevDetails.cs
vendored
Normal file
84
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevDetails.cs
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* <pre>
|
||||
* RevDetails ::= SEQUENCE {
|
||||
* certDetails CertTemplate,
|
||||
* -- allows requester to specify as much as they can about
|
||||
* -- the cert. for which revocation is requested
|
||||
* -- (e.g., for cases in which serialNumber is not available)
|
||||
* crlEntryDetails Extensions OPTIONAL
|
||||
* -- requested crlEntryExtensions
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public class RevDetails
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static RevDetails GetInstance(object obj)
|
||||
{
|
||||
if (obj is RevDetails revDetails)
|
||||
return revDetails;
|
||||
|
||||
if (obj != null)
|
||||
return new RevDetails(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly CertTemplate m_certDetails;
|
||||
private readonly X509Extensions m_crlEntryDetails;
|
||||
|
||||
private RevDetails(Asn1Sequence seq)
|
||||
{
|
||||
m_certDetails = CertTemplate.GetInstance(seq[0]);
|
||||
|
||||
if (seq.Count > 1)
|
||||
{
|
||||
m_crlEntryDetails = X509Extensions.GetInstance(seq[1]);
|
||||
}
|
||||
}
|
||||
|
||||
public RevDetails(CertTemplate certDetails)
|
||||
: this(certDetails, null)
|
||||
{
|
||||
}
|
||||
|
||||
public RevDetails(CertTemplate certDetails, X509Extensions crlEntryDetails)
|
||||
{
|
||||
m_certDetails = certDetails;
|
||||
m_crlEntryDetails = crlEntryDetails;
|
||||
}
|
||||
|
||||
public virtual CertTemplate CertDetails => m_certDetails;
|
||||
|
||||
public virtual X509Extensions CrlEntryDetails => m_crlEntryDetails;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* RevDetails ::= SEQUENCE {
|
||||
* certDetails CertTemplate,
|
||||
* -- allows requester to specify as much as they can about
|
||||
* -- the cert. for which revocation is requested
|
||||
* -- (e.g., for cases in which serialNumber is not available)
|
||||
* crlEntryDetails Extensions OPTIONAL
|
||||
* -- requested crlEntryExtensions
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(m_certDetails);
|
||||
v.AddOptional(m_crlEntryDetails);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevDetails.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevDetails.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f4b3619c16336b345b55ab20dce9a8ab
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/RevDetails.cs
|
||||
uploadId: 783279
|
||||
104
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevRepContent.cs
vendored
Normal file
104
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevRepContent.cs
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* <pre>
|
||||
* RevRepContent ::= SEQUENCE {
|
||||
* status SEQUENCE SIZE (1..MAX) OF PKIStatusInfo,
|
||||
* -- in same order as was sent in RevReqContent
|
||||
* revCerts [0] SEQUENCE SIZE (1..MAX) OF CertId
|
||||
* OPTIONAL,
|
||||
* -- IDs for which revocation was requested
|
||||
* -- (same order as status)
|
||||
* crls [1] SEQUENCE SIZE (1..MAX) OF CertificateList OPTIONAL
|
||||
* -- the resulting CRLs (there may be more than one)
|
||||
* }
|
||||
*</pre>
|
||||
*/
|
||||
public class RevRepContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static RevRepContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is RevRepContent revRepContent)
|
||||
return revRepContent;
|
||||
|
||||
if (obj != null)
|
||||
return new RevRepContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly Asn1Sequence m_status;
|
||||
private readonly Asn1Sequence m_revCerts;
|
||||
private readonly Asn1Sequence m_crls;
|
||||
|
||||
private RevRepContent(Asn1Sequence seq)
|
||||
{
|
||||
m_status = Asn1Sequence.GetInstance(seq[0]);
|
||||
|
||||
for (int pos = 1; pos < seq.Count; ++pos)
|
||||
{
|
||||
Asn1TaggedObject tObj = Asn1TaggedObject.GetInstance(seq[pos]);
|
||||
|
||||
if (tObj.TagNo == 0)
|
||||
{
|
||||
m_revCerts = Asn1Sequence.GetInstance(tObj, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_crls = Asn1Sequence.GetInstance(tObj, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual PkiStatusInfo[] GetStatus()
|
||||
{
|
||||
return m_status.MapElements(PkiStatusInfo.GetInstance);
|
||||
}
|
||||
|
||||
public virtual CertId[] GetRevCerts()
|
||||
{
|
||||
if (m_revCerts == null)
|
||||
return null;
|
||||
|
||||
return m_revCerts.MapElements(CertId.GetInstance);
|
||||
}
|
||||
|
||||
public virtual CertificateList[] GetCrls()
|
||||
{
|
||||
if (m_crls == null)
|
||||
return null;
|
||||
|
||||
return m_crls.MapElements(CertificateList.GetInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* RevRepContent ::= SEQUENCE {
|
||||
* status SEQUENCE SIZE (1..MAX) OF PKIStatusInfo,
|
||||
* -- in same order as was sent in RevReqContent
|
||||
* revCerts [0] SEQUENCE SIZE (1..MAX) OF CertId OPTIONAL,
|
||||
* -- IDs for which revocation was requested
|
||||
* -- (same order as status)
|
||||
* crls [1] SEQUENCE SIZE (1..MAX) OF CertificateList OPTIONAL
|
||||
* -- the resulting CRLs (there may be more than one)
|
||||
* }
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(m_status);
|
||||
v.AddOptionalTagged(true, 0, m_revCerts);
|
||||
v.AddOptionalTagged(true, 1, m_crls);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevRepContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevRepContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 61fb5fcb2f0c8f94abe8b3191cf184eb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/RevRepContent.cs
|
||||
uploadId: 783279
|
||||
59
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevRepContentBuilder.cs
vendored
Normal file
59
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevRepContentBuilder.cs
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
public class RevRepContentBuilder
|
||||
{
|
||||
private readonly Asn1EncodableVector m_status = new Asn1EncodableVector();
|
||||
private readonly Asn1EncodableVector m_revCerts = new Asn1EncodableVector();
|
||||
private readonly Asn1EncodableVector m_crls = new Asn1EncodableVector();
|
||||
|
||||
public virtual RevRepContentBuilder Add(PkiStatusInfo status)
|
||||
{
|
||||
m_status.Add(status);
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual RevRepContentBuilder Add(PkiStatusInfo status, CertId certId)
|
||||
{
|
||||
if (m_status.Count != m_revCerts.Count)
|
||||
throw new InvalidOperationException("status and revCerts sequence must be in common order");
|
||||
|
||||
m_status.Add(status);
|
||||
m_revCerts.Add(certId);
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual RevRepContentBuilder AddCrl(CertificateList crl)
|
||||
{
|
||||
m_crls.Add(crl);
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual RevRepContent Build()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector();
|
||||
|
||||
v.Add(new DerSequence(m_status));
|
||||
|
||||
if (m_revCerts.Count != 0)
|
||||
{
|
||||
v.Add(new DerTaggedObject(true, 0, new DerSequence(m_revCerts)));
|
||||
}
|
||||
|
||||
if (m_crls.Count != 0)
|
||||
{
|
||||
v.Add(new DerTaggedObject(true, 1, new DerSequence(m_crls)));
|
||||
}
|
||||
|
||||
return RevRepContent.GetInstance(new DerSequence(v));
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevRepContentBuilder.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevRepContentBuilder.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05e473700bed52f47ad85cabbd7413d3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/RevRepContentBuilder.cs
|
||||
uploadId: 783279
|
||||
58
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevReqContent.cs
vendored
Normal file
58
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevReqContent.cs
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
#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.Cmp
|
||||
{
|
||||
public class RevReqContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static RevReqContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is RevReqContent revReqContent)
|
||||
return revReqContent;
|
||||
|
||||
if (obj != null)
|
||||
return new RevReqContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly Asn1Sequence m_content;
|
||||
|
||||
private RevReqContent(Asn1Sequence seq)
|
||||
{
|
||||
m_content = seq;
|
||||
}
|
||||
|
||||
public RevReqContent(RevDetails revDetails)
|
||||
{
|
||||
m_content = new DerSequence(revDetails);
|
||||
}
|
||||
|
||||
public RevReqContent(params RevDetails[] revDetailsArray)
|
||||
{
|
||||
m_content = new DerSequence(revDetailsArray);
|
||||
}
|
||||
|
||||
public virtual RevDetails[] ToRevDetailsArray()
|
||||
{
|
||||
return m_content.MapElements(RevDetails.GetInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* RevReqContent ::= SEQUENCE OF RevDetails
|
||||
* </pre>
|
||||
* @return a basic ASN.1 object representation.
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return m_content;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevReqContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/RevReqContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a8e0e45790a3804ba7cda6acc7c3a37
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/RevReqContent.cs
|
||||
uploadId: 783279
|
||||
95
Runtime/3rdParty/BouncyCastle/asn1/cmp/RootCaKeyUpdateContent.cs
vendored
Normal file
95
Runtime/3rdParty/BouncyCastle/asn1/cmp/RootCaKeyUpdateContent.cs
vendored
Normal file
@ -0,0 +1,95 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp
|
||||
{
|
||||
/**
|
||||
* GenMsg: {id-it 20}, RootCaCertValue | < absent >
|
||||
* GenRep: {id-it 18}, RootCaKeyUpdateContent | < absent >
|
||||
* <p>
|
||||
* RootCaCertValue ::= CMPCertificate
|
||||
* </p><p>
|
||||
* RootCaKeyUpdateValue ::= RootCaKeyUpdateContent
|
||||
* </p><p>
|
||||
* RootCaKeyUpdateContent ::= SEQUENCE {
|
||||
* newWithNew CMPCertificate,
|
||||
* newWithOld [0] CMPCertificate OPTIONAL,
|
||||
* oldWithNew [1] CMPCertificate OPTIONAL
|
||||
* }
|
||||
* </p>
|
||||
*/
|
||||
public class RootCaKeyUpdateContent
|
||||
: Asn1Encodable
|
||||
{
|
||||
public static RootCaKeyUpdateContent GetInstance(object obj)
|
||||
{
|
||||
if (obj is RootCaKeyUpdateContent rootCaKeyUpdateContent)
|
||||
return rootCaKeyUpdateContent;
|
||||
|
||||
if (obj != null)
|
||||
return new RootCaKeyUpdateContent(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private readonly CmpCertificate m_newWithNew;
|
||||
private readonly CmpCertificate m_newWithOld;
|
||||
private readonly CmpCertificate m_oldWithNew;
|
||||
|
||||
public RootCaKeyUpdateContent(CmpCertificate newWithNew, CmpCertificate newWithOld, CmpCertificate oldWithNew)
|
||||
{
|
||||
if (newWithNew == null)
|
||||
throw new ArgumentNullException(nameof(newWithNew));
|
||||
|
||||
m_newWithNew = newWithNew;
|
||||
m_newWithOld = newWithOld;
|
||||
m_oldWithNew = oldWithNew;
|
||||
}
|
||||
|
||||
private RootCaKeyUpdateContent(Asn1Sequence seq)
|
||||
{
|
||||
if (seq.Count < 1 || seq.Count > 3)
|
||||
throw new ArgumentException("expected sequence of 1 to 3 elements only");
|
||||
|
||||
CmpCertificate newWithNew;
|
||||
CmpCertificate newWithOld = null;
|
||||
CmpCertificate oldWithNew = null;
|
||||
|
||||
newWithNew = CmpCertificate.GetInstance(seq[0]);
|
||||
|
||||
for (int pos = 1; pos < seq.Count; ++pos)
|
||||
{
|
||||
Asn1TaggedObject ato = Asn1TaggedObject.GetInstance(seq[pos]);
|
||||
if (ato.TagNo == 0)
|
||||
{
|
||||
newWithOld = CmpCertificate.GetInstance(ato, true);
|
||||
}
|
||||
else if (ato.TagNo == 1)
|
||||
{
|
||||
oldWithNew = CmpCertificate.GetInstance(ato, true);
|
||||
}
|
||||
}
|
||||
|
||||
m_newWithNew = newWithNew;
|
||||
m_newWithOld = newWithOld;
|
||||
m_oldWithNew = oldWithNew;
|
||||
}
|
||||
|
||||
public virtual CmpCertificate NewWithNew => m_newWithNew;
|
||||
|
||||
public virtual CmpCertificate NewWithOld => m_newWithOld;
|
||||
|
||||
public virtual CmpCertificate OldWithNew => m_oldWithNew;
|
||||
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(m_newWithNew);
|
||||
v.AddOptionalTagged(true, 0, m_newWithOld);
|
||||
v.AddOptionalTagged(true, 1, m_oldWithNew);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/RootCaKeyUpdateContent.cs.meta
vendored
Normal file
18
Runtime/3rdParty/BouncyCastle/asn1/cmp/RootCaKeyUpdateContent.cs.meta
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1715bfa0022963c4696082543f5e8fe2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 267636
|
||||
packageName: Best HTTP
|
||||
packageVersion: 3.0.17
|
||||
assetPath: Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/cmp/RootCaKeyUpdateContent.cs
|
||||
uploadId: 783279
|
||||
Reference in New Issue
Block a user