aboutsummaryrefslogtreecommitdiffstats
path: root/hosted-api/src/main/java/ai/vespa/hosted/api/RequestVerifier.java
diff options
context:
space:
mode:
Diffstat (limited to 'hosted-api/src/main/java/ai/vespa/hosted/api/RequestVerifier.java')
-rw-r--r--hosted-api/src/main/java/ai/vespa/hosted/api/RequestVerifier.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/hosted-api/src/main/java/ai/vespa/hosted/api/RequestVerifier.java b/hosted-api/src/main/java/ai/vespa/hosted/api/RequestVerifier.java
index 9d85ec9bf6b..5a6bea54bce 100644
--- a/hosted-api/src/main/java/ai/vespa/hosted/api/RequestVerifier.java
+++ b/hosted-api/src/main/java/ai/vespa/hosted/api/RequestVerifier.java
@@ -5,6 +5,7 @@ import com.yahoo.security.KeyUtils;
import com.yahoo.security.SignatureUtils;
import java.net.URI;
+import java.security.PublicKey;
import java.security.Signature;
import java.security.SignatureException;
import java.time.Clock;
@@ -31,7 +32,12 @@ public class RequestVerifier {
/** Creates a new request verifier from the given PEM encoded ECDSA public key, with the given clock. */
public RequestVerifier(String pemPublicKey, Clock clock) {
- this.verifier = SignatureUtils.createVerifier(KeyUtils.fromPemEncodedPublicKey(pemPublicKey), SHA256_WITH_ECDSA);
+ this(KeyUtils.fromPemEncodedPublicKey(pemPublicKey), clock);
+ }
+
+ /** Creates a new request verifier from the given PEM encoded ECDSA public key, with the given clock. */
+ public RequestVerifier(PublicKey publicKey, Clock clock) {
+ this.verifier = SignatureUtils.createVerifier(publicKey, SHA256_WITH_ECDSA);
this.clock = clock;
}