@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); }
public boolean match(final P11SlotIdentifier slotId, final String objectLabel) { ParamUtil.requireNonNull("objectLabel", objectLabel); return this.slotId.equals(slotId) && objectLabel.equals(this.objectId.label()); }
public boolean match(P11SlotIdentifier slotId, String keyLabel) { Args.notNull(keyLabel, "objectLabel"); return this.slotId.equals(slotId) && keyLabel.equals(this.keyId.getLabel()); }
public boolean match(P11SlotIdentifier slotId, String keyLabel) { ParamUtil.requireNonNull("objectLabel", keyLabel); return this.slotId.equals(slotId) && keyLabel.equals(this.keyId.getLabel()); }
@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); }
protected void addIdentity(final P11Identity identity) throws P11DuplicateEntityException { if (!slotId.equals(identity.identityId().slotId())) { throw new IllegalArgumentException("invalid identity"); } P11ObjectIdentifier objectId = identity.identityId().objectId(); if (hasIdentity(objectId)) { throw new P11DuplicateEntityException(slotId, objectId); } identities.put(objectId, identity); updateCaCertsOfIdentity(identity); }
protected void addIdentity(P11Identity identity) throws P11DuplicateEntityException { if (!slotId.equals(identity.getId().getSlotId())) { throw new IllegalArgumentException("invalid identity"); } P11ObjectIdentifier keyId = identity.getId().getKeyId(); if (hasIdentity(keyId)) { throw new P11DuplicateEntityException(slotId, keyId); } identities.put(keyId, identity); updateCaCertsOfIdentity(identity); }
protected void addIdentity(P11Identity identity) throws P11DuplicateEntityException { if (!slotId.equals(identity.getId().getSlotId())) { throw new IllegalArgumentException("invalid identity"); } P11ObjectIdentifier keyId = identity.getId().getKeyId(); if (hasIdentity(keyId)) { throw new P11DuplicateEntityException(slotId, keyId); } identities.put(keyId, identity); updateCaCertsOfIdentity(identity); }
private P11Identity parseGenerateSecretKeyResult(final byte[] resp) throws P11TokenException { if (resp == null) { throw new P11TokenException("server returned no result"); } Asn1P11EntityIdentifier ei; try { ei = Asn1P11EntityIdentifier.getInstance(resp); } catch (BadAsn1ObjectException ex) { throw new P11TokenException( "invalid ASN1 object Asn1P11EntityIdentifier: " + ex.getMessage(), ex); } if (!slotId.equals(ei.slotId().slotId())) { throw new P11TokenException(""); } P11EntityIdentifier entityId = ei.entityId(); return new ProxyP11Identity(this, entityId); }
private P11Identity parseGenerateKeypairResult(final byte[] resp) throws P11TokenException { if (resp == null) { throw new P11TokenException("server returned no result"); } Asn1P11EntityIdentifier ei; try { ei = Asn1P11EntityIdentifier.getInstance(resp); } catch (BadAsn1ObjectException ex) { throw new P11TokenException( "invalid ASN1 object Asn1P11EntityIdentifier: " + ex.getMessage(), ex); } if (!slotId.equals(ei.slotId().slotId())) { throw new P11TokenException(""); } P11EntityIdentifier entityId = ei.entityId(); PublicKey publicKey = getPublicKey(entityId.objectId()); return new ProxyP11Identity(this, entityId, publicKey, null); }
private P11Identity parseGenerateKeyResult(byte[] resp, boolean needsPublicKey) throws P11TokenException { if (resp == null) { throw new P11TokenException("server returned no result"); } ProxyMessage.IdentityId ei; try { ei = ProxyMessage.IdentityId.getInstance(resp); } catch (BadAsn1ObjectException ex) { throw new P11TokenException( "invalid ASN1 object Asn1P11EntityIdentifier: " + ex.getMessage(), ex); } if (!slotId.equals(ei.getValue().getSlotId())) { throw new P11TokenException("returned identity has different slodId"); } P11IdentityId identityId = ei.getValue(); if (needsPublicKey) { PublicKey publicKey = getPublicKey(identityId.getPublicKeyId()); return new ProxyP11Identity(this, identityId, publicKey, null); } else { return new ProxyP11Identity(this, identityId); } }