本文整理汇总了Java中eu.europa.esig.dss.utils.Utils.areStringsEqual方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.areStringsEqual方法的具体用法?Java Utils.areStringsEqual怎么用?Java Utils.areStringsEqual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eu.europa.esig.dss.utils.Utils
的用法示例。
在下文中一共展示了Utils.areStringsEqual方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCertificateIdByDigest
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
private String getCertificateIdByDigest(XmlDigestAlgoAndValue digestAlgoValue, DiagnosticData diagnosticData) {
List<CertificateWrapper> certificates = diagnosticData.getUsedCertificates();
if (Utils.isCollectionNotEmpty(certificates)) {
for (CertificateWrapper certificate : certificates) {
List<XmlDigestAlgoAndValue> digestAlgAndValues = certificate.getDigestAlgoAndValues();
if (Utils.isCollectionNotEmpty(digestAlgAndValues)) {
for (XmlDigestAlgoAndValue certificateDigestAndValue : digestAlgAndValues) {
if (Utils.areStringsEqual(certificateDigestAndValue.getDigestMethod(), digestAlgoValue.getDigestMethod())
&& Utils.areStringsEqual(certificateDigestAndValue.getDigestValue(), digestAlgoValue.getDigestValue())) {
return certificate.getId();
}
}
}
}
}
return null;
}
示例2: getOriginalDocuments
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
@Override
public List<DSSDocument> getOriginalDocuments(final String signatureId) throws DSSException {
if (Utils.isStringBlank(signatureId)) {
throw new NullPointerException("signatureId");
}
List<DSSDocument> results = new ArrayList<DSSDocument>();
for (final Object signerInformationObject : cmsSignedData.getSignerInfos().getSigners()) {
final SignerInformation signerInformation = (SignerInformation) signerInformationObject;
final CAdESSignature cadesSignature = new CAdESSignature(cmsSignedData, signerInformation, validationCertPool);
cadesSignature.setSignatureFilename(document.getName());
cadesSignature.setDetachedContents(detachedContents);
cadesSignature.setProvidedSigningCertificateToken(providedSigningCertificateToken);
if (Utils.areStringsEqual(cadesSignature.getId(), signatureId)) {
results.add(new InMemoryDocument(cadesSignature.getOriginalDocumentStream()));
}
}
return results;
}
示例3: validate
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
@Override
public void validate() {
setIdentified(true);
SignaturePolicy signaturePolicy = getSignaturePolicy();
String digestValue = signaturePolicy.getDigestValue();
DigestAlgorithm signPolicyHashAlgFromSignature = signaturePolicy.getDigestAlgorithm();
String recalculatedDigestValue = Utils.toBase64(DSSUtils.digest(signPolicyHashAlgFromSignature, signaturePolicy.getPolicyContent()));
if (Utils.areStringsEqual(digestValue, recalculatedDigestValue)) {
setStatus(true);
setDigestAlgorithmsEqual(true);
} else {
addError("general",
"The policy digest value (" + digestValue + ") does not match the re-calculated digest value (" + recalculatedDigestValue + ").");
}
}
示例4: getLinkedManifest
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
public DSSDocument getLinkedManifest() {
String expectedSignatureURI = signature.getName();
for (DSSDocument manifestDocument : manifestDocuments) {
try (InputStream is = manifestDocument.openStream()) {
Document manifestDom = DomUtils.buildDOM(is);
Element root = DomUtils.getElement(manifestDom, ASiCNamespace.ASIC_MANIFEST);
String signatureURI = DomUtils.getValue(root, ASiCNamespace.SIG_REFERENCE_URI);
if (Utils.areStringsEqual(expectedSignatureURI, signatureURI) && checkManifestDigests(root)) {
return manifestDocument;
}
} catch (Exception e) {
LOG.warn("Unable to analyze manifest file '" + manifestDocument.getName() + "' : " + e.getMessage());
}
}
return null;
}
示例5: getTimestampValidationById
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
private XmlValidationProcessTimestamps getTimestampValidationById(String timestampId) {
List<XmlSignature> signatures = jaxbDetailedReport.getSignatures();
if (Utils.isCollectionNotEmpty(signatures)) {
for (XmlSignature xmlSignature : signatures) {
List<XmlValidationProcessTimestamps> validationTimestamps = xmlSignature.getValidationProcessTimestamps();
if (Utils.isCollectionNotEmpty(validationTimestamps)) {
for (XmlValidationProcessTimestamps tspValidation : validationTimestamps) {
if (Utils.areStringsEqual(tspValidation.getId(), timestampId)) {
return tspValidation;
}
}
}
}
}
return null;
}
示例6: getTimestampByIdNullSafe
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
private TimestampWrapper getTimestampByIdNullSafe(String id) {
List<SignatureWrapper> signatures = getSignatures();
for (SignatureWrapper signatureWrapper : signatures) {
List<TimestampWrapper> timestampList = signatureWrapper.getTimestampList();
for (TimestampWrapper timestampWrapper : timestampList) {
if (Utils.areStringsEqual(id, timestampWrapper.getId())) {
return timestampWrapper;
}
}
}
return new TimestampWrapper(new XmlTimestamp());
}
示例7: getPivotUris
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
private List<String> getPivotUris(TSLParserResult parseResult) {
List<String> pivotUris = new LinkedList<String>();
LinkedList<String> englishSchemeInformationURIs = (LinkedList<String>) parseResult.getEnglishSchemeInformationURIs();
// Pivots order is current T, T-1, T-2,...
Iterator<String> itr = englishSchemeInformationURIs.descendingIterator();
while (itr.hasNext()) {
String uri = itr.next();
if (!Utils.areStringsEqual(ojUrl, uri) && !uri.startsWith(lotlRootSchemeInfoUri)) {
pivotUris.add(uri);
}
}
return pivotUris;
}
示例8: isLastVersion
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
private boolean isLastVersion(TSLValidationModel validationModel, TSLLoaderResult resultLoader) {
if (validationModel == null) {
return false;
} else {
// TODO Best place ? Download didn't work, we use previous version
if (Utils.isArrayEmpty(resultLoader.getContent())) {
return true;
}
validationModel.setUrl(resultLoader.getUrl());
validationModel.setLoadedDate(new Date());
String lastSha256 = getSHA256(resultLoader.getContent());
return Utils.areStringsEqual(lastSha256, validationModel.getSha256FileContent());
}
}
示例9: getCoveredFilesBySignatureFilename
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
private List<String> getCoveredFilesBySignatureFilename(String signatureFilename) {
List<XmlManifestFile> manifestFiles = containerInfo.getManifestFiles();
for (XmlManifestFile xmlManifestFile : manifestFiles) {
if (Utils.areStringsEqual(signatureFilename, xmlManifestFile.getSignatureFilename())) {
return xmlManifestFile.getEntries();
}
}
return new ArrayList<String>();
}
示例10: getPotentialSigners
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
private List<CertificateToken> getPotentialSigners(List<TSLPointer> pointers, String countryCode) {
if (Utils.isCollectionNotEmpty(pointers)) {
for (TSLPointer tslPointer : pointers) {
if (Utils.areStringsEqual(countryCode, tslPointer.getTerritory())) {
return tslPointer.getPotentialSigners();
}
}
}
return Collections.emptyList();
}
示例11: isImageWithContentType
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
private static boolean isImageWithContentType(DSSDocument image, MimeType expectedContentType) {
if (image.getMimeType() != null) {
return expectedContentType == image.getMimeType();
} else {
String contentType = null;
try {
contentType = Files.probeContentType(Paths.get(image.getName()));
} catch (IOException e) {
LOG.warn("Unable to retrieve the content-type : " + e.getMessage());
}
return Utils.areStringsEqual(expectedContentType.getMimeTypeString(), contentType);
}
}
示例12: getBasicBuildingBlocksSubIndication
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
/**
* This method returns the result of the Basic Building Block for a token (signature, timestamp, revocation)
*
* @param tokenId
* @return the SubIndication
*/
public SubIndication getBasicBuildingBlocksSubIndication(String tokenId) {
List<XmlBasicBuildingBlocks> basicBuildingBlocks = jaxbDetailedReport.getBasicBuildingBlocks();
for (XmlBasicBuildingBlocks xmlBasicBuildingBlocks : basicBuildingBlocks) {
if (Utils.areStringsEqual(xmlBasicBuildingBlocks.getId(), tokenId)) {
return xmlBasicBuildingBlocks.getConclusion().getSubIndication();
}
}
return null;
}
示例13: getSignatureById
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
public SignatureWrapper getSignatureById(String id) {
List<SignatureWrapper> signatures = getSignatures();
if (Utils.isCollectionNotEmpty(signatures)) {
for (SignatureWrapper xmlSignature : signatures) {
if (Utils.areStringsEqual(id, xmlSignature.getId())) {
return xmlSignature;
}
}
}
return null;
}
示例14: getFormat
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
private String getFormat(List<XmlDistinguishedName> distinguishedNames, String format) {
if (Utils.isCollectionNotEmpty(distinguishedNames)) {
for (XmlDistinguishedName distinguishedName : distinguishedNames) {
if (Utils.areStringsEqual(distinguishedName.getFormat(), format)) {
return distinguishedName.getValue();
}
}
}
return Utils.EMPTY_STRING;
}
示例15: process
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
@Override
protected boolean process() {
String policyId = signature.getPolicyId();
if (multiValues.getId().contains(SignaturePolicy.NO_POLICY) && Utils.isStringEmpty(policyId)) {
return true;
} else if (multiValues.getId().contains(SignaturePolicy.ANY_POLICY) && Utils.isStringNotEmpty(policyId)) {
return true;
} else if (multiValues.getId().contains(SignaturePolicy.IMPLICIT_POLICY) && Utils.areStringsEqual(SignaturePolicy.IMPLICIT_POLICY, policyId)) {
return true;
}
// oids
return processValueCheck(policyId);
}