org.cesecore.certificates.ca.catoken.PropertiesWithHiddenPIN Maven / Gradle / Ivy
/*************************************************************************
* *
* CESeCore: CE Security Core *
* *
* This software is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or any later version. *
* *
* See terms of license at gnu.org. *
* *
*************************************************************************/
package org.cesecore.certificates.ca.catoken;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import org.cesecore.keys.token.CryptoToken;
/**
* Class for printing properties (for debug purposes) without revealing any pin properties in the log file
*
* @version $Id: PropertiesWithHiddenPIN.java 17625 2013-09-20 07:12:06Z netmackan $
*/
public class PropertiesWithHiddenPIN extends Properties {
private static final long serialVersionUID = -2240419700704551683L;
public PropertiesWithHiddenPIN() {
}
/**
* @param defaults
*/
public PropertiesWithHiddenPIN(Properties defaults) {
super(defaults);
}
public synchronized String toString() {
int max = size() - 1;
if (max == -1) {
return "{}";
}
final StringBuilder sb = new StringBuilder();
final Iterator> it = entrySet().iterator();
sb.append('{');
for (int i = 0;; i++) {
final Map.Entry