Top Fields Constructors Methods
org.bouncycastle.tsp.cms

public Class CMSTimeStampedDataParser

extends CMSContentInfoParser
Class Inheritance
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, java.net.URI, .URISyntaxException, org.bouncycastle.asn1.BERTags, .DERIA5String, org.bouncycastle.asn1.cms.AttributeTable, .CMSObjectIdentifiers, .ContentInfoParser, .TimeStampedDataParser, org.bouncycastle.cms.CMSContentInfoParser, .CMSException, org.bouncycastle.operator.DigestCalculator, .DigestCalculatorProvider, .OperatorCreationException, org.bouncycastle.tsp.TimeStampToken, org.bouncycastle.util.io.Streams

Field Summary

Modifier and TypeField and Description
private TimeStampedDataParser
private TimeStampDataUtil
Inherited from org.bouncycastle.cms.CMSContentInfoParser:
_contentInfo_data

Constructor Summary

AccessConstructor and Description
public
public
CMSTimeStampedDataParser(byte[] baseData)

Method Summary

Modifier and TypeMethod and Description
public byte[]
public InputStream
public URI
public String
public String
public DigestCalculator

Returns:

an initialised digest calculator.
getMessageImprintDigestCalculator
(DigestCalculatorProvider
a provider of DigestCalculator objects.
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.

public AttributeTable
public TimeStampToken[]
public void
initialiseMessageImprintDigestCalculator(DigestCalculator
the digest calculator to be initialised.
calculator
)

Initialise the passed in calculator with the MetaData for this message, if it is required as part of the initial message imprint calculation.

private void
private void
public void
validate(DigestCalculatorProvider
provider for digest calculators
calculatorProvider
,
byte[]
the calculated data digest for the message
dataDigest
)

Validate the digests present in the TimeStampTokens contained in the CMSTimeStampedData.

public void
validate(DigestCalculatorProvider
provider for digest calculators
calculatorProvider
,
byte[]
the calculated data digest for the message.
dataDigest
,
TimeStampToken
the timestamp token of interest.
timeStampToken
)

Validate the passed in timestamp token against the tokens and data present in the message.

Inherited from org.bouncycastle.cms.CMSContentInfoParser:
close

Field Detail

timeStampedDataback to summary
private TimeStampedDataParser timeStampedData
utilback to summary
private TimeStampDataUtil util

Constructor Detail

CMSTimeStampedDataParserback to summary
public CMSTimeStampedDataParser(InputStream in) throws CMSException
CMSTimeStampedDataParserback to summary
public CMSTimeStampedDataParser(byte[] baseData) throws CMSException

Method Detail

calculateNextHashback to summary
public byte[] calculateNextHash(DigestCalculator calculator) throws CMSException
getContentback to summary
public InputStream getContent()
getDataUriback to summary
public URI getDataUri() throws URISyntaxException
getFileNameback to summary
public String getFileName()
getMediaTypeback to summary
public String getMediaType()
getMessageImprintDigestCalculatorback to summary
public DigestCalculator getMessageImprintDigestCalculator(DigestCalculatorProvider calculatorProvider) throws 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:DigestCalculatorProvider

a provider of DigestCalculator objects.

Returns:DigestCalculator

an initialised digest calculator.

Exceptions
OperatorCreationException:
if the provider is unable to create the calculator.
getOtherMetaDataback to summary
public AttributeTable getOtherMetaData()
getTimeStampTokensback to summary
public TimeStampToken[] getTimeStampTokens() throws CMSException
initialiseMessageImprintDigestCalculatorback to summary
public void initialiseMessageImprintDigestCalculator(DigestCalculator calculator) throws 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:DigestCalculator

the digest calculator to be initialised.

Exceptions
CMSException:
if the MetaData is required and cannot be processed
initializeback to summary
private void initialize(ContentInfoParser contentInfo) throws CMSException
parseTimeStampsback to summary
private void parseTimeStamps() throws CMSException
validateback to summary
public void validate(DigestCalculatorProvider calculatorProvider, byte[] dataDigest) throws ImprintDigestInvalidException, CMSException

Validate the digests present in the TimeStampTokens contained in the CMSTimeStampedData.

Parameters
calculatorProvider:DigestCalculatorProvider

provider for digest calculators

dataDigest:byte[]

the calculated data digest for the message

Exceptions
ImprintDigestInvalidException:
if an imprint digest fails to compare
CMSException:
if an exception occurs processing the message.
validateback to summary
public void validate(DigestCalculatorProvider calculatorProvider, byte[] dataDigest, TimeStampToken timeStampToken) throws ImprintDigestInvalidException, CMSException

Validate the passed in timestamp token against the tokens and data present in the message.

Parameters
calculatorProvider:DigestCalculatorProvider

provider for digest calculators

dataDigest:byte[]

the calculated data digest for the message.

timeStampToken:TimeStampToken

the timestamp token of interest.

Exceptions
ImprintDigestInvalidException:
if the token is not present in the message, or an imprint digest fails to compare.
CMSException:
if an exception occurs processing the message.