-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
142 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.idea/ | ||
out/ | ||
rsakeygen.iml | ||
/rsapriv.toml | ||
/rsapub.toml | ||
/log.err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2018 Cliven Mitchell | ||
|
||
|
||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
|
||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
|
||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
rsakeygen | ||
# RSAKeyGen | ||
|
||
A tool that generates 1024-bit RSA keys. It currently runs on Java 8 and was developed specifically for the Luna ecosystem. | ||
|
||
# Usage | ||
|
||
Simply download the latest .JAR file from the [releases]() section, and in the Luna server files put it in the RSA (./data/rsa) directory. Once that is done, double click the JAR file and it will generate new keys automatically! | ||
|
||
# License | ||
|
||
Like all software for Luna, RSAKeyGen is licensed under MIT (see LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package io.luna.net.rsa; | ||
|
||
import javafx.application.Application; | ||
import javafx.scene.Scene; | ||
import javafx.scene.control.Alert; | ||
import javafx.scene.control.ButtonType; | ||
import javafx.scene.layout.HBox; | ||
import javafx.stage.Stage; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.List; | ||
|
||
/** | ||
* A Javafx application that opens an alert window detailing the result of the key computation. | ||
* | ||
* @author lare96 <http://github.com/lare96> | ||
*/ | ||
public final class AlertWindow extends Application { | ||
|
||
@Override | ||
public void start(Stage primaryStage) throws Exception { | ||
// Dummy scene, never actually displayed. | ||
primaryStage.setScene(new Scene(new HBox(), 300, 300)); | ||
|
||
List<String> parameters = getParameters().getRaw(); | ||
if (parameters.isEmpty()) { | ||
Alert alert = new Alert(Alert.AlertType.INFORMATION, | ||
"RSA Keys have successfully been generated.", ButtonType.OK); | ||
alert.setTitle("RSAKeyGen"); | ||
alert.setHeaderText("Success!"); | ||
alert.showAndWait(); | ||
} else { | ||
writeError(parameters.get(0)); | ||
|
||
Alert alert = new Alert(Alert.AlertType.ERROR, | ||
"RSA Keys could not be generated. Please see log.err for more info.", | ||
ButtonType.OK); | ||
alert.setTitle("RSAKeyGen"); | ||
alert.setHeaderText("Warning!"); | ||
alert.showAndWait(); | ||
} | ||
} | ||
|
||
/** | ||
* Writes an error to the error log. | ||
* | ||
* @param e The error to write. | ||
*/ | ||
private void writeError(String e) { | ||
Path errorLog = Paths.get("log.err"); | ||
try { | ||
Files.deleteIfExists(errorLog); | ||
Files.write(errorLog, e.getBytes()); | ||
} catch (IOException ignored) { | ||
|
||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.