org.bouncycastle.tsp

Class TimeStampRequest

public class TimeStampRequest extends Object implements X509Extension

Base class for an RFC 3161 Time Stamp Request.
Constructor Summary
TimeStampRequest(TimeStampReq req)
TimeStampRequest(byte[] req)
Create a TimeStampRequest from the past in byte array.
TimeStampRequest(InputStream in)
Create a TimeStampRequest from the past in input stream.
Method Summary
booleangetCertReq()
SetgetCriticalExtensionOIDs()
byte[]getEncoded()
return the ASN.1 encoded representation of this object.
byte[]getExtensionValue(String oid)
StringgetMessageImprintAlgOID()
byte[]getMessageImprintDigest()
BigIntegergetNonce()
SetgetNonCriticalExtensionOIDs()
StringgetReqPolicy()
intgetVersion()
booleanhasUnsupportedCriticalExtension()
voidvalidate(Set algorithms, Set policies, Set extensions, String provider)
Validate the timestamp request, checking the digest to see if it is of an accepted type and whether it is of the correct length for the algorithm specified.

Constructor Detail

TimeStampRequest

public TimeStampRequest(TimeStampReq req)

TimeStampRequest

public TimeStampRequest(byte[] req)
Create a TimeStampRequest from the past in byte array.

Parameters: req byte array containing the request.

Throws: IOException if the request is malformed.

TimeStampRequest

public TimeStampRequest(InputStream in)
Create a TimeStampRequest from the past in input stream.

Parameters: in input stream containing the request.

Throws: IOException if the request is malformed.

Method Detail

getCertReq

public boolean getCertReq()

getCriticalExtensionOIDs

public Set getCriticalExtensionOIDs()

getEncoded

public byte[] getEncoded()
return the ASN.1 encoded representation of this object.

getExtensionValue

public byte[] getExtensionValue(String oid)

getMessageImprintAlgOID

public String getMessageImprintAlgOID()

getMessageImprintDigest

public byte[] getMessageImprintDigest()

getNonce

public BigInteger getNonce()

getNonCriticalExtensionOIDs

public Set getNonCriticalExtensionOIDs()

getReqPolicy

public String getReqPolicy()

getVersion

public int getVersion()

hasUnsupportedCriticalExtension

public boolean hasUnsupportedCriticalExtension()

validate

public void validate(Set algorithms, Set policies, Set extensions, String provider)
Validate the timestamp request, checking the digest to see if it is of an accepted type and whether it is of the correct length for the algorithm specified.

Parameters: algorithms a set of String OIDS giving accepted algorithms. policies if non-null a set of policies we are willing to sign under. extensions if non-null a set of extensions we are willing to accept. provider the provider to confirm the digest size against.

Throws: TSPException if the request is invalid, or processing fails.