Bouncy Castle Cryptography Library 1.85

org.bouncycastle.crypto.test
Class OpenSSHKeyParsingTests

java.lang.Object
  extended byorg.bouncycastle.util.test.SimpleTest
      extended byorg.bouncycastle.crypto.test.OpenSSHKeyParsingTests
All Implemented Interfaces:
Test

public class OpenSSHKeyParsingTests
extends SimpleTest


Nested Class Summary
 
Nested classes inherited from class org.bouncycastle.util.test.SimpleTest
SimpleTest.TestExceptionOperation
 
Constructor Summary
OpenSSHKeyParsingTests()
           
 
Method Summary
 java.lang.String getName()
           
static void main(java.lang.String[] args)
           
 void performTest()
           
 void testDSA()
           
 void testECDSA_curvesFromSSHKeyGen()
           
 void testECDSA()
           
 void testECDSAEncodeOpenSSHFormat()
          github #2240 - ensure encodePrivateKey for ECDSA emits the openssh-key-v1 envelope (not the raw RFC 5915 ECPrivateKey SEQUENCE) so the output is compatible with OpenSSH and JSCH.
 void testED25519()
           
 void testEncryptedKeys()
          github #1733 - decryption of passphrase-protected openssh-key-v1 keys across the OpenSSH cipher suite (bcrypt KDF).
 void testFailures()
           
 void testRSA()
           
 
Methods inherited from class org.bouncycastle.util.test.SimpleTest
areEqual, areEqual, areEqual, fail, fail, fail, isEquals, isEquals, isEquals, isEquals, isEquals, isEquals, isEquals, isTrue, isTrue, perform, runTest, runTest, runTests, runTests, testException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenSSHKeyParsingTests

public OpenSSHKeyParsingTests()
Method Detail

main

public static void main(java.lang.String[] args)

testDSA

public void testDSA()
             throws java.lang.Exception
Throws:
java.lang.Exception

testECDSA_curvesFromSSHKeyGen

public void testECDSA_curvesFromSSHKeyGen()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

testECDSA

public void testECDSA()
               throws java.lang.Exception
Throws:
java.lang.Exception

testED25519

public void testED25519()
                 throws java.lang.Exception
Throws:
java.lang.Exception

testFailures

public void testFailures()
                  throws java.lang.Exception
Throws:
java.lang.Exception

testEncryptedKeys

public void testEncryptedKeys()
                       throws java.lang.Exception
github #1733 - decryption of passphrase-protected openssh-key-v1 keys across the OpenSSH cipher suite (bcrypt KDF). The keys below were produced by ssh-keygen with passphrase "Test1234!"; each expected value is the deterministic key material (ed25519 32-byte seed||public, RSA modulus, or EC private scalar, in hex).

Throws:
java.lang.Exception

getName

public java.lang.String getName()
Specified by:
getName in interface Test
Specified by:
getName in class SimpleTest

performTest

public void performTest()
                 throws java.lang.Exception
Specified by:
performTest in class SimpleTest
Throws:
java.lang.Exception

testECDSAEncodeOpenSSHFormat

public void testECDSAEncodeOpenSSHFormat()
                                  throws java.lang.Exception
github #2240 - ensure encodePrivateKey for ECDSA emits the openssh-key-v1 envelope (not the raw RFC 5915 ECPrivateKey SEQUENCE) so the output is compatible with OpenSSH and JSCH.

Throws:
java.lang.Exception

testRSA

public void testRSA()
             throws java.lang.Exception
Throws:
java.lang.Exception

Bouncy Castle Cryptography Library 1.85