|
Bouncy Castle Cryptography Library 1.87 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.bouncycastle.cms.CMSContentInfoParser
org.bouncycastle.tsp.cms.CMSTimeStampedDataParser
Streaming parser for an RFC 5544 TimeStampedData object. It exposes the dataUri,
MetaData and (streamed) content of the time-stamped document together with the
Evidence chain of RFC 3161 time stamp tokens, reading from the supplied stream
lazily rather than buffering the whole structure as CMSTimeStampedData does.
The encapsulated content is drained from getContent() before the trailing
evidence block can be parsed; the methods that need the time stamps
(getTimeStampTokens(), getMessageImprintDigestCalculator(org.bouncycastle.operator.DigestCalculatorProvider), the
methods) drain it automatically. The supplied InputStream is closed
only when CMSContentInfoParser.close() (inherited from CMSContentInfoParser) is invoked.
| Field Summary |
| Fields inherited from class org.bouncycastle.cms.CMSContentInfoParser |
_contentInfo, _data |
| Constructor Summary | |
CMSTimeStampedDataParser(byte[] baseData)
|
|
CMSTimeStampedDataParser(java.io.InputStream in)
|
|
| Method Summary | |
byte[] |
calculateNextHash(DigestCalculator calculator)
Calculate the hash over the last time stamp element in the evidence chain, as required to obtain the next time stamp token that extends the chain (per RFC 5544 each token is computed over its preceding element). |
java.io.InputStream |
getContent()
Return a stream over the encapsulated content, if present. |
java.net.URI |
getDataUri()
Return the dataUri referencing the time-stamped document, if present. |
java.lang.String |
getFileName()
|
java.lang.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. |
org.bouncycastle.asn1.cms.AttributeTable |
getOtherMetaData()
|
TimeStampToken[] |
getTimeStampTokens()
Return the time stamp tokens making up the evidence chain, in order. |
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. |
| Methods inherited from class org.bouncycastle.cms.CMSContentInfoParser |
close, isBEREncoded |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CMSTimeStampedDataParser(java.io.InputStream in)
throws CMSException
public CMSTimeStampedDataParser(byte[] baseData)
throws CMSException
| Method Detail |
public byte[] calculateNextHash(DigestCalculator calculator)
throws CMSException
calculator - the digest calculator to use.
CMSException - if the hash cannot be calculated.public java.io.InputStream getContent()
public java.net.URI getDataUri()
throws java.net.URISyntaxException
java.net.URISyntaxException - if the stored value is not a valid URI.public java.lang.String getFileName()
public java.lang.String getMediaType()
public org.bouncycastle.asn1.cms.AttributeTable getOtherMetaData()
public void initialiseMessageImprintDigestCalculator(DigestCalculator calculator)
throws CMSException
calculator - the digest calculator to be initialised.
CMSException - if the MetaData is required and cannot be processed
public DigestCalculator getMessageImprintDigestCalculator(DigestCalculatorProvider calculatorProvider)
throws OperatorCreationException
calculatorProvider - a provider of DigestCalculator objects.
OperatorCreationException - if the provider is unable to create the calculator.
public TimeStampToken[] getTimeStampTokens()
throws CMSException
CMSException - if the evidence block cannot be parsed.
public void validate(DigestCalculatorProvider calculatorProvider,
byte[] dataDigest)
throws ImprintDigestInvalidException,
CMSException
calculatorProvider - provider for digest calculatorsdataDigest - the calculated data digest for the message
ImprintDigestInvalidException - if an imprint digest fails to compare
CMSException - 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.
|
Bouncy Castle Cryptography Library 1.87 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||