Class ValidationTimeStamp


  • public class ValidationTimeStamp
    extends java.lang.Object
    This class wraps the TSAClient and the work that has to be done with it. Like Adding Signed TimeStamps to a signature, or creating a CMS timestamp attribute (with a signed timestamp)
    • Constructor Summary

      Constructors 
      Constructor Description
      ValidationTimeStamp​(java.lang.String tsaUrl)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.bouncycastle.cms.CMSSignedData addSignedTimeStamp​(org.bouncycastle.cms.CMSSignedData signedData)
      Extend cms signed data with TimeStamp first or to all signers
      byte[] getTimeStampToken​(java.io.InputStream content)
      Creates a signed timestamp token by the given input stream.
      private org.bouncycastle.cms.SignerInformation signTimeStamp​(org.bouncycastle.cms.SignerInformation signer)
      Extend CMS Signer Information with the TimeStampToken into the unsigned Attributes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ValidationTimeStamp

        public ValidationTimeStamp​(java.lang.String tsaUrl)
                            throws java.security.NoSuchAlgorithmException,
                                   java.net.MalformedURLException,
                                   java.net.URISyntaxException
        Parameters:
        tsaUrl - The url where TS-Request will be done.
        Throws:
        java.security.NoSuchAlgorithmException
        java.net.MalformedURLException
        java.net.URISyntaxException
    • Method Detail

      • getTimeStampToken

        public byte[] getTimeStampToken​(java.io.InputStream content)
                                 throws java.io.IOException
        Creates a signed timestamp token by the given input stream.
        Parameters:
        content - InputStream of the content to sign
        Returns:
        the byte[] of the timestamp token
        Throws:
        java.io.IOException
      • addSignedTimeStamp

        public org.bouncycastle.cms.CMSSignedData addSignedTimeStamp​(org.bouncycastle.cms.CMSSignedData signedData)
                                                              throws java.io.IOException
        Extend cms signed data with TimeStamp first or to all signers
        Parameters:
        signedData - Generated CMS signed data
        Returns:
        CMSSignedData Extended CMS signed data
        Throws:
        java.io.IOException
      • signTimeStamp

        private org.bouncycastle.cms.SignerInformation signTimeStamp​(org.bouncycastle.cms.SignerInformation signer)
                                                              throws java.io.IOException
        Extend CMS Signer Information with the TimeStampToken into the unsigned Attributes.
        Parameters:
        signer - information about signer
        Returns:
        information about SignerInformation
        Throws:
        java.io.IOException