public class CMSTimeStampedData extends Object
Constructor and Description |
---|
CMSTimeStampedData(byte[] baseData) |
CMSTimeStampedData(ContentInfo contentInfo) |
CMSTimeStampedData(InputStream in) |
Modifier and Type | Method and Description |
---|---|
CMSTimeStampedData |
addTimeStamp(TimeStampToken token)
Return a new timeStampedData object with the additional token attached.
|
byte[] |
calculateNextHash(DigestCalculator calculator) |
byte[] |
getContent() |
URI |
getDataUri() |
byte[] |
getEncoded() |
String |
getFileName() |
String |
getMediaType() |
DigestCalculator |
getMessageImprintDigestCalculator(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.
|
AttributeTable |
getOtherMetaData() |
TimeStampToken[] |
getTimeStampTokens() |
void |
initialiseMessageImprintDigestCalculator(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(DigestCalculatorProvider calculatorProvider,
byte[] dataDigest)
Validate the digests present in the TimeStampTokens contained in the CMSTimeStampedData.
|
void |
validate(DigestCalculatorProvider calculatorProvider,
byte[] dataDigest,
TimeStampToken timeStampToken)
Validate the passed in timestamp token against the tokens and data present in the message.
|
public CMSTimeStampedData(ContentInfo contentInfo)
public CMSTimeStampedData(InputStream in) throws IOException
IOException
public CMSTimeStampedData(byte[] baseData) throws IOException
IOException
public byte[] calculateNextHash(DigestCalculator calculator) throws CMSException
CMSException
public CMSTimeStampedData addTimeStamp(TimeStampToken token) throws CMSException
CMSException
public byte[] getContent()
public URI getDataUri() throws URISyntaxException
URISyntaxException
public String getFileName()
public String getMediaType()
public AttributeTable getOtherMetaData()
public TimeStampToken[] getTimeStampTokens() throws CMSException
CMSException
public void initialiseMessageImprintDigestCalculator(DigestCalculator calculator) throws CMSException
calculator
- the digest calculator to be initialised.CMSException
- if the MetaData is required and cannot be processedpublic DigestCalculator getMessageImprintDigestCalculator(DigestCalculatorProvider calculatorProvider) throws OperatorCreationException
calculatorProvider
- a provider of DigestCalculator objects.OperatorCreationException
- if the provider is unable to create the calculator.public void validate(DigestCalculatorProvider calculatorProvider, byte[] dataDigest) throws ImprintDigestInvalidException, CMSException
calculatorProvider
- provider for digest calculatorsdataDigest
- the calculated data digest for the messageImprintDigestInvalidException
- if an imprint digest fails to compareCMSException
- if an exception occurs processing the message.public void validate(DigestCalculatorProvider calculatorProvider, byte[] dataDigest, TimeStampToken timeStampToken) throws ImprintDigestInvalidException, CMSException
calculatorProvider
- provider for digest calculatorsdataDigest
- the calculated data digest for the message.timeStampToken
- the timestamp token of interest.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.public byte[] getEncoded() throws IOException
IOException
Copyright © 2015. All rights reserved.