48
48
import org .bouncycastle .crypto .PBEParametersGenerator ;
49
49
import org .bouncycastle .crypto .generators .OpenSSLPBEParametersGenerator ;
50
50
import org .bouncycastle .crypto .params .KeyParameter ;
51
- //import org.bouncycastle.openssl.MiscPEMGenerator;
51
+ import org .bouncycastle .openssl .EncryptionException ;
52
+ import org .bouncycastle .openssl .PEMDecryptor ;
53
+ import org .bouncycastle .openssl .PEMDecryptorProvider ;
54
+ import org .bouncycastle .openssl .PEMEncryptedKeyPair ;
55
+ import org .bouncycastle .openssl .PEMException ;
56
+ import org .bouncycastle .openssl .PEMKeyPair ;
57
+ import org .bouncycastle .openssl .PEMParser ;
52
58
import org .bouncycastle .openssl .PEMWriter ;
53
59
import org .bouncycastle .operator .OperatorCreationException ;
54
60
55
- import org .jruby .ext .openssl .impl .pem .MiscPEMGenerator ;
56
- import org .jruby .ext .openssl .impl .pem .PEMDecryptor ;
57
- import org .jruby .ext .openssl .impl .pem .PEMDecryptorProvider ;
58
- import org .jruby .ext .openssl .impl .pem .PEMEncryptedKeyPair ;
59
- import org .jruby .ext .openssl .impl .pem .PEMException ;
60
- import org .jruby .ext .openssl .impl .pem .PEMKeyPair ;
61
- import org .jruby .ext .openssl .impl .pem .PEMParser ;
61
+ import org .jruby .ext .openssl .impl .pem .MiscPEMGeneratorHelper ;
62
62
import org .jruby .ext .openssl .util .ByteArrayOutputStream ;
63
63
//import org.bouncycastle.util.io.pem.PemReader;
64
64
@@ -145,7 +145,7 @@ public static KeyPair readKeyPair(final Reader reader, final char[] password) th
145
145
146
146
static PEMKeyPair readInternal (final Reader reader , final char [] password ) throws IOException {
147
147
Object keyPair = new PEMParser (reader ).readObject ();
148
- if ( keyPair instanceof PEMEncryptedKeyPair ) {
148
+ if ( keyPair instanceof PEMEncryptedKeyPair ) {
149
149
return ((PEMEncryptedKeyPair ) keyPair ).decryptKeyPair (new PEMDecryptorImpl (password ));
150
150
}
151
151
return (PEMKeyPair ) keyPair ;
@@ -171,7 +171,7 @@ public static void writePEM(final Writer writer, final Object obj,
171
171
172
172
final SecureRandom random = SecurityHelper .getSecureRandom ();
173
173
174
- pemWriter .writeObject (MiscPEMGenerator . newInstance (obj , algorithm , password , random ));
174
+ pemWriter .writeObject (MiscPEMGeneratorHelper . newGenerator (obj , algorithm , password , random ));
175
175
pemWriter .flush ();
176
176
}
177
177
0 commit comments