public override void RegisterComponents() { this.bitString = this.Components[0] as ASN1BitString; this.octetString = this.Components[1] as ASN1OctetString; }
public override void RegisterComponents() { this.bitString = NextComponent() as ASN1BitString; this.octetString = NextComponent() as ASN1OctetString; }
public void Test_CHOICE() { test_CHOICE t1 = new test_CHOICE(); ASN1Boolean bl = new ASN1Boolean(true); t1.Assign(bl); BERWriter.DumpHEX(t1); BERWriter.DumpHEX(bl); /* CHOICE is an union type: therefore * DERs of choice and underlying type are * the same.. */ Assert.IsTrue(BERComparer.Equals(t1.asDER(), bl.asDER())); BEREncoding ber = bl.asDER(); test_CHOICE t2 = new test_CHOICE(); t2.fromBER(ber); BERWriter.DumpHEX(t2); ASN1BitString bitstring = new ASN1BitString(new byte[2]{0xff, 0xff}, 10); test_CHOICE t3 = new test_CHOICE(); t3.Assign(bitstring); BERWriter.DumpHEX(t3); BERWriter.DumpHEX(bitstring); test_CHOICE t4 = new test_CHOICE(); t4.fromBER(t3.asDER()); BERWriter.DumpHEX(t4); Console.WriteLine("Unfinished business"); }