Skip to content

Commit

Permalink
Rename internal method's name
Browse files Browse the repository at this point in the history
  • Loading branch information
haimaychao committed Mar 8, 2024
1 parent cbea522 commit f5e4114
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,7 @@ static <S> S run(RetryWithZero<S> f, char[] password) throws Exception {
public Key engineGetKey(String alias, char[] password)
throws NoSuchAlgorithmException, UnrecoverableKeyException {
Entry entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
Key entryKey = internalGetKey(entry, password);
return entryKey;
return internalGetKey(entry, password);
}

private Key internalGetKey(Entry entry, char[] password)
Expand Down Expand Up @@ -476,8 +475,7 @@ private Key internalGetKey(Entry entry, char[] password)
*/
public Certificate[] engineGetCertificateChain(String alias) {
Entry entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
Certificate[] certChain = internalGetCertificateChain(entry);
return certChain;
return internalGetCertificateChain(entry);
}

private Certificate[] internalGetCertificateChain(Entry entry) {
Expand Down Expand Up @@ -1076,10 +1074,10 @@ public int engineSize() {
*/
public boolean engineIsKeyEntry(String alias) {
Entry entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
return internalEngineIsKeyEntry(entry);
return internalIsKeyEntry(entry);
}

private boolean internalEngineIsKeyEntry(Entry entry) {
private boolean internalIsKeyEntry(Entry entry) {
return entry instanceof KeyEntry;
}

Expand All @@ -1093,10 +1091,10 @@ private boolean internalEngineIsKeyEntry(Entry entry) {

public boolean engineIsCertificateEntry(String alias) {
Entry entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
return internalEngineIsCertificateEntry(entry);
return internalIsCertificateEntry(entry);
}

private boolean internalEngineIsCertificateEntry(Entry entry) {
private boolean internalIsCertificateEntry(Entry entry) {
return entry instanceof CertEntry certEntry &&
certEntry.trustedKeyUsage != null;
}
Expand Down Expand Up @@ -1326,7 +1324,7 @@ public KeyStore.Entry engineGetEntry(String alias,

Entry entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
if (protParam == null) {
if (internalEngineIsCertificateEntry(entry)) {
if (internalIsCertificateEntry(entry)) {
if (debug != null) {
debug.println("Retrieved a trusted certificate at " +
"alias '" + alias + "'");
Expand All @@ -1341,10 +1339,10 @@ public KeyStore.Entry engineGetEntry(String alias,
}

if (protParam instanceof KeyStore.PasswordProtection) {
if (internalEngineIsCertificateEntry(entry)) {
if (internalIsCertificateEntry(entry)) {
throw new UnsupportedOperationException
("trusted certificate entries are not password-protected");
} else if (internalEngineIsKeyEntry(entry)) {
} else if (internalIsKeyEntry(entry)) {
KeyStore.PasswordProtection pp =
(KeyStore.PasswordProtection)protParam;
char[] password = pp.getPassword();
Expand Down

0 comments on commit f5e4114

Please sign in to comment.