• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pgpainless / pgpainless / #1050

20 Mar 2025 05:18PM UTC coverage: 86.822% (-2.3%) from 89.121%
#1050

push

github

vanitasvitae
Perform coveralls task after jacocoRootReport

6575 of 7573 relevant lines covered (86.82%)

0.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.44
/pgpainless-core/src/main/java/org/pgpainless/exception/SignatureValidationException.java
1
// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
2
//
3
// SPDX-License-Identifier: Apache-2.0
4

5
package org.pgpainless.exception;
6

7
import java.util.Map;
8

9
import org.bouncycastle.openpgp.PGPException;
10
import org.bouncycastle.openpgp.PGPSignature;
11
import org.pgpainless.algorithm.SignatureType;
12

13
public class SignatureValidationException extends PGPException {
14

15
    public SignatureValidationException(String message) {
16
        super(message);
1✔
17
    }
1✔
18

19
    public SignatureValidationException(String message, Exception underlying) {
20
        super(message, underlying);
1✔
21
    }
1✔
22

23
    public SignatureValidationException(String message, Map<PGPSignature, Exception> rejections) {
24
        super(message + ": " + exceptionMapToString(rejections));
1✔
25
    }
1✔
26

27
    private static String exceptionMapToString(Map<PGPSignature, Exception> rejections) {
28
        StringBuilder sb = new StringBuilder();
1✔
29
        sb.append(rejections.size()).append(" rejected signatures:\n");
1✔
30
        for (PGPSignature signature : rejections.keySet()) {
1✔
31
            String typeString;
32
            SignatureType type = SignatureType.fromCode(signature.getSignatureType());
1✔
33
            if (type == null) {
1✔
34
                typeString = "0x" + Long.toHexString(signature.getSignatureType());
×
35
            } else {
36
                typeString = type.toString();
1✔
37
            }
38
            sb.append(typeString).append(' ')
1✔
39
                    .append(signature.getCreationTime()).append(": ")
1✔
40
                    .append(rejections.get(signature).getMessage()).append('\n');
1✔
41
        }
1✔
42
        return sb.toString();
1✔
43
    }
44
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc