use of org.jose4j.jws.AlgorithmIdentifiers.RSA_USING_SHA384 in project bundletool by google.
the class CheckTransparencyCommandTest method bundleMode_unsupportedSignatureAlgorithm.
@Test
public void bundleMode_unsupportedSignatureAlgorithm() throws Exception {
String serializedJws = createJwsToken(CodeTransparency.getDefaultInstance(), transparencyKeyCertificate, transparencyPrivateKey, RSA_USING_SHA384);
AppBundleBuilder appBundle = new AppBundleBuilder().addModule("base", module -> module.setManifest(androidManifest("com.test.app"))).addMetadataFile(BundleMetadata.BUNDLETOOL_NAMESPACE, BundleMetadata.TRANSPARENCY_SIGNED_FILE_NAME, CharSource.wrap(serializedJws).asByteSource(Charset.defaultCharset()));
new AppBundleSerializer().writeToDisk(appBundle.build(), bundlePath);
Throwable e = assertThrows(CommandExecutionException.class, () -> CheckTransparencyCommand.builder().setMode(Mode.BUNDLE).setBundlePath(bundlePath).build().checkTransparency(new PrintStream(new ByteArrayOutputStream())));
assertThat(e).hasMessageThat().contains("Exception while verifying code transparency signature.");
}
Aggregations