-
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
4 changed files
with
61 additions
and
5 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
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
25 changes: 25 additions & 0 deletions
25
src/test/java/nz/co/breakpoint/jmeter/vizualizers/sshmon/KeyHelperTest.java
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,25 @@ | ||
package nz.co.breakpoint.jmeter.vizualizers.sshmon; | ||
|
||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
import static org.junit.Assert.assertNotNull; | ||
|
||
public class KeyHelperTest { | ||
|
||
String getFileContent(String filename) throws IOException { | ||
return new String(Files.readAllBytes(Paths.get(filename))); | ||
} | ||
|
||
@Test | ||
public void testRSAFormat() throws IOException { | ||
assertNotNull(KeyHelper.toKeyPair(getFileContent("src/test/resources/hostkey.key"), "")); | ||
} | ||
|
||
@Test | ||
public void testOpenSSHFormat() throws IOException { | ||
assertNotNull(KeyHelper.toKeyPair(getFileContent("src/test/resources/openssh.key"), "changeit")); | ||
} | ||
} |
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,30 @@ | ||
-----BEGIN OPENSSH PRIVATE KEY----- | ||
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAAB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