public class TSPTimeStampTokenImpl extends TimeStampTokenImpl implements TSPTimeStampToken
| Modifier and Type | Field and Description |
|---|---|
protected iaik.tsp.TimeStampToken |
token_
The TSP time-stamp token.
|
| Constructor and Description |
|---|
TSPTimeStampTokenImpl(byte[] token)
Creates a new instance of this
TSPTimeStampTokenImpl with the
given DER encoded TSP time-stamp token. |
TSPTimeStampTokenImpl(iaik.tsp.TimeStampToken token)
Creates a new instance of this
TSPTimeStampTokenImpl with the
given TSP time-stamp token. |
| Modifier and Type | Method and Description |
|---|---|
long |
getAccuracy()
Returns the accuracy of the time-stamp token in milliseconds.
|
byte[] |
getDEREncoded()
Returns the DER encoded time stamp-token.
|
BigInteger |
getSerialNumber()
Returns the serial number of the time-stamp token.
|
Date |
getTime()
Returns the generation time of the time-stamp token.
|
iaik.tsp.TimeStampToken |
getTimeStampToken() |
X509Certificate |
getTSACertificate()
Returns the certificate of the TSA that issued the time-stamp token, if the
certificate is present in the time-stamp token.
|
String |
getTSAIdentifier()
Returns the identifier of the TSA that issued the time-stamp token.
|
String |
toString() |
boolean |
validateHashValue(OctetStreamData data)
Validates the hash value in the time-stamp token with the hash value
computed from the supplied
data. |
boolean |
validateSignature(X509Certificate cert)
Validates the signature of the time-stamp token.
|
public TSPTimeStampTokenImpl(iaik.tsp.TimeStampToken token)
TSPTimeStampTokenImpl with the
given TSP time-stamp token.token - the TSP time-stamp token.NullPointerException - if token is nullpublic TSPTimeStampTokenImpl(byte[] token)
throws TimeStampTokenException
TSPTimeStampTokenImpl with the
given DER encoded TSP time-stamp token.token - the DER encoded TSP time-stamp token (RFC3161).TimeStampTokenException - if token is not a valid DER encoded TSP time-stamp
token according to RFC3161.NullPointerException - if token is nullpublic byte[] getDEREncoded()
throws TimeStampTokenException
TSPTimeStampTokengetDEREncoded in interface TSPTimeStampTokenTimeStampTokenExceptionTSPTimeStampToken.getDEREncoded()public iaik.tsp.TimeStampToken getTimeStampToken()
TimeStampTokenwrapped by this
TSPTimeStampTokenpublic String getTSAIdentifier()
TimeStampTokengetTSAIdentifier in interface TimeStampTokennull if the TSA's
identifier is not present in the time-stamp token.TimeStampToken.getTSAIdentifier()public X509Certificate getTSACertificate()
TimeStampTokengetTSACertificate in interface TimeStampTokennull if the TSA's
certificate is not present in the time-stamp token.TimeStampToken.getTSACertificate()public BigInteger getSerialNumber()
TimeStampTokengetSerialNumber in interface TimeStampTokenTimeStampToken.getSerialNumber()public Date getTime()
TimeStampTokengetTime in interface TimeStampTokenTimeStampToken.getTime()public long getAccuracy()
TimeStampTokenA negative value indicates that no accuracy is given in the time-stamp token.
getAccuracy in interface TimeStampTokenTimeStampToken.getAccuracy()public boolean validateSignature(X509Certificate cert) throws TimeStampTokenException
TimeStampTokenvalidateSignature in interface TimeStampTokencert - the X509 certificate of the TSA that issued this time-stamp token
(may be null if the certificate is present in the
time-stamp token)true if the time-stamp token was validated
successfully, otherwise falseTimeStampTokenException - if an unexpected exception occurs while validating the signature of
the time-stamp tokenTimeStampToken.validateSignature(java.security.cert.X509Certificate)public boolean validateHashValue(OctetStreamData data) throws TimeStampTokenException
TimeStampTokendata.validateHashValue in interface TimeStampTokendata - the data to compute the hash value from and validate it with the
hash value in the time-stamp tokentrue if the hash value in the time-stamp token is
equal to the hash-value computed from the supplied
data with the digest algorithm contained in the
time-stamp token, otherwise falseTimeStampTokenException - if an unexpected exception occurs while the validation of the
digest valueTimeStampToken.validateHashValue(javax.xml.crypto.OctetStreamData)© 2002-2005 IAIK, © 2004, 2006 - 2017 Stiftung SIC