@@ -64,7 +64,7 @@ public void sign_production() throws Exception {
64
64
var signer = KeylessSigner .builder ().sigstorePublicDefaults ().build ();
65
65
var results = signer .sign (artifactDigests );
66
66
67
- verifySigningResult (results );
67
+ verifySigningResult (results , false );
68
68
69
69
var verifier = KeylessVerifier .builder ().sigstorePublicDefaults ().build ();
70
70
for (int i = 0 ; i < results .size (); i ++) {
@@ -81,7 +81,7 @@ public void sign_staging(boolean enableRekorV2) throws Exception {
81
81
var signer =
82
82
KeylessSigner .builder ().sigstoreStagingDefaults ().enableRekorV2 (enableRekorV2 ).build ();
83
83
var results = signer .sign (artifactDigests );
84
- verifySigningResult (results );
84
+ verifySigningResult (results , enableRekorV2 );
85
85
86
86
var verifier = KeylessVerifier .builder ().sigstoreStagingDefaults ().build ();
87
87
for (int i = 0 ; i < results .size (); i ++) {
@@ -90,7 +90,7 @@ public void sign_staging(boolean enableRekorV2) throws Exception {
90
90
}
91
91
}
92
92
93
- private void verifySigningResult (List <Bundle > results ) throws IOException {
93
+ private void verifySigningResult (List <Bundle > results , boolean enableRekorV2 ) throws IOException {
94
94
95
95
Assertions .assertEquals (artifactDigests .size (), results .size ());
96
96
@@ -111,6 +111,14 @@ private void verifySigningResult(List<Bundle> results) throws IOException {
111
111
result .getMessageSignature ().get ().getMessageDigest ().get ().getHashAlgorithm ());
112
112
// check if required inclusion proof exists
113
113
Assertions .assertNotNull (result .getEntries ().get (0 ).getVerification ().getInclusionProof ());
114
+
115
+ if (enableRekorV2 ) {
116
+ Assertions .assertEquals (
117
+ "0.0.2" , result .getEntries ().get (0 ).getBodyDecoded ().getApiVersion ());
118
+ } else {
119
+ Assertions .assertEquals (
120
+ "0.0.1" , result .getEntries ().get (0 ).getBodyDecoded ().getApiVersion ());
121
+ }
114
122
}
115
123
}
116
124
0 commit comments