import org.bouncycastle.jce.provider.BouncyCastleProvider;

import java.security.Security;

public class UseBCAlgo {
    public static void main (String[] args) throws Exception {
        Security.addProvider(new BouncyCastleProvider());
        new javax.crypto.EncryptedPrivateKeyInfo("SHA384WITHDSA", new byte[]{0});
        Security.removeProvider("BC");
        new javax.crypto.EncryptedPrivateKeyInfo("SHA384WITHDSA", new byte[]{0}); // this should fail
    }
}
