aboutsummaryrefslogtreecommitdiffstats
path: root/hosted-api/src/test
diff options
context:
space:
mode:
authorJon Marius Venstad <jvenstad@yahoo-inc.com>2019-04-30 13:29:25 +0200
committerJon Marius Venstad <jvenstad@yahoo-inc.com>2019-04-30 14:01:33 +0200
commitc872e3b43d0ae0dd409cf9498f0b1dabd8c2c6a6 (patch)
tree580d20fd343ebcf65a063051924b7d4315a3a3e8 /hosted-api/src/test
parentd57e489f3bfd41a0a66639346dbd39fbd5162ea5 (diff)
Use KeyUtils to read keys
Diffstat (limited to 'hosted-api/src/test')
-rw-r--r--hosted-api/src/test/java/ai/vespa/hosted/api/SignaturesTest.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/hosted-api/src/test/java/ai/vespa/hosted/api/SignaturesTest.java b/hosted-api/src/test/java/ai/vespa/hosted/api/SignaturesTest.java
index 67a99168341..074f117167b 100644
--- a/hosted-api/src/test/java/ai/vespa/hosted/api/SignaturesTest.java
+++ b/hosted-api/src/test/java/ai/vespa/hosted/api/SignaturesTest.java
@@ -1,5 +1,6 @@
package ai.vespa.hosted.api;
+import com.yahoo.security.KeyUtils;
import org.junit.Test;
import java.io.ByteArrayInputStream;
@@ -14,8 +15,6 @@ import java.time.ZoneOffset;
import static ai.vespa.hosted.api.Signatures.decrypted;
import static ai.vespa.hosted.api.Signatures.encrypted;
-import static ai.vespa.hosted.api.Signatures.parsePrivatePemPkcs8RsaKey;
-import static ai.vespa.hosted.api.Signatures.parsePublicPemX509RsaKey;
import static ai.vespa.hosted.api.Signatures.sha256Digest;
import static ai.vespa.hosted.api.Signatures.sha256Digester;
import static java.nio.charset.StandardCharsets.UTF_8;
@@ -127,8 +126,8 @@ public class SignaturesTest {
@Test
public void testEncryption() {
- Key privateKey = parsePrivatePemPkcs8RsaKey(pemPrivateKey);
- Key publicKey = parsePublicPemX509RsaKey(pemPublicKey);
+ Key privateKey = KeyUtils.fromPemEncodedPrivateKey(pemPrivateKey);
+ Key publicKey = KeyUtils.fromPemEncodedPublicKey(pemPublicKey);
assertArrayEquals(message, decrypted(encrypted(message, privateKey), publicKey));
assertArrayEquals(message, decrypted(encrypted(message, publicKey), privateKey));