use of org.demoiselle.signer.core.keystore.loader.KeyStoreLoader in project signer by demoiselle.
the class CertificateLoaderImpl method loadFromToken.
/**
* When a PIN(Personal Identification Number) was informed,
* obtain the certificate from a Token or Smartcard, defined by ICP-BRASIL with the name A3.
*
* @param pinNumber personal id number
* @return the certificate information in X509Certificate format
*/
@Override
public X509Certificate loadFromToken(String pinNumber) {
if (this.keyStore == null) {
KeyStoreLoader keyStoreLoader = KeyStoreLoaderFactory.factoryKeyStoreLoader();
this.keyStore = keyStoreLoader.getKeyStore();
}
String alias;
try {
alias = this.keyStore.aliases().nextElement();
return (X509Certificate) this.keyStore.getCertificateChain(alias)[0];
} catch (KeyStoreException e) {
throw new CertificateCoreException("", e);
}
}
use of org.demoiselle.signer.core.keystore.loader.KeyStoreLoader in project signer by demoiselle.
the class PDFSigner method getKeyStoreTokenBySigner.
// Usa o Signer para leitura, funciona para windows e NeoID
private KeyStore getKeyStoreTokenBySigner() {
try {
KeyStoreLoader keyStoreLoader = KeyStoreLoaderFactory.factoryKeyStoreLoader();
KeyStore keyStore = keyStoreLoader.getKeyStore();
return keyStore;
} catch (Exception e1) {
e1.printStackTrace();
return null;
} finally {
}
}
use of org.demoiselle.signer.core.keystore.loader.KeyStoreLoader in project signer by demoiselle.
the class CAdESSignerTest method getKeyStoreTokenBySigner.
// Usa o Signer para leitura, funciona para windows e NeoID
private KeyStore getKeyStoreTokenBySigner() {
try {
KeyStoreLoader keyStoreLoader = KeyStoreLoaderFactory.factoryKeyStoreLoader();
KeyStore keyStore = keyStoreLoader.getKeyStore();
return keyStore;
} catch (Exception e1) {
e1.printStackTrace();
return null;
} finally {
}
}
Aggregations