code: private void parse(DerValue val)
          throws IOException, CertificateException
      {
          if (val.tag != DerValue.tag_Sequence) {
              throw new IOException
                  ("Sequence tag missing for X509CertificatePair");
          }
  
          while (val.data != null && val.data.available() != 0) {
              DerValue opt = val.data.getDerValue();
              short tag = (byte) (opt.tag & 0x01f);
              switch (tag) {
                  case TAG_FORWARD:
                      if (opt.isContextSpecific() && opt.isConstructed()) {
                          if (forward != null) {
                              throw new IOException("Duplicate forward "
                                  + "certificate in X509CertificatePair");
                          }
                          opt = opt.data.getDerValue();
                          forward = X509Factory.intern
                                          (new X509CertImpl(opt.toByteArray()));
                      }
                      break;
                  case TAG_REVERSE:
                      if (opt.isContextSpecific() && opt.isConstructed()) {
                          if (reverse != null) {
                              throw new IOException("Duplicate reverse "
                                  + "certificate in X509CertificatePair");
                          }
                          opt = opt.data.getDerValue();
                          reverse = X509Factory.intern
                                          (new X509CertImpl(opt.toByteArray()));
                      }
                      break;
                  default:
                      throw new IOException("Invalid encoding of "
                          + "X509CertificatePair");
              }
          }
          if (forward == null && reverse == null) {
              throw new CertificateException("at least one of certificate pair "
                  + "must be non-null");
          }
      }
docs: /* Parse the encoded bytes