Matthias Andreas Benkard | 4e8423d | 2021-12-19 22:56:09 +0100 | [diff] [blame] | 1 | package eu.mulk.jgvariant.ostree; |
| 2 | |
| 3 | import eu.mulk.jgvariant.core.Decoder; |
| 4 | import eu.mulk.jgvariant.core.Variant; |
| 5 | import java.nio.charset.StandardCharsets; |
Matthias Andreas Benkard | 329168c | 2021-12-28 01:20:05 +0100 | [diff] [blame^] | 6 | import java.util.Map; |
Matthias Andreas Benkard | 4e8423d | 2021-12-19 22:56:09 +0100 | [diff] [blame] | 7 | |
| 8 | /** |
| 9 | * A collection of cryptographic signatures for a {@link Summary}. |
| 10 | * |
| 11 | * <p>Stored as a file named {@code summary.sig} in the OSTree repository root. |
| 12 | * |
| 13 | * <p>Reference: {@code ostree-repo-static-delta-private.h#OSTREE_SUMMARY_SIG_GVARIANT_STRING} |
| 14 | */ |
Matthias Andreas Benkard | 329168c | 2021-12-28 01:20:05 +0100 | [diff] [blame^] | 15 | public record SummarySignature(Map<String, Variant> signatures) { |
Matthias Andreas Benkard | 4e8423d | 2021-12-19 22:56:09 +0100 | [diff] [blame] | 16 | |
| 17 | private static final Decoder<SummarySignature> DECODER = |
Matthias Andreas Benkard | 329168c | 2021-12-28 01:20:05 +0100 | [diff] [blame^] | 18 | Decoder.ofDictionary(Decoder.ofString(StandardCharsets.UTF_8), Decoder.ofVariant()) |
| 19 | .map(SummarySignature::new); |
Matthias Andreas Benkard | 4e8423d | 2021-12-19 22:56:09 +0100 | [diff] [blame] | 20 | |
| 21 | public static Decoder<SummarySignature> decoder() { |
| 22 | return DECODER; |
| 23 | } |
| 24 | } |