@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); }
@Override public boolean equals(Object obj) { if (!(obj instanceof P11IdentityId)) { return false; } P11IdentityId ei = (P11IdentityId) obj; return this.slotId.equals(ei.slotId) && this.keyId.equals(ei.keyId) && CompareUtil.equalsObject(publicKeyId, ei.publicKeyId) && CompareUtil.equalsObject(certId, ei.certId); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (!(obj instanceof P11IdentityId)) { return false; } P11IdentityId ei = (P11IdentityId) obj; return this.slotId.equals(ei.slotId) && this.keyId.equals(ei.keyId) && CompareUtil.equalsObject(publicKeyId, ei.publicKeyId) && CompareUtil.equalsObject(certId, ei.certId); }
P11IdentityId identityId = identity.getId(); P11ObjectIdentifier certId = identityId.getCertId(); if (certId != null && !certId.equals(keyId)) { sb.append(", certificate label: ").append(identityId.getCertId().getLabel()); if (pubKeyId != null && !pubKeyId.equals(keyId)) { sb.append(", publicKey label: ").append(pubKeyId.getLabel());
P11IdentityId identityId = identity.getId(); P11ObjectIdentifier certId = identityId.getCertId(); if (certId != null && !certId.equals(keyId)) { sb.append(", certificate label: ").append(identityId.getCertId().getLabel()); if (pubKeyId != null && !pubKeyId.equals(keyId)) { sb.append(", publicKey label: ").append(pubKeyId.getLabel());
/** * TODO. * @param objectId * Object identifier. Must not be {@code null}. * @throws P11TokenException * if PKCS#11 token exception occurs. */ public void removeCerts(P11ObjectIdentifier objectId) throws P11TokenException { Args.notNull(objectId, "objectId"); assertWritable("removeCerts"); P11ObjectIdentifier keyId = null; for (P11ObjectIdentifier m : identities.keySet()) { P11Identity identity = identities.get(m); if (objectId.equals(identity.getId().getCertId())) { keyId = m; break; } } if (keyId != null) { certificates.remove(objectId); identities.get(keyId).setCertificates(null); } else if (certificates.containsKey(objectId)) { certificates.remove(objectId); } else { throw new P11UnknownEntityException(slotId, objectId); } updateCaCertsOfIdentities(); removeCerts0(objectId); }
/** * TODO. * @param objectId * Object identifier. Must not be {@code null}. * @throws P11TokenException * if PKCS#11 token exception occurs. */ public void removeCerts(P11ObjectIdentifier objectId) throws P11TokenException { ParamUtil.requireNonNull("objectId", objectId); assertWritable("removeCerts"); P11ObjectIdentifier keyId = null; for (P11ObjectIdentifier m : identities.keySet()) { P11Identity identity = identities.get(m); if (objectId.equals(identity.getId().getCertId())) { keyId = m; break; } } if (keyId != null) { certificates.remove(objectId); identities.get(keyId).setCertificates(null); } else if (certificates.containsKey(objectId)) { certificates.remove(objectId); } else { throw new P11UnknownEntityException(slotId, objectId); } updateCaCertsOfIdentities(); removeCerts0(objectId); }