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 null
public 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 null
public byte[] getDEREncoded() throws TimeStampTokenException
TSPTimeStampToken
getDEREncoded
in interface TSPTimeStampToken
TimeStampTokenException
TSPTimeStampToken.getDEREncoded()
public iaik.tsp.TimeStampToken getTimeStampToken()
TimeStampToken
wrapped by this
TSPTimeStampToken
public String getTSAIdentifier()
TimeStampToken
getTSAIdentifier
in interface TimeStampToken
null
if the TSA's
identifier is not present in the time-stamp token.TimeStampToken.getTSAIdentifier()
public X509Certificate getTSACertificate()
TimeStampToken
getTSACertificate
in interface TimeStampToken
null
if the TSA's
certificate is not present in the time-stamp token.TimeStampToken.getTSACertificate()
public BigInteger getSerialNumber()
TimeStampToken
getSerialNumber
in interface TimeStampToken
TimeStampToken.getSerialNumber()
public Date getTime()
TimeStampToken
getTime
in interface TimeStampToken
TimeStampToken.getTime()
public long getAccuracy()
TimeStampToken
A negative value indicates that no accuracy is given in the time-stamp token.
getAccuracy
in interface TimeStampToken
TimeStampToken.getAccuracy()
public boolean validateSignature(X509Certificate cert) throws TimeStampTokenException
TimeStampToken
validateSignature
in interface TimeStampToken
cert
- 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 false
TimeStampTokenException
- 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
TimeStampToken
data
.validateHashValue
in interface TimeStampToken
data
- 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 false
TimeStampTokenException
- 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