From 67daf80a2030cd67aeaa4310d997cb67d9e55eec Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 13 Oct 2010 14:05:54 +0200 Subject: [PATCH] Add method to generate a key pair. --- .../java/net/pterodactylus/sone/core/FreenetInterface.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java index 5d0a1a2..f955c4f 100644 --- a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java +++ b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java @@ -81,4 +81,14 @@ public class FreenetInterface extends AbstractService { return fetchResult; } + /** + * Creates a key pair. + * + * @return The request key at index 0, the insert key at index 1 + */ + public String[] generateKeyPair() { + FreenetURI[] keyPair = client.generateKeyPair("/"); + return new String[] { keyPair[1].toString(), keyPair[0].toString() }; + } + } -- 2.7.4