code: private void parse(byte[] timestampTokenInfo) throws IOException {
  
          DerValue tstInfo = new DerValue(timestampTokenInfo);
          if (tstInfo.tag != DerValue.tag_Sequence) {
              throw new IOException("Bad encoding for timestamp token info");
          }
          // Parse version
          version = tstInfo.data.getInteger();
  
          // Parse policy
          policy = tstInfo.data.getOID();
  
          // Parse messageImprint
          DerValue messageImprint = tstInfo.data.getDerValue();
          hashAlgorithm = AlgorithmId.parse(messageImprint.data.getDerValue());
          hashedMessage = messageImprint.data.getOctetString();
  
          // Parse serialNumber
          serialNumber = tstInfo.data.getBigInteger();
  
          // Parse genTime
          genTime = tstInfo.data.getGeneralizedTime();
  
          // Parse optional elements, if present
          while (tstInfo.data.available() > 0) {
              DerValue d = tstInfo.data.getDerValue();
              if (d.tag == DerValue.tag_Integer) {    // must be the nonce
                  nonce = d.getBigInteger();
                  break;
              }
  
              // Additional fields:
              // Parse accuracy
              // Parse ordering
              // Parse tsa
              // Parse extensions
          }
      }
docs: /*
  Parses the timestamp token info.
  
  @param timestampTokenInfo A buffer containing an ASN.1 BER encoded
  TSTInfo.
  @throws IOException The exception is thrown if a problem is encountered
  while parsing.