Generate key without docname.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / FreenetInterface.java
index 5d0a1a2..1098069 100644 (file)
@@ -39,6 +39,7 @@ public class FreenetInterface extends AbstractService {
        private static final Logger logger = Logging.getLogger(FreenetInterface.class);
 
        /** The node to interact with. */
+       @SuppressWarnings("unused")
        private final Node node;
 
        /** The high-level client to use for requests. */
@@ -81,4 +82,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() };
+       }
+
 }