Function Crypto.generateSelfSignedCertificate

Generates a self-signed X509Certificate from the given CryptoKey and issuer_name. The certificate validity will be defined by not_before and not_after (first valid date and last valid date). The issuer_name must contain at least "CN=" (common name, i.e. the domain name), "O=" (organization, i.e. your company name), "C=" (country, i.e. 2 lettered ISO-3166 code of the country the organization is based in). A small example to generate an RSA key and a X509 self-signed certificate.

godot.d.reference.Ref!(godot.x509certificate.X509Certificate) generateSelfSignedCertificate (
  CryptoKey key,
  const(String) issuer_name = GodotStringLiteral().str(),
  const(String) not_before = GodotStringLiteral().str(),
  const(String) not_after = GodotStringLiteral().str()
) nothrow @nogc;

var crypto = Crypto.new() # Generate 4096 bits RSA key. var key = crypto.generate_rsa(4096) # Generate self-signed certificate using the given key. var cert = crypto.generate_self_signed_certificate(key, "CN=example.com,O=A Game Company,C=IT")