Java Code Examples for java.security.KeyStore.getProvider()

The following are Jave code examples for showing how to use getProvider() of the java.security.KeyStore class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: nfse   File: CertificadoConfig.java   View Source Code Vote up 5 votes
@SuppressWarnings("restriction")
private void carregarModuloPKCS11() throws KeyStoreException {
  try {
    KeyStore keystoreInstance = KeyStore.getInstance("pkcs11");
    if (keystoreInstance != null && keystoreInstance.getProvider() != null) {
      this.keyStoreCertificado = keystoreInstance;
    }
  } catch (KeyStoreException ke) {
    Provider provider = new sun.security.pkcs11.SunPKCS11(this.inputStream);
    Security.addProvider(provider);
    this.keyStoreCertificado = KeyStore.getInstance("pkcs11", provider);
  }
}