/**
   * Return the digested content
   *
   * @return the digested content
   * @throws CMSException if there is an exception un-compressing the data.
   */
  public CMSProcessable getDigestedContent() throws CMSException {
    ContentInfo content = digestedData.getEncapContentInfo();

    try {
      return new CMSProcessableByteArray(
          content.getContentType(), ((ASN1OctetString) content.getContent()).getOctets());
    } catch (Exception e) {
      throw new CMSException("exception reading digested stream.", e);
    }
  }
  public boolean verify(DigestCalculatorProvider calculatorProvider) throws CMSException {
    try {
      ContentInfo content = digestedData.getEncapContentInfo();
      DigestCalculator calc = calculatorProvider.get(digestedData.getDigestAlgorithm());

      OutputStream dOut = calc.getOutputStream();

      dOut.write(((ASN1OctetString) content.getContent()).getOctets());

      return Arrays.areEqual(digestedData.getDigest(), calc.getDigest());
    } catch (OperatorCreationException e) {
      throw new CMSException("unable to create digest calculator: " + e.getMessage(), e);
    } catch (IOException e) {
      throw new CMSException("unable process content: " + e.getMessage(), e);
    }
  }