ASN1UnitTest (Bouncy Castle Library 1.85 API Specification)
Date: 2026-07-12

org.bouncycastle.asn1.test

## Class ASN1UnitTest

- java.lang.Object
- - org.bouncycastle.util.test.SimpleTest
  - - org.bouncycastle.asn1.test.ASN1UnitTest

- All Implemented Interfaces:
    Test
  Direct Known Subclasses:
    LinkedCertificateTest, NameOrPseudonymUnitTest, PersonalDataUnitTest

      public abstract class ASN1UnitTest
      extends SimpleTest

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.bouncycastle.util.test.SimpleTest

      `SimpleTest.TestExceptionOperation`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ASN1UnitTest()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkMandatoryField(java.lang.String name, ASN1Encodable expected, ASN1Encodable present)`
    `protected void` | `checkMandatoryField(java.lang.String name, byte[] expected, byte[] present)`
    `protected void` | `checkMandatoryField(java.lang.String name, int expected, int present)`
    `protected void` | `checkMandatoryField(java.lang.String name, java.lang.String expected, java.lang.String present)`
    `protected void` | `checkOptionalField(java.lang.String name, ASN1Encodable expected, ASN1Encodable present)`
    `protected void` | `checkOptionalField(java.lang.String name, java.math.BigInteger expected, java.math.BigInteger present)`
    `protected void` | `checkOptionalField(java.lang.String name, java.lang.String expected, java.lang.String present)`

    - ### Methods inherited from class org.bouncycastle.util.test.SimpleTest

      `areEqual, areEqual, areEqual, fail, fail, fail, getName, isEquals, isEquals, isEquals, isEquals, isEquals, isEquals, isEquals, isTrue, isTrue, perform, performTest, runTest, runTest, runTests, runTests, testException`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ASN1UnitTest

          public ASN1UnitTest()

  - ### Method Detail

    - #### checkMandatoryField

          protected void checkMandatoryField(java.lang.String name,
                                             ASN1Encodable expected,
                                             ASN1Encodable present)

    - #### checkMandatoryField

          protected void checkMandatoryField(java.lang.String name,
                                             java.lang.String expected,
                                             java.lang.String present)

    - #### checkMandatoryField

          protected void checkMandatoryField(java.lang.String name,
                                             byte[] expected,
                                             byte[] present)

    - #### checkMandatoryField

          protected void checkMandatoryField(java.lang.String name,
                                             int expected,
                                             int present)

    - #### checkOptionalField

          protected void checkOptionalField(java.lang.String name,
                                            ASN1Encodable expected,
                                            ASN1Encodable present)

    - #### checkOptionalField

          protected void checkOptionalField(java.lang.String name,
                                            java.lang.String expected,
                                            java.lang.String present)

    - #### checkOptionalField

          protected void checkOptionalField(java.lang.String name,
                                            java.math.BigInteger expected,
                                            java.math.BigInteger present)