Top Fields Constructors Methods
org.bouncycastle.tsp.cms

public Class CMSTimeStampedData

extends Object
Class Inheritance
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, java.net.URI, .URISyntaxException, org.bouncycastle.asn1.ASN1IA5String, .ASN1InputStream, org.bouncycastle.asn1.cms.AttributeTable, .CMSObjectIdentifiers, .ContentInfo, .Evidence, .TimeStampAndCRL, .TimeStampTokenEvidence, .TimeStampedData, org.bouncycastle.cms.CMSException, org.bouncycastle.operator.DigestCalculator, .DigestCalculatorProvider, .OperatorCreationException, org.bouncycastle.tsp.TimeStampToken

Field Summary

Modifier and TypeField and Description
private ContentInfo
private TimeStampedData
private TimeStampDataUtil

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
public CMSTimeStampedData
addTimeStamp(TimeStampToken token)

Return a new timeStampedData object with the additional token attached.

public byte[]
public byte[]
public URI
public byte[]
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
initialize(ContentInfo contentInfo)

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 java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contentInfoback to summary
private ContentInfo contentInfo
timeStampedDataback to summary
private TimeStampedData timeStampedData
utilback to summary
private TimeStampDataUtil util

Constructor Detail

CMSTimeStampedDataback to summary
public CMSTimeStampedData(ContentInfo contentInfo)
CMSTimeStampedDataback to summary
public CMSTimeStampedData(InputStream in) throws IOException
CMSTimeStampedDataback to summary
public CMSTimeStampedData(byte[] baseData) throws IOException

Method Detail

addTimeStampback to summary
public CMSTimeStampedData addTimeStamp(TimeStampToken token) throws CMSException

Return a new timeStampedData object with the additional token attached.

calculateNextHashback to summary
public byte[] calculateNextHash(DigestCalculator calculator) throws CMSException
getContentback to summary
public byte[] getContent()
getDataUriback to summary
public URI getDataUri() throws URISyntaxException
getEncodedback to summary
public byte[] getEncoded() throws IOException
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(ContentInfo contentInfo)
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.