Class TSPUtil


  • public class TSPUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      TSPUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Collection getSignatureTimestamps​(SignerInformation signerInfo, org.bouncycastle.operator.DigestCalculatorProvider digCalcProvider)
      Fetches the signature time-stamp attributes from a SignerInformation object.
      static void validateCertificate​(X509CertificateHolder cert)
      Validate the passed in certificate as being of the correct type to be used for time stamping.
      • Methods inherited from class java.lang.Object

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

      • TSPUtil

        public TSPUtil()
    • Method Detail

      • getSignatureTimestamps

        public static java.util.Collection getSignatureTimestamps​(SignerInformation signerInfo,
                                                                  org.bouncycastle.operator.DigestCalculatorProvider digCalcProvider)
                                                           throws TSPValidationException
        Fetches the signature time-stamp attributes from a SignerInformation object. Checks that the MessageImprint for each time-stamp matches the signature field. (see RFC 3161 Appendix A).
        Parameters:
        signerInfo - a SignerInformation to search for time-stamps
        digCalcProvider - provider for digest calculators
        Returns:
        a collection of TimeStampToken objects
        Throws:
        TSPValidationException
      • validateCertificate

        public static void validateCertificate​(X509CertificateHolder cert)
                                        throws TSPValidationException
        Validate the passed in certificate as being of the correct type to be used for time stamping. To be valid it must have an ExtendedKeyUsage extension which has a key purpose identifier of id-kp-timeStamping.
        Parameters:
        cert - the certificate of interest.
        Throws:
        TSPValidationException - if the certificate fails on one of the check points.