private void initialize(ContentInfo contentInfo) {
    this.contentInfo = contentInfo;

    if (CMSObjectIdentifiers.timestampedData.equals(contentInfo.getContentType())) {
      this.timeStampedData = TimeStampedData.getInstance(contentInfo.getContent());
    } else {
      throw new IllegalArgumentException(
          "Malformed content - type must be " + CMSObjectIdentifiers.timestampedData.getId());
    }

    util = new TimeStampDataUtil(this.timeStampedData);
  }
 public CMSTimeStampedData(InputStream in) throws IOException {
   try {
     initialize(ContentInfo.getInstance(new ASN1InputStream(in).readObject()));
   } catch (ClassCastException e) {
     throw new IOException("Malformed content: " + e);
   } catch (IllegalArgumentException e) {
     throw new IOException("Malformed content: " + e);
   }
 }
 public byte[] getEncoded() throws IOException {
   return contentInfo.getEncoded();
 }