private SlotIdentifier(ASN1Sequence seq) throws BadAsn1ObjectException { requireRange(seq, 2, 2); int idx = 0; long id = getInteger(seq.getObjectAt(idx++)).longValue(); int index = getInteger(seq.getObjectAt(idx++)).intValue(); this.value = new P11SlotIdentifier(index, id); }
@Override public int compareTo(P11IdentityId obj) { int ct = slotId.compareTo(obj.slotId); if (ct != 0) { return ct; } return keyId.compareTo(obj.keyId); }
@Override public boolean equals(final Object obj) { if (!(obj instanceof P11EntityIdentifier)) { return false; } P11EntityIdentifier ei = (P11EntityIdentifier) obj; return this.slotId.equals(ei.slotId) && this.objectId.equals(ei.objectId); }
allSlotIdentifiers.add(slotId); P11SlotIdentifier slotIdentifier = new P11SlotIdentifier(slotIndex, slotId); if (!moduleConf.isSlotIncluded(slotIdentifier)) { LOG.info("skipped slot {}", slotId); File slotDir = new File(baseDir, slotId.getIndex() + "-" + slotId.getId());
@Override public P11SlotIdentifier getSlotIdForId(long id) throws P11UnknownEntityException { for (P11SlotIdentifier slotId : slotIds) { if (slotId.getId() == id) { return slotId; } } throw new P11UnknownEntityException("could not find slot with id " + id); }
allSlotIdentifiers.add(slotId); P11SlotIdentifier slotIdentifier = new P11SlotIdentifier(slotIndex, slotId); if (!moduleConf.isSlotIncluded(slotIdentifier)) { LOG.info("skipped slot {}", slotId); File slotDir = new File(baseDir, slotId.index() + "-" + slotId.id());
@Override public int hashCode() { int hashCode = slotId.hashCode(); return hashCode + 31 * objectId.hashCode(); }
@Override public P11SlotIdentifier getSlotIdForIndex(int index) throws P11UnknownEntityException { for (P11SlotIdentifier id : slotIds) { if (id.getIndex() == index) { return id; } } throw new P11UnknownEntityException("could not find slot with index " + index); }
@Override public P11SlotIdentifier getSlotIdForId(final long id) throws P11UnknownEntityException { for (P11SlotIdentifier slotId : slotIds) { if (slotId.id() == id) { return slotId; } } throw new P11UnknownEntityException("could not find slot with id " + id); }
@Override public P11SlotIdentifier getSlotIdForIndex(final int index) throws P11UnknownEntityException { for (P11SlotIdentifier id : slotIds) { if (id.index() == index) { return id; } } throw new P11UnknownEntityException("could not find slot with index " + index); }
void destroySlot(long slotId) { P11SlotIdentifier p11SlotId = null; for (P11SlotIdentifier si : slots.keySet()) { if (CompareUtil.equalsObject(si.getId(), slotId)) { p11SlotId = si; break; } } if (p11SlotId != null) { slots.remove(p11SlotId); } }
@Override public int hashCode() { int hashCode = slotId.hashCode() + 31 * keyId.hashCode(); if (publicKeyId != null) { hashCode += 31 * 31 * publicKeyId.hashCode(); } if (certId != null) { hashCode += 31 * 31 * 31 * certId.hashCode(); } return hashCode; }
public P11SlotIdentifier getSlotIdForIndex(int index) throws P11UnknownEntityException { for (P11SlotIdentifier id : slotIds) { if (id.getIndex() == index) { return id; } } throw new P11UnknownEntityException("could not find slot with index " + index); }
void destroySlot(final long slotId) { P11SlotIdentifier p11SlotId = null; for (P11SlotIdentifier si : slots.keySet()) { if (CompareUtil.equalsObject(si.id(), slotId)) { p11SlotId = si; break; } } if (p11SlotId != null) { slots.remove(p11SlotId); } }
public boolean match(final P11SlotIdentifier slotId, final String objectLabel) { ParamUtil.requireNonNull("objectLabel", objectLabel); return this.slotId.equals(slotId) && objectLabel.equals(this.objectId.label()); }