Skip to content

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jlangch committed Dec 4, 2024
1 parent 189107e commit fdb7b9b
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions src/main/java/com/github/jlangch/venice/util/ssl/Keystores.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,36 +83,36 @@ public static String subjectDN(final KeyStore keystore, final String alias) thro
return certificate(keystore, alias).getSubjectDN().getName();
}

public static Map<String,Object> parseSubjectDN(final KeyStore keystore, final String alias) {
try {
return parseDN(subjectDN(keystore, alias));
}
catch (Exception ex) {
throw new RuntimeException(ex.getMessage(), ex);
}
}
public static Map<String,Object> parseSubjectDN(final KeyStore keystore, final String alias) {
try {
return parseDN(subjectDN(keystore, alias));
}
catch (Exception ex) {
throw new RuntimeException(ex.getMessage(), ex);
}
}

public static String issuerDN(final KeyStore keystore, final String alias) throws KeyStoreException {
return certificate(keystore, alias).getIssuerDN().getName();
}

public static Map<String,Object> parseIssuerDN(final KeyStore keystore, final String alias) {
try {
return parseDN(issuerDN(keystore, alias));
}
catch (Exception ex) {
throw new RuntimeException(ex.getMessage(), ex);
}
}

public static Map<String,Object> parseDN(final String dn) {
try {
return parse(new LdapName(dn));
}
catch (Exception ex) {
throw new RuntimeException(ex.getMessage(), ex);
}
}
public static Map<String,Object> parseIssuerDN(final KeyStore keystore, final String alias) {
try {
return parseDN(issuerDN(keystore, alias));
}
catch (Exception ex) {
throw new RuntimeException(ex.getMessage(), ex);
}
}

public static Map<String,Object> parseDN(final String dn) {
try {
return parse(new LdapName(dn));
}
catch (Exception ex) {
throw new RuntimeException(ex.getMessage(), ex);
}
}

public static boolean hasExpired(final KeyStore keystore, final String alias) throws KeyStoreException {
return expiryDate(keystore, alias).isBefore(LocalDateTime.now());
Expand Down Expand Up @@ -146,15 +146,15 @@ private static LocalDateTime toLocalDateTime(final Date date) {
}
}

private static Map<String,Object> parse(final LdapName ln) {
final Map<String,Object> elements = new HashMap<>();
private static Map<String,Object> parse(final LdapName ln) {
final Map<String,Object> elements = new HashMap<>();

for(int ii=0; ii<ln.size(); ii++) {
final Rdn rdn = ln.getRdn(ii);
elements.put(rdn.getType(), rdn.getValue());
}
for(int ii=0; ii<ln.size(); ii++) {
final Rdn rdn = ln.getRdn(ii);
elements.put(rdn.getType(), rdn.getValue());
}

return elements;
}
return elements;
}

}

0 comments on commit fdb7b9b

Please sign in to comment.