File tree Expand file tree Collapse file tree
main/java/org/jruby/ext/openssl
test/java/org/jruby/ext/openssl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,28 +110,6 @@ public abstract class SecurityHelper {
110110 static boolean setJsseProvider = true ;
111111 static volatile Provider jsseProvider ;
112112
113- /**
114- * inject under a given name a cipher. also ensures that the registered
115- * classes are getting used.
116- *
117- * @param name the name under which the class gets registered
118- * @param clazz the CipherSpi class
119- */
120- public static void addCipher (String name , Class <? extends CipherSpi > clazz ) {
121- implEngines .put ("Cipher:" + name , clazz );
122- tryCipherInternal = true ;
123- }
124-
125- /**
126- * inject under a given name a signature
127- *
128- * @param name the name under which the class gets registered
129- * @param clazz the SignaturSpi class
130- */
131- public static void addSignature (String name , Class <? extends SignatureSpi > clazz ) {
132- implEngines .put ("Signature:" + name , clazz );
133- }
134-
135113 public static Provider getSecurityProvider () {
136114 Provider provider = securityProvider ;
137115 if ( setBouncyCastleProvider && provider == null ) {
Original file line number Diff line number Diff line change @@ -46,24 +46,6 @@ public void disableSecurityProvider() {
4646 SecurityHelper .setBouncyCastleProvider = false ;
4747 }
4848
49- @ Test
50- public void injectCipherImpl () throws Exception {
51- SecurityHelper .addCipher ("fake" , CipherSpiFake .class );
52- javax .crypto .Cipher cipher = SecurityHelper .getCipher ("fake" );
53- assertEquals (cipher .getProvider (), savedProvider );
54- java .lang .reflect .Field spi = cipher .getClass ().getDeclaredField ("spi" );
55- spi .setAccessible (true );
56- assertEquals (spi .get (cipher ).getClass (), CipherSpiFake .class );
57- }
58-
59- @ Test
60- public void injectSignatureImpl () throws Exception {
61- SecurityHelper .addSignature ("fake" , SignatureSpiFake .class );
62- Signature signature = SecurityHelper .getSignature ("fake" );
63- assertEquals (signature .getProvider (), savedProvider );
64- assertEquals (signature .getClass (), SignatureSpiFake .class );
65- }
66-
6749 @ Test
6850 public void usesBouncyCastleSecurityProviderByDefault () {
6951 assertNotNull (SecurityHelper .getSecurityProvider ());
You can’t perform that action at this time.
0 commit comments