kz.gamma.hardware.tsp
Class TimeStampToken

java.lang.Object
  extended by kz.gamma.hardware.tsp.TimeStampToken

public class TimeStampToken
extends java.lang.Object


Nested Class Summary
private  class TimeStampToken.CertID
           
 
Field Summary
(package private)  TimeStampToken.CertID certID
           
(package private)  java.util.Date genTime
           
(package private)  SignerInformation tsaSignerInfo
           
(package private)  TimeStampTokenInfo tstInfo
           
(package private)  CMSSignedData tsToken
           
 
Constructor Summary
TimeStampToken(CMSSignedData signedData)
           
TimeStampToken(ContentInfo contentInfo)
           
 
Method Summary
 java.security.cert.CertStore getCertificatesAndCRLs(java.lang.String type, java.lang.String provider)
           
 byte[] getEncoded()
          Return a ASN.1 encoded byte stream representing the encoded object.
 SignerId getSID()
           
 AttributeTable getSignedAttributes()
           
 TimeStampTokenInfo getTimeStampInfo()
           
 AttributeTable getUnsignedAttributes()
           
 CMSSignedData toCMSSignedData()
          Return the underlying CMSSignedData object.
 void validate(java.security.cert.X509Certificate cert, java.lang.String provider)
          Validate the time stamp token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tsToken

CMSSignedData tsToken

tsaSignerInfo

SignerInformation tsaSignerInfo

genTime

java.util.Date genTime

tstInfo

TimeStampTokenInfo tstInfo

certID

TimeStampToken.CertID certID
Constructor Detail

TimeStampToken

public TimeStampToken(ContentInfo contentInfo)
               throws TSPException,
                      java.io.IOException
Throws:
TSPException
java.io.IOException

TimeStampToken

public TimeStampToken(CMSSignedData signedData)
               throws TSPException,
                      java.io.IOException
Throws:
TSPException
java.io.IOException
Method Detail

getTimeStampInfo

public TimeStampTokenInfo getTimeStampInfo()

getSID

public SignerId getSID()

getSignedAttributes

public AttributeTable getSignedAttributes()

getUnsignedAttributes

public AttributeTable getUnsignedAttributes()

getCertificatesAndCRLs

public java.security.cert.CertStore getCertificatesAndCRLs(java.lang.String type,
                                                           java.lang.String provider)
                                                    throws java.security.NoSuchAlgorithmException,
                                                           java.security.NoSuchProviderException,
                                                           CMSException
Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
CMSException

validate

public void validate(java.security.cert.X509Certificate cert,
                     java.lang.String provider)
              throws TSPException,
                     TSPValidationException,
                     java.security.cert.CertificateExpiredException,
                     java.security.cert.CertificateNotYetValidException,
                     java.security.NoSuchProviderException
Validate the time stamp token.

To be valid the token must be signed by the passed in certificate and the certificate must be the one referred to by the SigningCertificate attribute included in the hashed attributes of the token. The certificate must also have the ExtendedKeyUsageExtension with only KeyPurposeId.id_kp_timeStamping and have been valid at the time the timestamp was created.

A successful call to validate means all the above are true.

Throws:
TSPException
TSPValidationException
java.security.cert.CertificateExpiredException
java.security.cert.CertificateNotYetValidException
java.security.NoSuchProviderException

toCMSSignedData

public CMSSignedData toCMSSignedData()
Return the underlying CMSSignedData object.

Returns:
the underlying CMS structure.

getEncoded

public byte[] getEncoded()
                  throws java.io.IOException
Return a ASN.1 encoded byte stream representing the encoded object.

Throws:
java.io.IOException - if encoding fails.


Copyright © 2013 Gamma Technologies. All Rights Reserved.