Top Fields Constructors Methods
org.bouncycastle.tsp

public Class TSPUtil

extends Object
Class Inheritance
Imports
java.io.IOException, .OutputStream, java.util.ArrayList, .Collection, .Collections, .HashMap, .List, .Map, org.bouncycastle.asn1.ASN1Encodable, .ASN1EncodableVector, .ASN1ObjectIdentifier, .ASN1Set, org.bouncycastle.asn1.cms.Attribute, .AttributeTable, .ContentInfo, org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers, org.bouncycastle.asn1.gm.GMObjectIdentifiers, org.bouncycastle.asn1.nist.NISTObjectIdentifiers, org.bouncycastle.asn1.oiw.OIWObjectIdentifiers, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, org.bouncycastle.asn1.rosstandart.RosstandartObjectIdentifiers, org.bouncycastle.asn1.teletrust.TeleTrusTObjectIdentifiers, org.bouncycastle.asn1.x509.ExtendedKeyUsage, .Extension, .Extensions, .ExtensionsGenerator, .KeyPurposeId, org.bouncycastle.cert.X509CertificateHolder, org.bouncycastle.cms.SignerInformation, org.bouncycastle.operator.DigestCalculator, .DigestCalculatorProvider, .OperatorCreationException, org.bouncycastle.util.Arrays, .Integers

Field Summary

Modifier and TypeField and Description
private static final Map<K, V>
private static final Map<K, V>
private static List<E>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
addExtension(ExtensionsGenerator extGenerator, ASN1ObjectIdentifier oid, boolean isCritical, ASN1Encodable value)

pack-priv static int
getDigestLength(String digestAlgOID)

pack-priv static List<E>
public static Collection<E>

Returns:

a collection of TimeStampToken objects
getSignatureTimestamps
(SignerInformation
a SignerInformation to search for time-stamps
signerInfo
,
DigestCalculatorProvider
provider for digest calculators
digCalcProvider
)

Fetches the signature time-stamp attributes from a SignerInformation object.

public static void
validateCertificate(X509CertificateHolder
the certificate of interest.
cert
)

Validate the passed in certificate as being of the correct type to be used for time stamping.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

digestLengthsback to summary
private static final Map<K, V> digestLengths
digestNamesback to summary
private static final Map<K, V> digestNames
EMPTY_LISTback to summary
private static List<E> EMPTY_LIST

Constructor Detail

TSPUtilback to summary
public TSPUtil()

Method Detail

addExtensionback to summary
pack-priv static void addExtension(ExtensionsGenerator extGenerator, ASN1ObjectIdentifier oid, boolean isCritical, ASN1Encodable value) throws TSPIOException
getDigestLengthback to summary
pack-priv static int getDigestLength(String digestAlgOID) throws TSPException
getExtensionOIDsback to summary
pack-priv static List<E> getExtensionOIDs(Extensions extensions)
getSignatureTimestampsback to summary
public static Collection<E> getSignatureTimestamps(SignerInformation signerInfo, DigestCalculatorProvider digCalcProvider) throws TSPValidationException

Fetches the signature time-stamp attributes from a SignerInformation object. Checks that the MessageImprint for each time-stamp matches the signature field. (see RFC 3161 Appendix A).

Parameters
signerInfo:SignerInformation

a SignerInformation to search for time-stamps

digCalcProvider:DigestCalculatorProvider

provider for digest calculators

Returns:Collection<E>

a collection of TimeStampToken objects

validateCertificateback to summary
public static void validateCertificate(X509CertificateHolder cert) throws TSPValidationException

Validate the passed in certificate as being of the correct type to be used for time stamping. To be valid it must have an ExtendedKeyUsage extension which has a key purpose identifier of id-kp-timeStamping.

Parameters
cert:X509CertificateHolder

the certificate of interest.

Exceptions
TSPValidationException:
if the certificate fails on one of the check points.