reta commented on a change in pull request #462: Httpsig
URL: https://github.com/apache/cxf/pull/462#discussion_r228385543
 
 

 ##########
 File path: 
rt/rs/security/http-signature/src/main/java/org/apache/cxf/rs/security/httpsignature/MessageVerifier.java
 ##########
 @@ -0,0 +1,212 @@
+package org.apache.cxf.rs.security.httpsignature;
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.tomitribe.auth.signatures.Signature;
+import org.tomitribe.auth.signatures.Verifier;
+
+import java.nio.charset.StandardCharsets;
+import java.security.Key;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.Security;
+import java.util.*;
+import java.util.logging.Logger;
+
+public class MessageVerifier {
+    private ExceptionHandler exceptionHandler;
+
+    private static final Logger LOG = 
LogUtils.getL7dLogger(MessageVerifier.class);
+
+    public MessageVerifier(boolean verifyMessageBody) {
+        setExceptionHandler(null);
+        setSecurityProvider(null);
+        setAlgorithmProvider(null);
+        this.verifyMessageBody = verifyMessageBody;
+    }
+
+    public MessageVerifier(PublicKeyProvider publicKeyProvider,
+                           ExceptionHandler exceptionHandler,
+                           SecurityProvider securityProvider,
+                           AlgorithmProvider algorithmProvider,
+                           boolean verifyMessageBody)
+    {
+        Objects.requireNonNull(publicKeyProvider, "Public key provider cannot 
be null");
+        this.publicKeyProvider = publicKeyProvider;
+        this.exceptionHandler = exceptionHandler;
+        this.securityProvider = securityProvider;
+        this.algorithmProvider = algorithmProvider;
+        this.verifyMessageBody = verifyMessageBody;
+    }
+
+    private PublicKeyProvider publicKeyProvider;
 
 Review comment:
   Minor, could you please move all class fields before constructors? Thank you.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to