add all
This commit is contained in:
31
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/x509/extension/X509ExtensionUtil.cs
vendored
Normal file
31
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/x509/extension/X509ExtensionUtil.cs
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.X509.Extension
|
||||
{
|
||||
public class X509ExtensionUtilities
|
||||
{
|
||||
public static Asn1Object FromExtensionValue(Asn1OctetString extensionValue)
|
||||
{
|
||||
return Asn1Object.FromByteArray(extensionValue.GetOctets());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extract the value of the given extension, if it exists.
|
||||
/// </summary>
|
||||
/// <param name="extensions">The extensions object.</param>
|
||||
/// <param name="oid">The object identifier to obtain.</param>
|
||||
/// <returns>Asn1Object</returns>
|
||||
/// <exception cref="Exception">if the extension cannot be read.</exception>
|
||||
public static Asn1Object FromExtensionValue(IX509Extension extensions, DerObjectIdentifier oid)
|
||||
{
|
||||
Asn1OctetString extensionValue = extensions.GetExtensionValue(oid);
|
||||
return extensionValue == null ? null : FromExtensionValue(extensionValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
Reference in New Issue
Block a user