public P11Slot getSlot(final P11SlotIdentifier slotId) throws P11TokenException { return module.getSlot(slotId); }
public synchronized void refresh() throws P11TokenException { LOG.info("refreshing PKCS#11 module {}", module.getName()); List<P11SlotIdentifier> slotIds = module.getSlotIds(); for (P11SlotIdentifier slotId : slotIds) { P11Slot slot; try { slot = module.getSlot(slotId); } catch (P11TokenException ex) { LogUtil.warn(LOG, ex, "P11TokenException while initializing slot " + slotId); continue; } catch (Throwable th) { LOG.error("unexpected error while initializing slot " + slotId, th); continue; } slot.refresh(); } LOG.info("refreshed PKCS#11 module {}", module.getName()); } // method refresh
throw new RuntimeException("should not reach here"); slot = module.getSlot(p11SlotId); } catch (P11TokenException | XiSecurityException ex) { throw new ObjectCreationException(ex.getMessage(), ex);
throw new IllegalStateException("should not reach here"); slot = module.getSlot(p11SlotId); } catch (P11TokenException | XiSecurityException ex) { throw new ObjectCreationException(ex.getMessage(), ex);
public synchronized void refresh() throws P11TokenException { LOG.info("refreshing PKCS#11 module {}", module.getName()); List<P11SlotIdentifier> slotIds = module.getSlotIds(); for (P11SlotIdentifier slotId : slotIds) { P11Slot slot; try { slot = module.getSlot(slotId); } catch (P11TokenException ex) { LogUtil.warn(LOG, ex, "P11TokenException while initializing slot " + slotId); continue; } catch (Throwable th) { LOG.error("unexpected error while initializing slot " + slotId, th); continue; } slot.refresh(); } LOG.info("refreshed PKCS#11 module {}", module.getName()); } // method refresh
public P11Slot getSlot(P11SlotIdentifier slotId) throws P11TokenException { return module.getSlot(slotId); }
throw new RuntimeException("should not reach here"); slot = module.getSlot(p11SlotId); } catch (P11TokenException | XiSecurityException ex) { throw new ObjectCreationException(ex.getMessage(), ex);
private void engineLoad(String moduleName) throws P11TokenException, XiSecurityException { P11CryptService p11Service = p11CryptServiceFactory.getP11CryptService(moduleName); P11Module module = p11Service.getModule(); List<P11SlotIdentifier> slotIds = module.getSlotIds(); for (P11SlotIdentifier slotId: slotIds) { P11Slot slot = module.getSlot(slotId); Set<P11ObjectIdentifier> identityIds = slot.getIdentityKeyIds(); for (P11ObjectIdentifier objId : identityIds) { P11Identity identity = slot.getIdentity(objId); X509Certificate[] chain = identity.certificateChain(); if (chain == null || chain.length == 0) { continue; } P11PrivateKey key = new P11PrivateKey(p11Service, identity.getId()); KeyCertEntry keyCertEntry = new KeyCertEntry(key, chain); keyCerts.put(moduleName + "#slotid-" + slotId.getId() + "#keyid-" + objId.getIdHex(), keyCertEntry); keyCerts.put(moduleName + "#slotid-" + slotId.getId() + "#keylabel-" + objId.getLabel(), keyCertEntry); keyCerts.put(moduleName + "#slotindex-" + slotId.getIndex() + "#keyid-" + objId.getIdHex(), keyCertEntry); keyCerts.put(moduleName + "#slotindex-" + slotId.getIndex() + "#keylabel-" + objId.getLabel(), keyCertEntry); } } } // method engineLoad
public P11Slot getSlot(P11SlotIdentifier slotId) throws P11TokenException { return module.getSlot(slotId); }
private void engineLoad(String moduleName) throws P11TokenException, XiSecurityException { P11CryptService p11Service = p11CryptServiceFactory.getP11CryptService(moduleName); P11Module module = p11Service.getModule(); List<P11SlotIdentifier> slotIds = module.getSlotIds(); for (P11SlotIdentifier slotId: slotIds) { P11Slot slot = module.getSlot(slotId); Set<P11ObjectIdentifier> identityIds = slot.getIdentityKeyIds(); for (P11ObjectIdentifier objId : identityIds) { P11Identity identity = slot.getIdentity(objId); X509Certificate[] chain = identity.certificateChain(); if (chain == null || chain.length == 0) { continue; } P11PrivateKey key = new P11PrivateKey(p11Service, identity.getId()); KeyCertEntry keyCertEntry = new KeyCertEntry(key, chain); keyCerts.put(moduleName + "#slotid-" + slotId.getId() + "#keyid-" + objId.getIdHex(), keyCertEntry); keyCerts.put(moduleName + "#slotid-" + slotId.getId() + "#keylabel-" + objId.getLabel(), keyCertEntry); keyCerts.put(moduleName + "#slotindex-" + slotId.getIndex() + "#keyid-" + objId.getIdHex(), keyCertEntry); keyCerts.put(moduleName + "#slotindex-" + slotId.getIndex() + "#keylabel-" + objId.getLabel(), keyCertEntry); } } } // method engineLoad
public P11Identity getIdentity(P11SlotIdentifier slotId, P11ObjectIdentifier keyId) throws P11TokenException { P11Slot slot = module.getSlot(slotId); return (slot == null) ? null : slot.getIdentity(keyId); }
public P11Identity getIdentity(P11SlotIdentifier slotId, P11ObjectIdentifier keyId) throws P11TokenException { P11Slot slot = module.getSlot(slotId); return (slot == null) ? null : slot.getIdentity(keyId); }
public X509Certificate getCert(P11SlotIdentifier slotId, P11ObjectIdentifier certId) throws P11TokenException { P11Slot slot = module.getSlot(slotId); if (slot == null) { return null; } X509Cert cert = slot.getCert(certId); return (cert == null) ? null : cert.getCert(); }
public X509Certificate getCert(P11SlotIdentifier slotId, P11ObjectIdentifier certId) throws P11TokenException { P11Slot slot = module.getSlot(slotId); if (slot == null) { return null; } X509Cert cert = slot.getCert(certId); return (cert == null) ? null : cert.getCert(); }
public synchronized void refresh() throws P11TokenException { LOG.info("refreshing PKCS#11 module {}", module.getName()); List<P11SlotIdentifier> slotIds = module.slotIdentifiers(); for (P11SlotIdentifier slotId : slotIds) { P11Slot slot; try { slot = module.getSlot(slotId); } catch (P11TokenException ex) { LogUtil.warn(LOG, ex, "P11TokenException while initializing slot " + slotId); continue; } catch (Throwable th) { LOG.error("unexpected error while initializing slot " + slotId, th); continue; } slot.refresh(); } LOG.info("refreshed PKCS#11 module {}", module.getName()); } // method refresh
public P11Identity getIdentity(final P11EntityIdentifier identityId) throws P11TokenException { ParamUtil.requireNonNull("identityId", identityId); return module.getSlot(identityId.slotId()).getIdentity(identityId.objectId()); }
private void engineLoad(final String moduleName) throws P11TokenException, XiSecurityException { P11CryptService p11Service = p11CryptServiceFactory.getP11CryptService(moduleName); P11Module module = p11Service.module(); List<P11SlotIdentifier> slotIds = module.slotIdentifiers(); for (P11SlotIdentifier slotId: slotIds) { P11Slot slot = module.getSlot(slotId); Set<P11ObjectIdentifier> identityIds = slot.identityIdentifiers(); for (P11ObjectIdentifier objId : identityIds) { P11Identity identity = slot.getIdentity(objId); X509Certificate[] chain = identity.certificateChain(); if (chain == null || chain.length == 0) { continue; } P11PrivateKey key = new P11PrivateKey(p11Service, identity.identityId()); KeyCertEntry keyCertEntry = new KeyCertEntry(key, chain); keyCerts.put(moduleName + "#slotid-" + slotId.id() + "#keyid-" + objId.idHex(), keyCertEntry); keyCerts.put(moduleName + "#slotid-" + slotId.id() + "#keylabel-" + objId.label(), keyCertEntry); keyCerts.put(moduleName + "#slotindex-" + slotId.index() + "#keyid-" + objId.idHex(), keyCertEntry); keyCerts.put(moduleName + "#slotindex-" + slotId.index() + "#keylabel-" + objId.label(), keyCertEntry); } } } // method engineLoad