1818keys were generated with ssh-keygen from OpenSSH_7.9p1, LibreSSL 2.7.3
1919*/
2020@ Execution (ExecutionMode .CONCURRENT )
21- public class PrivateKeyProviderTest {
21+ class PrivateKeyProviderTest {
2222
2323 /**
2424 key command: ssh-keygen -f dsa -t dsa -b 1024 -m PEM
2525 */
2626 @ Test
27- public void loadKeyDSA () throws IOException , GeneralSecurityException {
27+ void loadKeyDSA () throws IOException , GeneralSecurityException {
2828 File file = new File (this .getClass ().getResource ("dsa" ).getFile ());
2929 assertKeyPairNotNull (file , null );
3030 }
@@ -45,7 +45,7 @@ private void assertKeyPairNotNull(File file, String password) throws IOException
4545 key command: ssh-keygen -f dsa-password -t dsa -b 1024 -m PEM -P password
4646 */
4747 @ Test
48- public void loadKeyDSAPassword () throws IOException , GeneralSecurityException {
48+ void loadKeyDSAPassword () throws IOException , GeneralSecurityException {
4949 File file = new File (this .getClass ().getResource ("dsa-password" ).getFile ());
5050 String password = "password" ;
5151 assertKeyPairNotNull (file , password );
@@ -55,7 +55,7 @@ public void loadKeyDSAPassword() throws IOException, GeneralSecurityException {
5555 key command: ssh-keygen -f rsa -t rsa -b 1024 -m PEM
5656 */
5757 @ Test
58- public void loadKeyRSA () throws IOException , GeneralSecurityException {
58+ void loadKeyRSA () throws IOException , GeneralSecurityException {
5959 File file = new File (this .getClass ().getResource ("rsa" ).getFile ());
6060 assertKeyPairNotNull (file , null );
6161 }
@@ -64,7 +64,7 @@ public void loadKeyRSA() throws IOException, GeneralSecurityException {
6464 key command: ssh-keygen -f rsa-password -t rsa -b 1024 -m PEM -P password
6565 */
6666 @ Test
67- public void loadKeyRSAPassword () throws IOException , GeneralSecurityException {
67+ void loadKeyRSAPassword () throws IOException , GeneralSecurityException {
6868 File file = new File (this .getClass ().getResource ("rsa-password" ).getFile ());
6969 String password = "password" ;
7070 assertKeyPairNotNull (file , password );
@@ -74,7 +74,7 @@ public void loadKeyRSAPassword() throws IOException, GeneralSecurityException {
7474 key command: ssh-keygen -f openssh -t rsa -b 1024
7575 */
7676 @ Test
77- public void loadKeyOpenSSH () throws IOException , GeneralSecurityException {
77+ void loadKeyOpenSSH () throws IOException , GeneralSecurityException {
7878 File file = new File (this .getClass ().getResource ("openssh" ).getFile ());
7979 assertKeyPairNotNull (file , null );
8080 }
@@ -83,7 +83,7 @@ public void loadKeyOpenSSH() throws IOException, GeneralSecurityException {
8383 key command: ssh-keygen -f openssh-unsupported -t rsa -b 1024 -m PKCS8 -P password
8484 */
8585 @ Test
86- public void loadKeyOpenSSHPKCS8 () throws IOException , GeneralSecurityException {
86+ void loadKeyOpenSSHPKCS8 () throws IOException , GeneralSecurityException {
8787 File file = new File (this .getClass ().getResource ("openssh-pkcs8" ).getFile ());
8888 String password = "password" ;
8989 assertKeyPairNotNull (file , password );
@@ -93,7 +93,7 @@ public void loadKeyOpenSSHPKCS8() throws IOException, GeneralSecurityException {
9393 key command: ssh-keygen -f openssh-unsupported -t rsa -b 1024 -m RFC4716 -p password
9494 */
9595 @ Test
96- public void loadKeyOpenSSHRFC4716 () throws IOException , GeneralSecurityException {
96+ void loadKeyOpenSSHRFC4716 () throws IOException , GeneralSecurityException {
9797 File file = new File (this .getClass ().getResource ("openssh-rfc4716" ).getFile ());
9898 String password = "password" ;
9999 assertKeyPairNotNull (file , password );
@@ -104,7 +104,7 @@ public void loadKeyOpenSSHRFC4716() throws IOException, GeneralSecurityException
104104 Copy pasted the same key twice
105105 */
106106 @ Test
107- public void loadKeyOpenSSHMultipleKeys () throws IOException , GeneralSecurityException {
107+ void loadKeyOpenSSHMultipleKeys () {
108108 File file = new File (this .getClass ().getResource ("openssh-multiple-keys" ).getFile ());
109109 String password = "password" ;
110110 assertThrows (InvalidKeySpecException .class , () -> PrivateKeyProvider .loadKey (file , password ));
@@ -114,7 +114,7 @@ public void loadKeyOpenSSHMultipleKeys() throws IOException, GeneralSecurityExce
114114 * Uses a blank file
115115 */
116116 @ Test
117- public void loadBlankKey () throws IOException , GeneralSecurityException {
117+ void loadBlankKey () {
118118 File file = new File (this .getClass ().getResource ("blank" ).getFile ());
119119 String password = "password" ;
120120 assertThrows (InvalidKeyException .class , () -> PrivateKeyProvider .loadKey (file , password ));
@@ -125,7 +125,7 @@ public void loadBlankKey() throws IOException, GeneralSecurityException {
125125 in this key we remove some lines to break the key.
126126 */
127127 @ Test
128- public void loadKeyBroken () throws IOException , GeneralSecurityException {
128+ void loadKeyBroken () {
129129 File file = new File (this .getClass ().getResource ("openssh-broken" ).getFile ());
130130 String password = "password" ;
131131 assertThrows (IllegalArgumentException .class , () -> PrivateKeyProvider .loadKey (file , password ));
0 commit comments