question: public final void test_ROUNDTRIP_GetKeySpecKey01 ( ) { boolean performed = false ; for ( int i = 0 ; i < algName . length ; i ++ ) { try { TestDataGenerator g = new TestDataGenerator ( algName [ i ] [ 0 ] , algName [ i ] [ 1 ] , privateKeyInfo , null ) ; EncryptedPrivateKeyInfo epki ; if ( g . ap ( ) == null ) { epki = new EncryptedPrivateKeyInfo ( algName [ i ] [ 0 ] , g . ct ( ) ) ; } else { epki = new EncryptedPrivateKeyInfo ( g . ap ( ) , g . ct ( ) ) ; } try { PKCS8EncodedKeySpec eks = epki . getKeySpec ( g . pubK ( ) == null ? g . k ( ) : g . pubK ( ) ) ; if ( ! Arrays . equals ( privateKeyInfo , eks . getEncoded ( ) ) ) { fail ( algName [ i ] [ 0 ] + " != " + algName [ i ] [ 1 ] ) ; } } catch ( InvalidKeyException e ) { fail ( algName [ i ] [ 0 ] + ", " + algName [ i ] [ 1 ] + ": " + e ) ; } performed = true ; } catch ( TestDataGenerator . AllowedFailure allowedFailure ) { } catch ( NoSuchAlgorithmException allowedFailure ) { } } assertTrue ( "Test not performed" , performed ) ; }
target:  Encrypted data contains valid PKCS8 key info encoding