Class CMSSignedDataStreamEditor

java.lang.Object
org.bouncycastle.cms.CMSSignedDataStreamEditor

public class CMSSignedDataStreamEditor extends Object
  • Constructor Details

    • CMSSignedDataStreamEditor

      public CMSSignedDataStreamEditor()
  • Method Details

    • addDigestAlgorithm

      public static OutputStream addDigestAlgorithm(OutputStream out, InputStream original, org.bouncycastle.asn1.x509.AlgorithmIdentifier digestAlgorithm, DigestAlgorithmIdentifierFinder digestAlgIdFinder, DigestCalculatorProvider digestCalculatorProvider) throws IOException, CMSException
      Add the specified digest algorithm to the signed data contained in the input stream and write the updated signed data to the provided output stream. This ensures that the output signed data includes the specified digest algorithm. Uses the provided DigestAlgorithmIdentifierFinder to create the digest sets and the DigestCalculatorProvider for computing the required digests.

      The output stream is returned unclosed.

      Parameters:
      out - the output stream where the updated signed data object will be written.
      original - the input stream containing the original signed data to be modified.
      digestAlgorithm - the digest algorithm to be added to the signed data.
      digestAlgIdFinder - the DigestAlgorithmIdentifierFinder used to create the digest sets.
      digestCalculatorProvider - the DigestCalculatorProvider used to compute the digests.
      Returns:
      the output stream containing the updated signed data.
      Throws:
      IOException
      CMSException
    • addDigestAlgorithm

      public static OutputStream addDigestAlgorithm(OutputStream out, InputStream original, org.bouncycastle.asn1.x509.AlgorithmIdentifier digestAlgorithm, DigestCalculatorProvider digestCalculatorProvider) throws IOException, CMSException
      Add the specified digest algorithm to the signed data contained in the input stream and write the updated signed data to the provided output stream. This ensures that the output signed data includes the specified digest algorithm.

      The output stream is returned unclosed.

      Parameters:
      out - the output stream where the updated signed data object will be written.
      original - the input stream containing the original signed data to be modified.
      digestAlgorithm - the digest algorithm to be added to the signed data.
      Returns:
      the output stream containing the updated signed data.
      Throws:
      IOException
      CMSException