1
2
3
4
5
6
7
8
9
10 package org.eclipse.jgit.pgm.internal;
11
12 import java.io.IOException;
13
14 import org.eclipse.jgit.lib.GpgSignatureVerifier.SignatureVerification;
15 import org.eclipse.jgit.lib.PersonIdent;
16 import org.eclipse.jgit.util.GitDateFormatter;
17 import org.eclipse.jgit.util.SignatureUtils;
18 import org.eclipse.jgit.util.io.ThrowingPrintWriter;
19
20
21
22
23 public final class VerificationUtils {
24
25 private VerificationUtils() {
26
27 }
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43 public static void writeVerification(ThrowingPrintWriter out,
44 SignatureVerification verification, String name,
45 PersonIdent creator) throws IOException {
46 String[] text = SignatureUtils
47 .toString(verification, creator,
48 new GitDateFormatter(GitDateFormatter.Format.LOCALE))
49 .split("\n");
50 for (String line : text) {
51 out.print(name);
52 out.print(": ");
53 out.println(line);
54 }
55 }
56 }