use of org.gradle.api.internal.artifacts.verification.verifier.DependencyVerifier in project gradle by gradle.
the class WriteDependencyVerificationFile method serializeResult.
private void serializeResult(SignatureVerificationService signatureVerificationService) throws IOException {
File out = isDryRun ? dryRunVerificationFile() : verificationFile;
if (generatePgpInfo) {
verificationsBuilder.setVerifySignatures(true);
}
DependencyVerifier verifier = verificationsBuilder.build();
DependencyVerificationsXmlWriter.serialize(verifier, new FileOutputStream(out));
if (isExportKeyring) {
exportKeys(signatureVerificationService, verifier);
}
}
use of org.gradle.api.internal.artifacts.verification.verifier.DependencyVerifier in project gradle by gradle.
the class WriteDependencyVerificationFile method exportKeys.
private void exportKeys(SignatureVerificationService signatureVerificationService, DependencyVerifier verifier) throws IOException {
BuildTreeDefinedKeys keys = isDryRun ? keyrings.dryRun() : keyrings;
Set<String> keysToExport = Sets.newHashSet();
verifier.getConfiguration().getTrustedKeys().stream().map(DependencyVerificationConfiguration.TrustedKey::getKeyId).forEach(keysToExport::add);
verifier.getConfiguration().getIgnoredKeys().stream().map(IgnoredKey::getKeyId).forEach(keysToExport::add);
verifier.getVerificationMetadata().stream().flatMap(md -> md.getArtifactVerifications().stream()).flatMap(avm -> Stream.concat(avm.getTrustedPgpKeys().stream(), avm.getIgnoredPgpKeys().stream().map(IgnoredKey::getKeyId))).forEach(keysToExport::add);
exportKeyRingCollection(signatureVerificationService.getPublicKeyService(), keys, keysToExport);
}
Aggregations