本文整理汇总了Java中eu.europa.esig.dss.x509.tsp.TSPSource类的典型用法代码示例。如果您正苦于以下问题:Java TSPSource类的具体用法?Java TSPSource怎么用?Java TSPSource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TSPSource类属于eu.europa.esig.dss.x509.tsp包,在下文中一共展示了TSPSource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testValidator
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
@Test
public void testValidator() throws Exception {
TSPSource tspSource = getGoodTsa();
byte[] data = new byte[] { 1, 2, 3 };
TimeStampToken timeStampResponse = tspSource.getTimeStampResponse(DigestAlgorithm.SHA256, DSSUtils.digest(DigestAlgorithm.SHA256, data));
CMSTimestampValidator validator = new CMSTimestampValidator(new InMemoryDocument(timeStampResponse.getEncoded()));
validator.setTimestampedData(new InMemoryDocument(data));
validator.setCertificateVerifier(getCompleteCertificateVerifier());
assertTrue(Utils.isCollectionEmpty(validator.getSignatures()));
TimestampToken timestamp = validator.getTimestamp();
assertNotNull(timestamp);
assertTrue(timestamp.isMessageImprintDataFound());
assertTrue(timestamp.isMessageImprintDataIntact());
}
示例2: tspSource
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
@Bean
public TSPSource tspSource() {
OnlineTSPSource onlineTSPSource = new OnlineTSPSource();
onlineTSPSource.setDataLoader(timestampDataLoader());
onlineTSPSource.setTspServer(tsaUrl);
return onlineTSPSource;
}
示例3: TimestampService
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
/**
* Basic constructor, new CertificatePool created
*
* @param tspSource
* The TSPSource to be used for the Timestamp generation
*/
public TimestampService(final TSPSource tspSource) {
if (tspSource == null) {
throw new NullPointerException();
}
this.tspSource = tspSource;
certificatePool = new CertificatePool();
xPathQueryHolder = new XPathQueryHolder();
}
示例4: CAdESSignatureExtension
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
/**
* @param signatureTsa
* @param onlyLastCMSSignature
* true if only the last signature must be extended, otherwise all signatures are extended
*/
public CAdESSignatureExtension(final TSPSource signatureTsa, final boolean onlyLastCMSSignature) {
this.signatureTsa = signatureTsa;
this.onlyLastCMSSignature = onlyLastCMSSignature;
if (signatureTsa == null) {
throw new DSSConfigurationException(DSSConfigurationException.MSG.CONFIGURE_TSP_SERVER);
}
}
示例5: timestamp
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
@Override
public void timestamp(final DSSDocument document, final OutputStream signedStream, final PAdESSignatureParameters parameters, final TSPSource tspSource)
throws DSSException {
final DigestAlgorithm timestampDigestAlgorithm = parameters.getSignatureTimestampParameters().getDigestAlgorithm();
InputStream inputStream = document.openStream();
final byte[] digest = digest(inputStream, parameters, timestampDigestAlgorithm);
Utils.closeQuietly(inputStream);
final TimeStampToken timeStampToken = tspSource.getTimeStampResponse(timestampDigestAlgorithm, digest);
final byte[] encoded = DSSASN1Utils.getEncoded(timeStampToken);
inputStream = document.openStream();
sign(inputStream, encoded, signedStream, parameters, timestampDigestAlgorithm);
Utils.closeQuietly(inputStream);
}
示例6: getSignatureTsa
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
/**
* @return the TSA used for the signature-time-stamp attribute
*/
public TSPSource getSignatureTsa() {
return signatureTsa;
}
示例7: getTimeStampAttributeValue
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
protected ASN1Object getTimeStampAttributeValue(TSPSource tspSource, byte[] message, CAdESSignatureParameters parameters) {
final DigestAlgorithm timestampDigestAlgorithm = parameters.getSignatureTimestampParameters().getDigestAlgorithm();
ASN1Object signatureTimeStampValue = getTimeStampAttributeValue(tspSource, message, timestampDigestAlgorithm);
return signatureTimeStampValue;
}
示例8: CAdESLevelBaselineLT
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
public CAdESLevelBaselineLT(TSPSource signatureTsa, CertificateVerifier certificateVerifier, boolean onlyLastSigner) {
super(signatureTsa, onlyLastSigner);
this.certificateVerifier = certificateVerifier;
cadesProfileT = new CAdESLevelBaselineT(signatureTsa, onlyLastSigner);
}
示例9: CAdESLevelBaselineT
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
public CAdESLevelBaselineT(TSPSource signatureTsa, boolean onlyLastCMSSignature) {
super(signatureTsa, onlyLastCMSSignature);
}
示例10: CAdESLevelBaselineLTA
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
public CAdESLevelBaselineLTA(TSPSource signatureTsa, CertificateVerifier certificateVerifier, boolean onlyLastSigner) {
super(signatureTsa, onlyLastSigner);
cadesProfileLT = new CAdESLevelBaselineLT(signatureTsa, certificateVerifier, onlyLastSigner);
this.certificateVerifier = certificateVerifier;
}
示例11: setTspSource
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
@Override
public void setTspSource(final TSPSource tspSource) {
this.tspSource = tspSource;
}
示例12: PAdESLevelBaselineT
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
public PAdESLevelBaselineT(TSPSource tspSource) {
this.tspSource = tspSource;
}
示例13: PAdESLevelBaselineLT
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
PAdESLevelBaselineLT(final TSPSource tspSource, final CertificateVerifier certificateVerifier) {
this.certificateVerifier = certificateVerifier;
this.tspSource = tspSource;
}
示例14: PAdESLevelBaselineLTA
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
public PAdESLevelBaselineLTA(TSPSource tspSource, CertificateVerifier certificateVerifier) {
padesLevelBaselineLT = new PAdESLevelBaselineLT(tspSource, certificateVerifier);
padesLevelBaselineT = new PAdESLevelBaselineT(tspSource);
this.certificateVerifier = certificateVerifier;
}
示例15: ContentTimestampGenerator
import eu.europa.esig.dss.x509.tsp.TSPSource; //导入依赖的package包/类
/**
* @param tspSource the timestamping authority
* @param certificatePool
*/
public ContentTimestampGenerator(final TSPSource tspSource, final CertificatePool certificatePool) {
this.tspSource = tspSource;
this.certificatePool = certificatePool;
}