Package org.bouncycastle.tsp
Class TimeStampRequest
- java.lang.Object
-
- org.bouncycastle.tsp.TimeStampRequest
-
public class TimeStampRequest extends java.lang.ObjectBase class for an RFC 3161 Time Stamp Request.
-
-
Constructor Summary
Constructors Constructor Description TimeStampRequest(byte[] req)Create a TimeStampRequest from the past in byte array.TimeStampRequest(java.io.InputStream in)Create a TimeStampRequest from the past in input stream.TimeStampRequest(org.bouncycastle.asn1.tsp.TimeStampReq req)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetCertReq()java.util.SetgetCriticalExtensionOIDs()Returns a set of ASN1ObjectIdentifiers giving the critical extensions.byte[]getEncoded()return the ASN.1 encoded representation of this object.org.bouncycastle.asn1.x509.ExtensiongetExtension(org.bouncycastle.asn1.ASN1ObjectIdentifier oid)java.util.ListgetExtensionOIDs()org.bouncycastle.asn1.ASN1ObjectIdentifiergetMessageImprintAlgOID()byte[]getMessageImprintDigest()java.math.BigIntegergetNonce()java.util.SetgetNonCriticalExtensionOIDs()Returns a set of ASN1ObjectIdentifiers giving the non-critical extensions.org.bouncycastle.asn1.ASN1ObjectIdentifiergetReqPolicy()intgetVersion()booleanhasExtensions()voidvalidate(java.util.Set algorithms, java.util.Set policies, java.util.Set extensions)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(org.bouncycastle.asn1.tsp.TimeStampReq req)
-
TimeStampRequest
public TimeStampRequest(byte[] req) throws java.io.IOExceptionCreate a TimeStampRequest from the past in byte array.- Parameters:
req- byte array containing the request.- Throws:
java.io.IOException- if the request is malformed.
-
TimeStampRequest
public TimeStampRequest(java.io.InputStream in) throws java.io.IOExceptionCreate a TimeStampRequest from the past in input stream.- Parameters:
in- input stream containing the request.- Throws:
java.io.IOException- if the request is malformed.
-
-
Method Detail
-
getVersion
public int getVersion()
-
getMessageImprintAlgOID
public org.bouncycastle.asn1.ASN1ObjectIdentifier getMessageImprintAlgOID()
-
getMessageImprintDigest
public byte[] getMessageImprintDigest()
-
getReqPolicy
public org.bouncycastle.asn1.ASN1ObjectIdentifier getReqPolicy()
-
getNonce
public java.math.BigInteger getNonce()
-
getCertReq
public boolean getCertReq()
-
validate
public void validate(java.util.Set algorithms, java.util.Set policies, java.util.Set extensions) throws TSPExceptionValidate 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 OIDs giving accepted algorithms.policies- if non-null a set of policies OIDs we are willing to sign under.extensions- if non-null a set of extensions OIDs we are willing to accept.- Throws:
TSPException- if the request is invalid, or processing fails.
-
getEncoded
public byte[] getEncoded() throws java.io.IOExceptionreturn the ASN.1 encoded representation of this object.- Returns:
- the default ASN,1 byte encoding for the object.
- Throws:
java.io.IOException
-
hasExtensions
public boolean hasExtensions()
-
getExtension
public org.bouncycastle.asn1.x509.Extension getExtension(org.bouncycastle.asn1.ASN1ObjectIdentifier oid)
-
getExtensionOIDs
public java.util.List getExtensionOIDs()
-
getNonCriticalExtensionOIDs
public java.util.Set getNonCriticalExtensionOIDs()
Returns a set of ASN1ObjectIdentifiers giving the non-critical extensions.- Returns:
- a set of ASN1ObjectIdentifiers.
-
getCriticalExtensionOIDs
public java.util.Set getCriticalExtensionOIDs()
Returns a set of ASN1ObjectIdentifiers giving the critical extensions.- Returns:
- a set of ASN1ObjectIdentifiers.
-
-