Class TSAClient


  • public class TSAClient
    extends java.lang.Object
    Time Stamping Authority (TSA) Client [RFC 3161].
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.bouncycastle.operator.DigestAlgorithmIdentifierFinder ALGORITHM_OID_FINDER  
      private java.security.MessageDigest digest  
      private static org.apache.commons.logging.Log LOG  
      private java.lang.String password  
      private static java.util.Random RANDOM  
      private java.net.URL url  
      private java.lang.String username  
    • Constructor Summary

      Constructors 
      Constructor Description
      TSAClient​(java.net.URL url, java.lang.String username, java.lang.String password, java.security.MessageDigest digest)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.bouncycastle.tsp.TimeStampToken getTimeStampToken​(java.io.InputStream content)  
      private byte[] getTSAResponse​(byte[] request)  
      • Methods inherited from class java.lang.Object

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

      • LOG

        private static final org.apache.commons.logging.Log LOG
      • ALGORITHM_OID_FINDER

        private static final org.bouncycastle.operator.DigestAlgorithmIdentifierFinder ALGORITHM_OID_FINDER
      • url

        private final java.net.URL url
      • username

        private final java.lang.String username
      • password

        private final java.lang.String password
      • digest

        private final java.security.MessageDigest digest
      • RANDOM

        private static final java.util.Random RANDOM
    • Constructor Detail

      • TSAClient

        public TSAClient​(java.net.URL url,
                         java.lang.String username,
                         java.lang.String password,
                         java.security.MessageDigest digest)
        Parameters:
        url - the URL of the TSA service
        username - user name of TSA
        password - password of TSA
        digest - the message digest to use
    • Method Detail

      • getTimeStampToken

        public org.bouncycastle.tsp.TimeStampToken getTimeStampToken​(java.io.InputStream content)
                                                              throws java.io.IOException
        Parameters:
        content -
        Returns:
        the time stamp token
        Throws:
        java.io.IOException - if there was an error with the connection or data from the TSA server, or if the time stamp response could not be validated
      • getTSAResponse

        private byte[] getTSAResponse​(byte[] request)
                               throws java.io.IOException
        Throws:
        java.io.IOException