# PGP Verify Plugin: How to verify dependency signatures?

**URL:** <https://discuss.gradle.org/t/pgp-verify-plugin-how-to-verify-dependency-signatures/17516>\
**Category:** Help/Discuss\
**Tags:** plugins\
**Created:** [May 8, 2016, 1:37am UTC](https://discuss.gradle.org/t/pgp-verify-plugin-how-to-verify-dependency-signatures/17516 "2016-05-08T01:37:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmoayyed](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mmoayyed/32/3776_2.png) [@mmoayyed](https://discuss.gradle.org/u/mmoayyed)\
**Post date:** [May 8, 2016, 1:37am UTC](https://discuss.gradle.org/t/pgp-verify-plugin-how-to-verify-dependency-signatures/17516/1 "2016-05-08T01:37:49Z")

</div>

In Maven, there exists:

> **[s4u/pgpverify-maven-plugin](https://github.com/s4u/pgpverify-maven-plugin)**
>
> pgpverify-maven-plugin - Verify PGP signatures plugin

How can one via gradle verify the signature of a downloaded artifact? Are there plugins available that already do this? Should we write one? Does gradle offer a way to verify?

---

<div class="post-metadata">

**Author:** ![Marcin](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/marcin/32/1870_2.png) [@Marcin](https://discuss.gradle.org/u/Marcin)\
**Post date:** [May 8, 2016, 9:45pm UTC](https://discuss.gradle.org/t/pgp-verify-plugin-how-to-verify-dependency-signatures/17516/2 "2016-05-08T21:45:17Z")

</div>

There is [gradle-witness](https://github.com/WhisperSystems/gradle-witness) plugin. Unfortunately it seems to be not actively developed anymore and there are some pending issues (like support for buildscript dependencies verification).

Anyway artifacts consistency does not seem to be high on the Gradle team priority list. There is an ability to verify sha256 signature of downloaded distribution (contributed by the community), but the official checksum for published distributions are not [available](https://discuss.gradle.org/t/where-can-i-find-distribution-checksums/9404/1) (not to mention its OpenPGP/GPG signing).

---

<div class="post-metadata">

**Author:** ![mmoayyed](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mmoayyed/32/3776_2.png) [@mmoayyed](https://discuss.gradle.org/u/mmoayyed)\
**Post date:** [May 8, 2016, 11:31pm UTC](https://discuss.gradle.org/t/pgp-verify-plugin-how-to-verify-dependency-signatures/17516/3 "2016-05-08T23:31:11Z")

</div>

I did give the witness plugin a try. It seems to only verify checksums against a preconfigured set of hash values. It does not quite deal with PGPs at all. Right?

---

<div class="post-metadata">

**Author:** ![Marcin](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/marcin/32/1870_2.png) [@Marcin](https://discuss.gradle.org/u/Marcin)\
**Post date:** [May 9, 2016, 7:57am UTC](https://discuss.gradle.org/t/pgp-verify-plugin-how-to-verify-dependency-signatures/17516/4 "2016-05-09T07:57:50Z")

</div>

Yes, you are completely right. I misread the question.

Anyway I wonder what kind of attack would you like to prevent? Binary artifact modification by the rogue Maven mirror?

---

<div class="post-metadata">

**Author:** ![mmoayyed](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mmoayyed/32/3776_2.png) [@mmoayyed](https://discuss.gradle.org/u/mmoayyed)\
**Post date:** [May 9, 2016, 4:57pm UTC](https://discuss.gradle.org/t/pgp-verify-plugin-how-to-verify-dependency-signatures/17516/5 "2016-05-09T16:57:59Z")

</div>

Yes, exactly. I was sort of inspired by this article here:  
[http://branchandbound.net/blog/security/2012/08/verify-dependencies-using-pgp/](http://branchandbound.net/blog/security/2012/08/verify-dependencies-using-pgp/)

…where there is a fair amount of good discussion on cross-build injection attacks.

I did look around, and found nothing that might do what the maven equivalent does. I might port a simplified version of the plugin over and use it for CAS ([https://github.com/apereo/cas](https://github.com/apereo/cas)) but thought to check here and see if there are better ways of doing this.

---

<div class="post-metadata">

**Author:** ![flow](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/flow/32/1968_2.png) [@flow](https://discuss.gradle.org/u/flow)\
**Post date:** [July 9, 2017, 8:40am UTC](https://discuss.gradle.org/t/pgp-verify-plugin-how-to-verify-dependency-signatures/17516/6 "2017-07-09T08:40:15Z")

</div>

See also this related [Stackoverflow question](https://stackoverflow.com/q/3307146/194894) and [answer](https://stackoverflow.com/a/34795359/194894). Disclaimer: The answer is by me.

---

<div class="post-metadata">

**Author:** ![vlsi](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vlsi/32/7535_2.png) [@vlsi](https://discuss.gradle.org/u/vlsi)\
**Post date:** [September 8, 2019, 9:56pm UTC](https://discuss.gradle.org/t/pgp-verify-plugin-how-to-verify-dependency-signatures/17516/7 "2019-09-08T21:56:33Z")

</div>

> [@mmoayyed](#):
>
> Are there plugins available that already do this?

[GitHub - vlsi/vlsi-release-plugins: A set of plugins to simplify Gradle release tasks](https://github.com/vlsi/vlsi-release-plugins#checksum-dependency-plugin) can verify PGP signatures and/or checksums for the plugins and dependencies.

---

<div class="post-metadata">

**Author:** ![tronku](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tronku](https://discuss.gradle.org/u/tronku)\
**Post date:** [August 25, 2021, 4:42am UTC](https://discuss.gradle.org/t/pgp-verify-plugin-how-to-verify-dependency-signatures/17516/8 "2021-08-25T04:42:58Z")

</div>

> [@flow](#):
>
> Stackoverflow question

Is there any way to verify only a specific artifact instead of all??
