org.bouncycastle.tsp.cms
Class CMSTimeStampedDataParser
java.lang.Object
org.bouncycastle.cms.CMSContentInfoParser
org.bouncycastle.tsp.cms.CMSTimeStampedDataParser
public class CMSTimeStampedDataParser
- extends org.bouncycastle.cms.CMSContentInfoParser
Fields inherited from class org.bouncycastle.cms.CMSContentInfoParser |
_contentInfo, _data |
Method Summary |
byte[] |
calculateNextHash(org.bouncycastle.operator.DigestCalculator calculator)
|
java.io.InputStream |
getContent()
|
java.net.URI |
getDataUri()
|
java.lang.String |
getFileName()
|
java.lang.String |
getMediaType()
|
org.bouncycastle.operator.DigestCalculator |
getMessageImprintDigestCalculator(org.bouncycastle.operator.DigestCalculatorProvider calculatorProvider)
Returns an appropriately initialised digest calculator based on the message imprint algorithm
described in the first time stamp in the TemporalData for this message. |
org.bouncycastle.asn1.cms.AttributeTable |
getOtherMetaData()
|
TimeStampToken[] |
getTimeStampTokens()
|
void |
initialiseMessageImprintDigestCalculator(org.bouncycastle.operator.DigestCalculator calculator)
Initialise the passed in calculator with the MetaData for this message, if it is
required as part of the initial message imprint calculation. |
void |
validate(org.bouncycastle.operator.DigestCalculatorProvider calculatorProvider,
byte[] dataDigest)
Validate the digests present in the TimeStampTokens contained in the CMSTimeStampedData. |
void |
validate(org.bouncycastle.operator.DigestCalculatorProvider calculatorProvider,
byte[] dataDigest,
TimeStampToken timeStampToken)
Validate the passed in timestamp token against the tokens and data present in the message. |
Methods inherited from class org.bouncycastle.cms.CMSContentInfoParser |
close |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CMSTimeStampedDataParser
public CMSTimeStampedDataParser(java.io.InputStream in)
throws org.bouncycastle.cms.CMSException
- Throws:
org.bouncycastle.cms.CMSException
CMSTimeStampedDataParser
public CMSTimeStampedDataParser(byte[] baseData)
throws org.bouncycastle.cms.CMSException
- Throws:
org.bouncycastle.cms.CMSException
calculateNextHash
public byte[] calculateNextHash(org.bouncycastle.operator.DigestCalculator calculator)
throws org.bouncycastle.cms.CMSException
- Throws:
org.bouncycastle.cms.CMSException
getContent
public java.io.InputStream getContent()
getDataUri
public java.net.URI getDataUri()
throws java.net.URISyntaxException
- Throws:
java.net.URISyntaxException
getFileName
public java.lang.String getFileName()
getMediaType
public java.lang.String getMediaType()
getOtherMetaData
public org.bouncycastle.asn1.cms.AttributeTable getOtherMetaData()
initialiseMessageImprintDigestCalculator
public void initialiseMessageImprintDigestCalculator(org.bouncycastle.operator.DigestCalculator calculator)
throws org.bouncycastle.cms.CMSException
- Initialise the passed in calculator with the MetaData for this message, if it is
required as part of the initial message imprint calculation.
- Parameters:
calculator
- the digest calculator to be initialised.
- Throws:
org.bouncycastle.cms.CMSException
- if the MetaData is required and cannot be processed
getMessageImprintDigestCalculator
public org.bouncycastle.operator.DigestCalculator getMessageImprintDigestCalculator(org.bouncycastle.operator.DigestCalculatorProvider calculatorProvider)
throws org.bouncycastle.operator.OperatorCreationException
- Returns an appropriately initialised digest calculator based on the message imprint algorithm
described in the first time stamp in the TemporalData for this message. If the metadata is required
to be included in the digest calculation, the returned calculator will be pre-initialised.
- Parameters:
calculatorProvider
- a provider of DigestCalculator objects.
- Returns:
- an initialised digest calculator.
- Throws:
org.bouncycastle.operator.OperatorCreationException
- if the provider is unable to create the calculator.
getTimeStampTokens
public TimeStampToken[] getTimeStampTokens()
throws org.bouncycastle.cms.CMSException
- Throws:
org.bouncycastle.cms.CMSException
validate
public void validate(org.bouncycastle.operator.DigestCalculatorProvider calculatorProvider,
byte[] dataDigest)
throws ImprintDigestInvalidException,
org.bouncycastle.cms.CMSException
- Validate the digests present in the TimeStampTokens contained in the CMSTimeStampedData.
- Parameters:
calculatorProvider
- provider for digest calculatorsdataDigest
- the calculated data digest for the message
- Throws:
ImprintDigestInvalidException
- if an imprint digest fails to compare
org.bouncycastle.cms.CMSException
- if an exception occurs processing the message.
validate
public void validate(org.bouncycastle.operator.DigestCalculatorProvider calculatorProvider,
byte[] dataDigest,
TimeStampToken timeStampToken)
throws ImprintDigestInvalidException,
org.bouncycastle.cms.CMSException
- Validate the passed in timestamp token against the tokens and data present in the message.
- Parameters:
calculatorProvider
- provider for digest calculatorsdataDigest
- the calculated data digest for the message.timeStampToken
- the timestamp token of interest.
- Throws:
ImprintDigestInvalidException
- if the token is not present in the message, or an imprint digest fails to compare.
org.bouncycastle.cms.CMSException
- if an exception occurs processing the message.