pgpainless/pgpainless-core/src/main/java/org/pgpainless/signature/consumer
Paul Schaub f6c6b9aded
Do not attempt to verify signatures made by external keys using primary key.
This aims at fixing #266 in combination with #267.
2022-04-05 14:10:04 +02:00
..
CertificateValidator.java Do not attempt to verify signatures made by external keys using primary key. 2022-04-05 14:10:04 +02:00
DetachedSignatureCheck.java Add TODOs to remove deprecated methods in 1.2.X 2022-04-02 17:12:12 +02:00
OnePassSignatureCheck.java Refactoring: Move signature verification stuff to consumer subpacket 2021-11-16 13:40:33 +01:00
README.md Fix typos and wording 2021-12-28 13:53:25 +01:00
SignatureCreationDateComparator.java Refactoring: Move signature verification stuff to consumer subpacket 2021-11-16 13:40:33 +01:00
SignaturePicker.java Do not attempt to verify signatures made by external keys using primary key. 2022-04-05 14:10:04 +02:00
SignatureValidator.java Annotate fromId(code) methods with Nullable and add Nonnull requireFromId(code) methods 2022-03-22 15:09:09 +01:00
SignatureValidityComparator.java Fix javadoc warnings 2022-04-02 18:56:05 +02:00
SignatureVerifier.java Do not attempt to verify signatures made by external keys using primary key. 2022-04-05 14:10:04 +02:00
package-info.java Create applyCallback util methods 2021-11-16 13:40:33 +01:00

README.md

Signature Verification and Validation

This package can be a bit overwhelming, hence this README file.

Signature verification and validation in OpenPGP is a complex topic (see a related blog post of mine), therefore let me quickly outline some of its challenges for you:

A signature is either valid or it is not. However, signature validity goes beyond merely checking the cryptographic correctness like BouncyCastle does. A signature that is correct can still be invalid, e.g. if it is past its expiry date or the key that issued the signature got revoked or is simply not a signing key in the first place.

All the little criteria like "is not expired", "has a hashed signature creation time subpacket", "does not contain critical unknown notations/subpackets" and so forth are implemented in the SignatureValidator class. This class defines an abstract "verify()" method which is overwritten in a collection of anonymous subclasses which check for one or more such criteria.

Whether a signature is cryptographically correct is checked in the SignatureVerifier class. This class draws on the SignatureValidator class to compose the subclass building blocks depending on the signature type to check if the signature fulfills formal criteria and further checks for cryptographic correctness.

Lastly the CertificateValidator class not only verifies single signatures, but also verifies that the corresponding certificate (public key ring) is still valid. It checks if the signing subkey is properly bound to its primary key, that no key in the chain is revoked or expired and that the signing key is capable of signing in the first place.

I hope this little guide helps you to get access to the package more quickly. Happy Hacking!