public boolean exists(String dn) throws NamingException { try { ctx.getAttributes(dn); return true; } catch (NameNotFoundException e) { return false; } }
public Attributes getAttributes(String name) throws NamingException { return ctx.getAttributes(name); }
public boolean exists(String dn) throws NamingException { try { ctx.getAttributes(dn); return true; } catch (NameNotFoundException e) { return false; } }
public Attributes getAttributes(String name, String[] attrIDs) throws NamingException { return ctx.getAttributes(name, attrIDs); }
public Attributes getAttributes(String name, String[] attrIDs) throws NamingException { return ctx.getAttributes(name, attrIDs); }
public Attributes getAttributes(String name) throws NamingException { return ctx.getAttributes(name); }
private X509Certificate[] loadCertificates(String dn) throws NamingException, CertificateException { Attributes attrs = ctx.getAttributes(dn, new String[] { userCertificate } ); Attribute attr = attrs.get(userCertificate); if (attr == null) return EMPTY_X509_CERTIFICATES; CertificateFactory cf = CertificateFactory.getInstance("X509"); X509Certificate[] certs = new X509Certificate[attr.size()]; for (int i = 0; i < certs.length; i++) certs[i] = (X509Certificate) cf.generateCertificate( new ByteArrayInputStream((byte[]) attr.get(i))); return certs; }
private X509Certificate[] loadCertificates(String dn) throws NamingException, CertificateException { Attributes attrs = ctx.getAttributes(dn, new String[] { userCertificate } ); Attribute attr = attrs.get(userCertificate); if (attr == null) return EMPTY_X509_CERTIFICATES; CertificateFactory cf = CertificateFactory.getInstance("X509"); X509Certificate[] certs = new X509Certificate[attr.size()]; for (int i = 0; i < certs.length; i++) certs[i] = (X509Certificate) cf.generateCertificate( new ByteArrayInputStream((byte[]) attr.get(i))); return certs; }
public Connection findConnection(String connDN) throws NamingException { String[] attrIds = { "dicomHostname", "dicomPort", "dicomTLSCipherSuite", "dicomInstalled" }; Attributes attrs = ctx.getAttributes(connDN, attrIds); Connection conn = new Connection(); loadFrom(conn, attrs, false); return conn; }
public Connection findConnection(String connDN) throws NamingException { String[] attrIds = { "dicomHostname", "dicomPort", "dicomTLSCipherSuite", "dicomInstalled" }; Attributes attrs = ctx.getAttributes(connDN, attrIds); Connection conn = new Connection(); loadFrom(conn, attrs, false); return conn; }
private void storeCertificates(String dn, X509Certificate... certs) throws CertificateEncodingException, NamingException { byte[][] vals = new byte[certs.length][]; for (int i = 0; i < vals.length; i++) vals[i] = certs[i].getEncoded(); Attributes attrs = ctx.getAttributes(dn, new String[] { "objectClass" } ); ModificationItem replaceCert = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr(userCertificate, vals )); ctx.modifyAttributes(dn, LdapUtils.hasObjectClass(attrs, pkiUser) ? new ModificationItem[] { replaceCert } : new ModificationItem[] { new ModificationItem( DirContext.ADD_ATTRIBUTE, LdapUtils.attr("objectClass", pkiUser )), replaceCert }); }
private void storeCertificates(String dn, X509Certificate... certs) throws CertificateEncodingException, NamingException { byte[][] vals = new byte[certs.length][]; for (int i = 0; i < vals.length; i++) vals[i] = certs[i].getEncoded(); Attributes attrs = ctx.getAttributes(dn, new String[] { "objectClass" } ); ModificationItem replaceCert = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr(userCertificate, vals )); ctx.modifyAttributes(dn, LdapUtils.hasObjectClass(attrs, pkiUser) ? new ModificationItem[] { replaceCert } : new ModificationItem[] { new ModificationItem( DirContext.ADD_ATTRIBUTE, LdapUtils.attr("objectClass", pkiUser )), replaceCert }); }