Add method to generate a key pair.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 13 Oct 2010 12:05:54 +0000 (14:05 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 13 Oct 2010 12:05:54 +0000 (14:05 +0200)
src/main/java/net/pterodactylus/sone/core/FreenetInterface.java

index 5d0a1a2..f955c4f 100644 (file)
@@ -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() };
+       }
+
 }