From 4eab4c56d571cbd318391c26ccb5b02aa68029e1 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 2 Oct 2020 01:48:31 +0300 Subject: Revert http-signatures-java compatibility fixes * Version 1.7 now compatible with previous one --- src/main/java/com/juick/SignatureManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/juick/SignatureManager.java b/src/main/java/com/juick/SignatureManager.java index 0d7b17a6..3575100d 100644 --- a/src/main/java/com/juick/SignatureManager.java +++ b/src/main/java/com/juick/SignatureManager.java @@ -90,8 +90,8 @@ public class SignatureManager { } public String addSignature(Person from, String host, String method, String path, String dateString, KeystoreManager keystoreManager) throws IOException { - Signature templateSignature = new Signature(from.getPublicKey().getId(), SigningAlgorithm.HS2019.getAlgorithmName(), Algorithm.RSA_SHA256.getJvmName(), null, - Arrays.asList("(request-target)", "host", "date")); + Signature templateSignature = new Signature(from.getPublicKey().getId(), "rsa-sha256", null, + "(request-target)", "host", "date"); Map headers = new HashMap<>(); headers.put("host", host); headers.put("date", dateString); @@ -104,7 +104,7 @@ public class SignatureManager { public User verifySignature(String method, String path, Map headers) { String signatureString = headers.get("signature"); logger.info("Signature: {}", signatureString); - Signature signature = Signature.fromString(signatureString, Algorithm.get("rsa-sha256")); + Signature signature = Signature.fromString(signatureString); Optional context = getContext(UriComponentsBuilder.fromUriString(signature.getKeyId()) .fragment(null).build().toUri()); if (context.isPresent() && context.get() instanceof Person) { -- cgit v1.2.3