Skip to content

Commit

Permalink
Clean up log messages in pki CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Jan 24, 2025
1 parent 550b2c1 commit 3770a7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions base/common/src/main/java/org/dogtagpki/nss/NSSDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,10 @@ public void addCertificate(
X509CertImpl certImpl,
String trustFlags) throws Exception {

CryptoToken token = CryptoUtil.getKeyStorageToken(tokenName);
logger.info("NSSDatabase: Importing cert " + nickname + " into " + token.getName());
tokenName = tokenName == null ? CryptoUtil.INTERNAL_TOKEN_NAME : tokenName;
logger.debug("Importing cert " + nickname + " into " + tokenName + " token");

CryptoToken token = CryptoUtil.getKeyStorageToken(tokenName);
CryptoStore store = token.getCryptoStore();

org.mozilla.jss.crypto.X509Certificate cert = store.importCert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ public void init() throws Exception {
}
}

logger.info("Initializing NSS");
logger.debug("Initializing NSS");
CryptoManager.initialize(nssdb.getPath().toString());

CryptoManager manager;
Expand All @@ -535,7 +535,7 @@ public void init() throws Exception {
String tokenName = config.getTokenName();
tokenName = tokenName == null ? CryptoUtil.INTERNAL_TOKEN_NAME : tokenName;

logger.info("Logging into " + tokenName + " token");
logger.debug("Logging into " + tokenName + " token");

CryptoToken token = CryptoUtil.getKeyStorageToken(tokenName);
Password password = new Password(config.getNSSPassword().toCharArray());
Expand All @@ -557,7 +557,7 @@ public void init() throws Exception {

for (String tokenName : passwords.keySet()) {

logger.info("Logging into " + tokenName + " token");
logger.debug("Logging into " + tokenName + " token");

CryptoToken token = CryptoUtil.getKeyStorageToken(tokenName);
Password password = new Password(passwords.get(tokenName).toCharArray());
Expand All @@ -577,7 +577,7 @@ public void init() throws Exception {

String tokenName = config.getTokenName();
tokenName = tokenName == null ? CryptoUtil.INTERNAL_TOKEN_NAME : tokenName;
logger.info("Using " + tokenName + " token");
logger.debug("Using " + tokenName + " token");

CryptoToken token = CryptoUtil.getKeyStorageToken(tokenName);
manager.setThreadToken(token);
Expand Down

0 comments on commit 3770a7f

Please sign in to comment.