1
2
3
4
5
6
7
8
9
10 package org.eclipse.jgit.lib;
11
12 import static java.nio.charset.StandardCharsets.US_ASCII;
13
14 import java.io.Serializable;
15
16 import org.eclipse.jgit.annotations.NonNull;
17
18
19
20
21
22
23 public class GpgSignature implements Serializable {
24
25 private static final long serialVersionUID = 1L;
26
27 private byte[] signature;
28
29
30
31
32
33
34
35 public GpgSignature(@NonNull byte[] signature) {
36 this.signature = signature;
37 }
38
39
40
41
42
43
44
45
46
47
48 public String toExternalString() {
49 return new String(signature, US_ASCII);
50 }
51
52
53 @Override
54 @SuppressWarnings("nls")
55 public String toString() {
56 final StringBuilder r = new StringBuilder();
57
58 r.append("GpgSignature[");
59 r.append(
60 this.signature != null ? "length " + signature.length : "null");
61 r.append("]");
62
63 return r.toString();
64 }
65 }