aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2020-10-02 01:48:31 +0300
committerGravatar Vitaly Takmazov2020-10-02 01:48:31 +0300
commit4eab4c56d571cbd318391c26ccb5b02aa68029e1 (patch)
tree034fb40ba0c9955b361b1bbe0ae35a0c320f3123 /src/main/java/com
parent303ad51ccfb406e347c66b0a131cd559c23cac7a (diff)
Revert http-signatures-java compatibility fixes
* Version 1.7 now compatible with previous one
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/juick/SignatureManager.java6
1 files changed, 3 insertions, 3 deletions
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<String, String> 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<String, String> 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> context = getContext(UriComponentsBuilder.fromUriString(signature.getKeyId())
.fragment(null).build().toUri());
if (context.isPresent() && context.get() instanceof Person) {