@Override
    public String toString() {
        return String.format(TO_STRING_FORMAT, getClass().getSimpleName(), maskKeyData(defaultPublicKey),
                maskKeyData(defaultPrivateKey), maskKeyData(publicKeys), maskKeyData(privateKeys));
    }
@Test
    public void testToString() {
        DefaultCryptoKeyReaderConfigurationData conf = new DefaultCryptoKeyReaderConfigurationData();
        assertEquals(conf.toString(),
                "DefaultCryptoKeyReaderConfigurationData(defaultPublicKey=null, defaultPrivateKey=null, publicKeys={}, privateKeys={})");

        conf.setDefaultPublicKey("file:///path/to/default-public.key");
        conf.setDefaultPrivateKey("data:AAAAA");
        conf.setPublicKey("key1", "file:///path/to/public.key");
        conf.setPrivateKey("key2", "file:///path/to/private.key");
        assertEquals(conf.toString(),
                "DefaultCryptoKeyReaderConfigurationData(defaultPublicKey=file:///path/to/default-public.key, defaultPrivateKey=data:*****, publicKeys={key1=file:///path/to/public.key}, privateKeys={key2=file:///path/to/private.key})");

        conf.setPublicKey("key3", "data:BBBBB");
        conf.setPrivateKey("key4", "data:CCCCC");
        assertTrue(conf.toString().startsWith(
                "DefaultCryptoKeyReaderConfigurationData(defaultPublicKey=file:///path/to/default-public.key, defaultPrivateKey=data:*****, publicKeys={"));
        assertTrue(conf.toString().contains("key3=data:*****"));
        assertFalse(conf.toString().contains("key3=data:BBBBB"));
        assertTrue(conf.toString().contains("key4=data:*****"));
        assertFalse(conf.toString().contains("key4=data:CCCCC"));
        assertTrue(conf.toString().endsWith("})"));
    }