4

I was looking for some crypto functions in playframework, and in the documentation for encryptAES they say,"Encrypt a String with the AES encryption standard using the application secret".

Ok the function is looking like this but where can i found this secret key ?

Offical function code:

public static java.lang.String encryptAES(java.lang.String value)

    Encrypt a String with the AES encryption standard using the application secret 

Thanks

4

1 回答 1

6

它放在conf/application.conf文件中

在这两个 - Play 1.x 和 Play 2.x 中,它的名字是application.secret

您还可以将自定义键与方法一起使用:

public static java.lang.String encryptAES(java.lang.String value,
                                          java.lang.String privateKey)

http://www.playframework.org/documentation/api/1.2/play/libs/Crypto.html#encryptAES(java.lang.String , java.lang.String)

于 2012-09-03T15:41:26.140 回答