赞
踩
java -cp druid-1.0.27.jar com.alibaba.druid.filter.config.ConfigTools your_password
eg:
java -cp druid-1.0.27.jar com.alibaba.druid.filter.config.ConfigTools 123456
执行后获得以下内容:
privateKey:MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAtSW2imSbuFV+ZrErmOQP+jQfoQtyTQ62VQIAEe+mCgelY3gexKFA8CDcbj2n9pujh79PjO0hg2NE/mASR75ROQIDAQABAkEAqKX237uxOpnl94elNk/GDERw2geFH/a9jEEzfX9nT1efzP6PiPwb4H82V6FRoWfCwSsmlbeSMb3/4LxqBlVZ8QIhAPkAUQ8EYBt953UVOS4JX42qzDDtmfOKV0oEcJ0oED6VAiEAuj0np7Q5BRHYPITPL4vylr4MgBjgqa1fXfqZ7NlLsxUCIAwW9diSz8/F5y0KIMKZdeg8+LkPcEAg4WgYmxcmUNOZAiAJfFfquMk2suP6oSEUYOJoPyHP3HSE7+mtlbgFUkQCyQIgZOUpQRGZ1CRCsRf+4yJmV4wtUrmz+YhBdT851lwuoCU=
publicKey:MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALUltopkm7hVfmaxK5jkD/o0H6ELck0OtlUCABHvpgoHpWN4HsShQPAg3G49p/abo4e/T4ztIYNjRP5gEke+UTkCAwEAAQ==
password:bN2OreHMM6RtqaK87h91p/Ea9fev0uhHoOxgmt1c/RNphVnblVkxa18GPp8Zr7W3v/XMETBTikm1MR30sbidrw==
spring.datasource.druid.publicKey=生成的publicKey
filters: config,stat
connection-properties: config.decrypt=true;config.decrypt.key=生成的publicKey
完成以上配置即可实现Druid对数据密码的加密解密!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。