<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />

ProfessionInfo

public class ProfessionInfo : Asn1Encodable
using Org.BouncyCastle.Asn1.X500; using Org.BouncyCastle.Utilities; using System; using System.Collections.Generic; namespace Org.BouncyCastle.Asn1.IsisMtt.X509 { public class ProfessionInfo : Asn1Encodable { public static readonly DerObjectIdentifier Rechtsanwltin = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".1"); public static readonly DerObjectIdentifier Rechtsanwalt = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".2"); public static readonly DerObjectIdentifier Rechtsbeistand = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".3"); public static readonly DerObjectIdentifier Steuerberaterin = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".4"); public static readonly DerObjectIdentifier Steuerberater = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".5"); public static readonly DerObjectIdentifier Steuerbevollmchtigte = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".6"); public static readonly DerObjectIdentifier Steuerbevollmchtigter = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".7"); public static readonly DerObjectIdentifier Notarin = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".8"); public static readonly DerObjectIdentifier Notar = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".9"); public static readonly DerObjectIdentifier Notarvertreterin = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".10"); public static readonly DerObjectIdentifier Notarvertreter = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".11"); public static readonly DerObjectIdentifier Notariatsverwalterin = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".12"); public static readonly DerObjectIdentifier Notariatsverwalter = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".13"); public static readonly DerObjectIdentifier Wirtschaftsprferin = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".14"); public static readonly DerObjectIdentifier Wirtschaftsprfer = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".15"); public static readonly DerObjectIdentifier VereidigteBuchprferin = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".16"); public static readonly DerObjectIdentifier VereidigterBuchprfer = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".17"); public static readonly DerObjectIdentifier Patentanwltin = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".18"); public static readonly DerObjectIdentifier Patentanwalt = new DerObjectIdentifier(NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern?.ToString() + ".19"); private readonly NamingAuthority namingAuthority; private readonly Asn1Sequence professionItems; private readonly Asn1Sequence professionOids; private readonly string registrationNumber; private readonly Asn1OctetString addProfessionInfo; public virtual Asn1OctetString AddProfessionInfo => addProfessionInfo; public virtual NamingAuthority NamingAuthority => namingAuthority; public virtual string RegistrationNumber => registrationNumber; public static ProfessionInfo GetInstance(object obj) { if (obj == null || obj is ProfessionInfo) return (ProfessionInfo)obj; Asn1Sequence asn1Sequence = obj as Asn1Sequence; if (asn1Sequence != null) return new ProfessionInfo(asn1Sequence); throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } private ProfessionInfo(Asn1Sequence seq) { int num; if (seq.Count > 5) { num = seq.Count; throw new ArgumentException("Bad sequence size: " + num.ToString()); } IEnumerator<Asn1Encodable> enumerator = seq.GetEnumerator(); enumerator.MoveNext(); Asn1Encodable current = enumerator.Current; Asn1TaggedObject asn1TaggedObject = current as Asn1TaggedObject; if (asn1TaggedObject != null) { if (asn1TaggedObject.TagNo != 0) { num = asn1TaggedObject.TagNo; throw new ArgumentException("Bad tag number: " + num.ToString()); } namingAuthority = NamingAuthority.GetInstance(asn1TaggedObject, true); enumerator.MoveNext(); current = enumerator.Current; } professionItems = Asn1Sequence.GetInstance(current); if (enumerator.MoveNext()) { current = enumerator.Current; Asn1Sequence asn1Sequence = current as Asn1Sequence; if (asn1Sequence != null) professionOids = asn1Sequence; else { DerPrintableString derPrintableString = current as DerPrintableString; if (derPrintableString != null) registrationNumber = derPrintableString.GetString(); else { Asn1OctetString asn1OctetString = current as Asn1OctetString; if (asn1OctetString == null) throw new ArgumentException("Bad object encountered: " + Platform.GetTypeName(current)); addProfessionInfo = asn1OctetString; } } } if (enumerator.MoveNext()) { current = enumerator.Current; DerPrintableString derPrintableString2 = current as DerPrintableString; if (derPrintableString2 != null) registrationNumber = derPrintableString2.GetString(); else { Asn1OctetString asn1OctetString2 = current as Asn1OctetString; if (asn1OctetString2 == null) throw new ArgumentException("Bad object encountered: " + Platform.GetTypeName(current)); addProfessionInfo = asn1OctetString2; } } if (enumerator.MoveNext()) { current = enumerator.Current; Asn1OctetString asn1OctetString3 = current as Asn1OctetString; if (asn1OctetString3 == null) throw new ArgumentException("Bad object encountered: " + Platform.GetTypeName(current)); addProfessionInfo = asn1OctetString3; } } public ProfessionInfo(NamingAuthority namingAuthority, DirectoryString[] professionItems, DerObjectIdentifier[] professionOids, string registrationNumber, Asn1OctetString addProfessionInfo) { this.namingAuthority = namingAuthority; this.professionItems = new DerSequence(professionItems); if (professionOids != null) this.professionOids = new DerSequence(professionOids); this.registrationNumber = registrationNumber; this.addProfessionInfo = addProfessionInfo; } public override Asn1Object ToAsn1Object() { Asn1EncodableVector asn1EncodableVector = new Asn1EncodableVector(5); asn1EncodableVector.AddOptionalTagged(true, 0, namingAuthority); asn1EncodableVector.Add(professionItems); asn1EncodableVector.AddOptional(professionOids); if (registrationNumber != null) asn1EncodableVector.Add(new DerPrintableString(registrationNumber, true)); asn1EncodableVector.AddOptional(addProfessionInfo); return new DerSequence(asn1EncodableVector); } public virtual DirectoryString[] GetProfessionItems() { return professionItems.MapElements(DirectoryString.GetInstance); } public virtual DerObjectIdentifier[] GetProfessionOids() { return professionOids?.MapElements(DerObjectIdentifier.GetInstance) ?? new DerObjectIdentifier[0]; } } }