Example usage for java.security Security removeProvider

List of usage examples for java.security Security removeProvider

Introduction

In this page you can find the example usage for java.security Security removeProvider.

Prototype

public static synchronized void removeProvider(String name) 

Source Link

Document

Removes the provider with the specified name.

Usage

From source file:TestSendMail.java

public void testSend() {
    try {//from w w w  .ja v a 2  s.  com
        Security.removeProvider(new BouncyCastleProvider().getName());
        Security.addProvider(new BouncyCastleProvider());
        //log.info("Lista de proveedores disponible:"+Arrays.asList(Security.getProviders()));
        org.apache.xml.security.Init.init();
        Properties configuracion = new Properties();
        configuracion.put("HOST_SMTP", "192.168.10.7");

        SendMailUtil.init(configuracion); //benito.galan@avansi.com.do
        MultiPartEmail mail = SendMailUtil.getCurrentInstance().buildMessage("Ejemplo de Firma",
                "rquintero@viavansi.com", "", "<p>rub&eacute;n</p> ", "certificadoavansicxa", "avansicxa");
        mail.setDebug(true);
        // Enviamos 
        String id = mail.send();
        System.out.println(id);
        mail.getMimeMessage().writeTo(System.out);

    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}

From source file:com.aqnote.shared.cryptology.util.ProviderUtil.java

public static void removeProvider(Provider provider) throws Exception {
    if (provider == null || Security.getProvider(provider.getName()) == null)
        return;//from ww w. j  a va2  s . c  o m
    Security.removeProvider(provider.getName());
}

From source file:com.aqnote.shared.cryptology.util.ProviderUtil.java

public static void removeAllProvider() {
    for (Provider p : Security.getProviders()) {
        Security.removeProvider(p.getName());
    }
}

From source file:org.wildfly.elytron.web.undertow.server.AbstractHttpServerMechanismTest.java

@AfterClass
public static void removeProvider() {
    Security.removeProvider(ELYTRON_PROVIDER.getName());
}

From source file:be.fedict.eid.idp.mbean.IdentityProviderMBean.java

public void stop() {
    LOG.debug("stop");
    if (null == this.managedProvider) {
        LOG.debug("we don't unregister BouncyCastle");
        return;/*from   www  .j  a v  a 2s .co  m*/
    }
    LOG.debug("we unregister BouncyCastle");
    Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
}

From source file:be.fedict.eid.tsl.Pkcs11Token.java

public void close() {
    LOG.debug("close");
    Security.removeProvider(this.pkcs11Provider.getName());
}

From source file:net.sf.jsignpdf.utils.PKCS11Utils.java

/**
 * Unregisters security provider with given name.
 * <p>/*from  w ww  .  j  av a2 s.c  om*/
 * Some tokens/card-readers hangs during second usage of the program, they
 * have to be unplugged and plugged again following code should prevent this
 * issue.
 * </p>
 * 
 * @param providerName
 */
public static void unregisterProvider(final String providerName) {
    if (providerName != null) {
        LOGGER.debug("Removing security provider with name " + providerName);
        Security.removeProvider(providerName);
        //we should wait a little bit to de-register provider correctly (is it a driver issue?)
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}

From source file:be.fedict.eid.dss.model.mbean.DigitalSignatureServiceMBean.java

private void unregisterOOXMLProvider() {
    if (null == this.managedOOXMLProvider) {
        LOG.debug("we don't unregister OOXMLProvider");
        return;/*from  w w  w .j  a v a 2  s . co  m*/
    }
    LOG.debug("we unregister OOXMLProvider");
    Security.removeProvider(OOXMLProvider.NAME);
}

From source file:be.fedict.eid.dss.model.mbean.DigitalSignatureServiceMBean.java

private void unregisterBouncyCastle() {
    if (null == this.managedBouncyCastleProvider) {
        LOG.debug("we don't unregister BouncyCastle");
        return;/*  ww w . j a  v  a  2 s  . com*/
    }
    LOG.debug("we unregister BouncyCastle");
    Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
}

From source file:ch.admin.suis.msghandler.signer.SignerTest.java

@Override
protected void tearDown() throws Exception {
    Security.removeProvider("BC");

    // Lsche die fr die Tests erforderlichen Verzeichnisse rekursiv
    FileUtils.deleteDirectory(signingOutbox1);
    FileUtils.deleteDirectory(signingOutbox2);
    FileUtils.deleteDirectory(signingOutbox1Processed);

    super.tearDown();
}