code: private void construct(DerValue derVal) throws IOException {
          if (derVal.tag != DerValue.tag_Sequence) {
              throw new IOException("Invalid encoded CertificateValidity, " +
                                    "starting sequence tag missing.");
          }
          // check if UTCTime encoded or GeneralizedTime
          if (derVal.data.available() == 0)
              throw new IOException("No data encoded for CertificateValidity");
  
          DerInputStream derIn = new DerInputStream(derVal.toByteArray());
          DerValue[] seq = derIn.getSequence(2);
          if (seq.length != 2)
              throw new IOException("Invalid encoding for CertificateValidity");
  
          if (seq[0].tag == DerValue.tag_UtcTime) {
              notBefore = derVal.data.getUTCTime();
          } else if (seq[0].tag == DerValue.tag_GeneralizedTime) {
              notBefore = derVal.data.getGeneralizedTime();
          } else {
              throw new IOException("Invalid encoding for CertificateValidity");
          }
  
          if (seq[1].tag == DerValue.tag_UtcTime) {
              notAfter = derVal.data.getUTCTime();
          } else if (seq[1].tag == DerValue.tag_GeneralizedTime) {
              notAfter = derVal.data.getGeneralizedTime();
          } else {
              throw new IOException("Invalid encoding for CertificateValidity");
          }
      }
docs: Construct the class from the DerValue