3
Grails 플러그인 : crypto : 2.0을 사용하고 있으며 PGP에서 메시지 암호를 해독하는 데 문제가 있습니다.grails OpenPGP 암호 해독이 작동하지 않습니다.
def index3() {
def pgpK = PGP.generateKeyPair()
String encodedPublic = pgpK.encodedPublicKey
String encodedPrivate = pgpK.encodedPrivateKey
PGP pgp = new PGP (encodedPublic, encodedPrivate)
String message = "Hello World"
String encodeStr = pgp.encryptArmored(message)
println(encodeStr)
String decryptStr = pgp.decrypt(encodeStr.getBytes()).toString()
println(decryptStr)
}
실행, 그것은 나에게 장갑 PGP로 암호화 된 메시지를 보여줍니다
여기 내 컨트롤러 코드입니다. 그러나 기갑 메시지를 사용하고 해독하면 항상 null을 반환합니다.
아무도이 문제가 발생 했습니까?