summaryrefslogtreecommitdiff
path: root/core/crypto/crypto.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2020-06-06 16:09:28 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2020-06-18 15:29:39 +0200
commit8e3f9aa68104fefc959d2d6af7cba3c11bfde3fb (patch)
tree18fdcab640abab3175f557131d36b48e83463b38 /core/crypto/crypto.cpp
parentdfcc11fa52622680fe427c19dfe0528563a0691e (diff)
Implement RSA encryption/decryption.
Diffstat (limited to 'core/crypto/crypto.cpp')
-rw-r--r--core/crypto/crypto.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/crypto/crypto.cpp b/core/crypto/crypto.cpp
index f1d13b0633..29d02e11df 100644
--- a/core/crypto/crypto.cpp
+++ b/core/crypto/crypto.cpp
@@ -88,6 +88,8 @@ void Crypto::_bind_methods() {
ClassDB::bind_method(D_METHOD("generate_self_signed_certificate", "key", "issuer_name", "not_before", "not_after"), &Crypto::generate_self_signed_certificate, DEFVAL("CN=myserver,O=myorganisation,C=IT"), DEFVAL("20140101000000"), DEFVAL("20340101000000"));
ClassDB::bind_method(D_METHOD("sign", "hash_type", "hash", "key"), &Crypto::sign);
ClassDB::bind_method(D_METHOD("verify", "hash_type", "hash", "signature", "key"), &Crypto::verify);
+ ClassDB::bind_method(D_METHOD("encrypt", "key", "plaintext"), &Crypto::encrypt);
+ ClassDB::bind_method(D_METHOD("decrypt", "key", "ciphertext"), &Crypto::decrypt);
}
/// Resource loader/saver