mirror of
https://codeberg.org/PGPainless/cert-d-java.git
synced 2025-12-05 04:41:08 +01:00
Add support for 64-character OpenPGP v6 fingerprints
This commit is contained in:
parent
10881662a9
commit
b4683292f8
1 changed files with 3 additions and 1 deletions
|
|
@ -31,6 +31,7 @@ public class PGPCertificateDirectory
|
|||
final Backend backend;
|
||||
final SubkeyLookup subkeyLookup;
|
||||
private final Pattern openPgpV4FingerprintPattern = Pattern.compile("^[a-f0-9]{40}$");
|
||||
private final Pattern openPgpV6FingerprintPattern = Pattern.compile("^[a-f0-9]{64}$");
|
||||
|
||||
/**
|
||||
* Constructor for a PGP certificate directory.
|
||||
|
|
@ -45,7 +46,8 @@ public class PGPCertificateDirectory
|
|||
|
||||
@Override
|
||||
public Certificate getByFingerprint(String fingerprint) throws BadDataException, BadNameException, IOException {
|
||||
if (!openPgpV4FingerprintPattern.matcher(fingerprint).matches()) {
|
||||
if (!openPgpV4FingerprintPattern.matcher(fingerprint).matches() &&
|
||||
!openPgpV6FingerprintPattern.matcher(fingerprint).matches()) {
|
||||
throw new BadNameException();
|
||||
}
|
||||
Certificate certificate = backend.readByFingerprint(fingerprint);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue