4848import org .bouncycastle .crypto .PBEParametersGenerator ;
4949import org .bouncycastle .crypto .generators .OpenSSLPBEParametersGenerator ;
5050import 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 ;
5258import org .bouncycastle .openssl .PEMWriter ;
5359import org .bouncycastle .operator .OperatorCreationException ;
5460
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 ;
6262import org .jruby .ext .openssl .util .ByteArrayOutputStream ;
6363//import org.bouncycastle.util.io.pem.PemReader;
6464
@@ -145,7 +145,7 @@ public static KeyPair readKeyPair(final Reader reader, final char[] password) th
145145
146146 static PEMKeyPair readInternal (final Reader reader , final char [] password ) throws IOException {
147147 Object keyPair = new PEMParser (reader ).readObject ();
148- if ( keyPair instanceof PEMEncryptedKeyPair ) {
148+ if ( keyPair instanceof PEMEncryptedKeyPair ) {
149149 return ((PEMEncryptedKeyPair ) keyPair ).decryptKeyPair (new PEMDecryptorImpl (password ));
150150 }
151151 return (PEMKeyPair ) keyPair ;
@@ -171,7 +171,7 @@ public static void writePEM(final Writer writer, final Object obj,
171171
172172 final SecureRandom random = SecurityHelper .getSecureRandom ();
173173
174- pemWriter .writeObject (MiscPEMGenerator . newInstance (obj , algorithm , password , random ));
174+ pemWriter .writeObject (MiscPEMGeneratorHelper . newGenerator (obj , algorithm , password , random ));
175175 pemWriter .flush ();
176176 }
177177
0 commit comments