SensitiveDataUtilsTest.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:planyourexchange 作者:
/**
 * This method is used to generated encrypted keys and hashes
 * with the secret password and salt above
 * @throws UnsupportedEncodingException
 * @throws GeneralSecurityException
 */
@Suppress
public void testEncryptGenerate() throws UnsupportedEncodingException, GeneralSecurityException {
    Map<String,String> map = new HashMap<>();

    map.put("AdUnitId","?");
    map.put("TestDeviceId","?");
    map.put("service.url","?");
    map.put("service.userName","?");
    map.put("service.password","?");
    map.put("AnalyticsId", "?");
    map.put("test","test");

    StringBuilder stringBuilder = new StringBuilder();

    for (Map.Entry<String,String> entry : map.entrySet()) {
        stringBuilder.append(entry.getKey())
                .append(" = ")
                .append(sensitiveDataUtils.hashKey(entry.getKey()))
                .append("\n")
                .append(entry.getValue())
                .append(" = ")
                .append(sensitiveDataUtils.encrypt(entry.getValue()))
                .append("\n");
    }

    fail(stringBuilder.toString());
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号