init commit

This commit is contained in:
2025-10-09 09:57:24 +09:00
commit 4d551bd74f
6636 changed files with 1218703 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
using System;
using Org.BouncyCastle.Utilities;
namespace Org.BouncyCastle.Asn1;
public class DerVideotexString : DerStringBase
{
private readonly byte[] mString;
public static DerVideotexString GetInstance(object obj)
{
if (obj == null || obj is DerVideotexString)
{
return (DerVideotexString)obj;
}
if (obj is byte[])
{
try
{
return (DerVideotexString)Asn1Object.FromByteArray((byte[])obj);
}
catch (Exception ex)
{
throw new ArgumentException("encoding error in GetInstance: " + ex.ToString(), "obj");
}
}
throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj), "obj");
}
public static DerVideotexString GetInstance(Asn1TaggedObject obj, bool isExplicit)
{
Asn1Object asn1Object = obj.GetObject();
if (isExplicit || asn1Object is DerVideotexString)
{
return GetInstance(asn1Object);
}
return new DerVideotexString(((Asn1OctetString)asn1Object).GetOctets());
}
public DerVideotexString(byte[] encoding)
{
mString = Arrays.Clone(encoding);
}
public override string GetString()
{
return Strings.FromByteArray(mString);
}
public byte[] GetOctets()
{
return Arrays.Clone(mString);
}
internal override void Encode(DerOutputStream derOut)
{
derOut.WriteEncoded(21, mString);
}
protected override int Asn1GetHashCode()
{
return Arrays.GetHashCode(mString);
}
protected override bool Asn1Equals(Asn1Object asn1Object)
{
if (!(asn1Object is DerVideotexString derVideotexString))
{
return false;
}
return Arrays.AreEqual(mString, derVideotexString.mString);
}
}