35 import java.nio.ByteBuffer; |
35 import java.nio.ByteBuffer; |
36 |
36 |
37 import java.security.Provider.Service; |
37 import java.security.Provider.Service; |
38 |
38 |
39 import javax.crypto.Cipher; |
39 import javax.crypto.Cipher; |
40 import javax.crypto.CipherSpi; |
|
41 import javax.crypto.IllegalBlockSizeException; |
40 import javax.crypto.IllegalBlockSizeException; |
42 import javax.crypto.BadPaddingException; |
41 import javax.crypto.BadPaddingException; |
43 import javax.crypto.NoSuchPaddingException; |
42 import javax.crypto.NoSuchPaddingException; |
44 |
43 |
45 import sun.security.util.Debug; |
44 import sun.security.util.Debug; |
178 |
177 |
179 // name of the equivalent cipher alg |
178 // name of the equivalent cipher alg |
180 private static final String RSA_CIPHER = "RSA/ECB/PKCS1Padding"; |
179 private static final String RSA_CIPHER = "RSA/ECB/PKCS1Padding"; |
181 |
180 |
182 // all the services we need to lookup for compatibility with Cipher |
181 // all the services we need to lookup for compatibility with Cipher |
183 private static final List<ServiceId> rsaIds = Arrays.asList( |
182 private static final List<ServiceId> rsaIds = List.of( |
184 new ServiceId[] { |
183 new ServiceId("Signature", "NONEwithRSA"), |
185 new ServiceId("Signature", "NONEwithRSA"), |
184 new ServiceId("Cipher", "RSA/ECB/PKCS1Padding"), |
186 new ServiceId("Cipher", "RSA/ECB/PKCS1Padding"), |
185 new ServiceId("Cipher", "RSA/ECB"), |
187 new ServiceId("Cipher", "RSA/ECB"), |
186 new ServiceId("Cipher", "RSA//PKCS1Padding"), |
188 new ServiceId("Cipher", "RSA//PKCS1Padding"), |
187 new ServiceId("Cipher", "RSA")); |
189 new ServiceId("Cipher", "RSA"), |
|
190 } |
|
191 ); |
|
192 |
188 |
193 /** |
189 /** |
194 * Returns a Signature object that implements the specified signature |
190 * Returns a Signature object that implements the specified signature |
195 * algorithm. |
191 * algorithm. |
196 * |
192 * |