DTLS: Use ECDSA key

This commit is contained in:
Marvin W 2022-10-28 18:26:36 +02:00
parent 2ab7374aa5
commit a2f2224781
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A
2 changed files with 3 additions and 2 deletions

View file

@ -76,7 +76,7 @@ public class Handler {
int err = 0; int err = 0;
X509.PrivateKey private_key = X509.PrivateKey.create(); X509.PrivateKey private_key = X509.PrivateKey.create();
err = private_key.generate(PKAlgorithm.RSA, 2048); err = private_key.generate(PKAlgorithm.ECDSA, 256);
throw_if_error(err); throw_if_error(err);
var start_time = new DateTime.now_local().add_days(1); var start_time = new DateTime.now_local().add_days(1);

View file

@ -221,7 +221,8 @@ namespace GnuTLS {
public enum PKAlgorithm { public enum PKAlgorithm {
UNKNOWN, UNKNOWN,
RSA, RSA,
DSA; DSA,
ECDSA;
} }
[CCode (cname = "gnutls_digest_algorithm_t", cprefix = "GNUTLS_DIG_", has_type_id = false)] [CCode (cname = "gnutls_digest_algorithm_t", cprefix = "GNUTLS_DIG_", has_type_id = false)]