Skip to content

Commit

Permalink
fix: change serialnumber to get an existing revoked certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
phiz71 committed Jan 24, 2022
1 parent e252f6d commit fb6ec21
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>--add-opens java.base/sun.security.x509=ALL-UNNAMED</argLine>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
6 changes: 4 additions & 2 deletions src/test/java/io/gravitee/policy/jws/JWSPolicyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,10 @@ public void shouldValidateCRL_certificateException() throws Exception {
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
String pemPath = getPemFilePath("wikipedia.pem");
String fileContent = new String(Files.readAllBytes(Paths.get(pemPath)), Charset.forName(StandardCharsets.UTF_8.name()));
X509Certificate cert = (X509Certificate) certificateFactory.generateCertificate(new ByteArrayInputStream(fileContent.getBytes(StandardCharsets.UTF_8)));
jwsPolicy.validateCRLSFromCertificate(cert, new BigInteger("1336116294314909783601160591332574969"));
X509Certificate cert = (X509Certificate) certificateFactory.generateCertificate(
new ByteArrayInputStream(fileContent.getBytes(StandardCharsets.UTF_8))
);
jwsPolicy.validateCRLSFromCertificate(cert, new BigInteger("17521746654160821224073118409816269840"));
}

private void shouldTransformInput_validX5CHeader_withPemFile(String pemFile) throws Exception {
Expand Down

0 comments on commit fb6ec21

Please sign in to comment.