1

有人以前使用过 jasypt 加密吗?在 application.groovy Grails 3 中加密邮件的密码。

我很困惑如何在配置文件中加密密码,这就是我所做的,但它不起作用。

environments {
development {
    grails {
        mail {
            host = "smtp.gmail.com"
            port = 465
            username = "xxxxx@xxxxxx"
            password = jasypt
            props = ["mail.smtp.auth":"true",
                "mail.smtp.socketFactory.port":"465",
                "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
                "mail.smtp.socketFactory.fallback":"false"]

        }
    }
}
production {
    grails.logging.jul.usebridge = false
}

}

jasypt {
algorithm = "PBEWITHSHA256AND256BITAES-CBC-BC"
providerName = "BC"
password = "yizhen2009"
keyObtentionIterations = 1000 }

两个代码都在同一个文件中。

4

0 回答 0