/** * Hex-encode the current stream. * * @return an iterator over the encoded characters */ public CodePointIterator hexEncode() { return hexEncode(false); }
@Override public boolean verifyCertificate(X509Certificate certificate, Attributes attributes) throws NamingException, RealmUnavailableException { Attribute attribute = attributes.get(ldapAttribute); if (attribute == null) return false; final int size = attribute.size(); try { MessageDigest md = MessageDigest.getInstance(algorithm); String digest = ByteIterator.ofBytes(md.digest(certificate.getEncoded())).hexEncode(true).drainToString(); for (int i = 0; i < size; i++) { Object attrDigest = attribute.get(i); if (attrDigest != null){ if (digest.equalsIgnoreCase((String) attrDigest)) { return true; } } } } catch (NoSuchAlgorithmException | CertificateEncodingException e) { throw new RealmUnavailableException(e); } return false; } }
/** * Hex-encode the current stream. * * @return an iterator over the encoded characters */ public CodePointIterator hexEncode() { return hexEncode(false); }
/** * Hex-encode the current stream. * * @return an iterator over the encoded characters */ public CodePointIterator hexEncode() { return hexEncode(false); }
@Override public boolean verifyCertificate(X509Certificate certificate, Attributes attributes) throws NamingException, RealmUnavailableException { Attribute attribute = attributes.get(ldapAttribute); if (attribute == null) return false; final int size = attribute.size(); try { MessageDigest md = MessageDigest.getInstance(algorithm); String digest = ByteIterator.ofBytes(md.digest(certificate.getEncoded())).hexEncode(true).drainToString(); for (int i = 0; i < size; i++) { Object attrDigest = attribute.get(i); if (attrDigest != null){ if (digest.equalsIgnoreCase((String) attrDigest)) { return true; } } } } catch (NoSuchAlgorithmException | CertificateEncodingException e) { throw new RealmUnavailableException(e); } return false; } }
@Override public boolean verifyCertificate(X509Certificate certificate, Attributes attributes) throws NamingException, RealmUnavailableException { Attribute attribute = attributes.get(ldapAttribute); if (attribute == null) return false; final int size = attribute.size(); try { MessageDigest md = MessageDigest.getInstance(algorithm); String digest = ByteIterator.ofBytes(md.digest(certificate.getEncoded())).hexEncode(true).drainToString(); for (int i = 0; i < size; i++) { Object attrDigest = attribute.get(i); if (attrDigest != null){ if (digest.equalsIgnoreCase((String) attrDigest)) { return true; } } } } catch (NoSuchAlgorithmException | CertificateEncodingException e) { throw new RealmUnavailableException(e); } return false; } }