@@ -150,14 +150,6 @@ private Decryptor getDecryptor() {
150
150
return decryptor ;
151
151
}
152
152
153
- private String getRSACipherProvider () {
154
- if (Build .VERSION .SDK_INT < Build .VERSION_CODES .M ) {
155
- return "AndroidOpenSSL" ;
156
- } else {
157
- return "AndroidKeyStoreBCWorkaround" ;
158
- }
159
- }
160
-
161
153
class Decryptor {
162
154
163
155
private KeyStore keyStore ;
@@ -172,7 +164,7 @@ private byte[] rsaDecrypt(byte[] encrypted) throws KeyStoreException,
172
164
}
173
165
KeyStore .PrivateKeyEntry privateKeyEntry = (KeyStore .PrivateKeyEntry )keyStore .getEntry (
174
166
KEY_ALIAS , null );
175
- Cipher output = Cipher .getInstance (RSA_MODE , getRSACipherProvider () );
167
+ Cipher output = Cipher .getInstance (RSA_MODE );
176
168
output .init (Cipher .DECRYPT_MODE , privateKeyEntry .getPrivateKey ());
177
169
CipherInputStream cipherInputStream = new CipherInputStream (
178
170
new ByteArrayInputStream (encrypted ), output );
@@ -241,7 +233,7 @@ private byte[] rsaEncrypt(byte[] secret) throws NoSuchAlgorithmException,
241
233
InvalidKeyException , InvalidAlgorithmParameterException , CertificateException ,
242
234
KeyStoreException , UnrecoverableEntryException {
243
235
PublicKey publicKey = getRSAPublicKey ();
244
- Cipher inputCipher = Cipher .getInstance (RSA_MODE , getRSACipherProvider () );
236
+ Cipher inputCipher = Cipher .getInstance (RSA_MODE );
245
237
inputCipher .init (Cipher .ENCRYPT_MODE , publicKey );
246
238
247
239
ByteArrayOutputStream outputStream = new ByteArrayOutputStream ();
0 commit comments