Make private methods protected
@@ -94,7 +94,7 @@ public class LdapCertificateRepo implements CertificateRepo {
return getCRLsFromLdap(rootDN, ldapConfig.getCrlFilter(), ldapConfig.getAttrCrlBinary());
}
- private List<X509Certificate> getCertificatesFromLdap(String tmpRootDN, String tmpFilter, String tmpAttrName) {
+ protected List<X509Certificate> getCertificatesFromLdap(String tmpRootDN, String tmpFilter, String tmpAttrName) {
try {
List<X509Certificate> certificates = new ArrayList<>();
NamingEnumeration<SearchResult> answer = ldapSearch.searchSubTree(tmpRootDN, tmpFilter);
@@ -115,7 +115,7 @@ public class LdapCertificateRepo implements CertificateRepo {
}
}
- private List<X509CRL> getCRLsFromLdap(String tmpRootDN, String tmpFilter, String tmpAttrName) {
+ protected List<X509CRL> getCRLsFromLdap(String tmpRootDN, String tmpFilter, String tmpAttrName) {
try {
List<X509CRL> crls = new ArrayList<>();
NamingEnumeration<SearchResult> answer = ldapSearch.searchSubTree(tmpRootDN, tmpFilter);
@@ -136,7 +136,7 @@ public class LdapCertificateRepo implements CertificateRepo {
}
}
- private void saveCertificate(X509Certificate cert, String dn, Map<String, String> appAttrs) {
+ protected void saveCertificate(X509Certificate cert, String dn, Map<String, String> appAttrs) {
Attributes attribs = new BasicAttributes();
attribs.put(new BasicAttribute(ATTR_OBJECT_CLASS, ldapConfig.getCertObjectClass()));
attribs.put(new BasicAttribute(ldapConfig.getAttrUID(), cert.getSubjectX500Principal().getName()));
@@ -156,7 +156,7 @@ public class LdapCertificateRepo implements CertificateRepo {
}
}
- private void addConstantAttributes(String names, String values, Attributes attribs) {
+ protected void addConstantAttributes(String names, String values, Attributes attribs) {
String[] arrNames = names.split(",");
String[] arrValues = values.split(",");
if (arrNames.length != arrValues.length) {
@@ -227,17 +227,17 @@ public class LdapCertificateRepo implements CertificateRepo {
}
- private String getDnForIdentifier(String id) {
+ protected String getDnForIdentifier(String id) {
String escapedIdentifier = id.replaceAll("\\/", Matcher.quoteReplacement("\\/"));
return String.format(ldapConfig.getServiceCertRDNTemplate(), escapedIdentifier) + "," + rootDN;
}
- private X509Certificate getCertificateForDn(String dn) throws NamingException {
+ protected X509Certificate getCertificateForDn(String dn) throws NamingException {
Attribute attr = ldapSearch.getAttribute(dn, ldapConfig.getAttrCrtBinary());
return getCert(attr);
}
- private X509Certificate getCertificateForUIDAttr(String uid) throws NamingException {
+ protected X509Certificate getCertificateForUIDAttr(String uid) throws NamingException {
String filter = String.format(filterUIDTemplate, uid);
Attribute attr = ldapSearch.findAttribute(rootDN, filter, ldapConfig.getAttrCrtBinary());
return getCert(attr);
@@ -257,7 +257,7 @@ public class LdapCertificateRepo implements CertificateRepo {
}
}
- private X509Certificate getCert(Attribute attr) {
+ protected X509Certificate getCert(Attribute attr) {
if (attr == null) {
return null;
}
