Click or drag to resize

CryptoGenerateSelfSignedCertificate Method

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.

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")

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public X509Certificate GenerateSelfSignedCertificate(
	CryptoKey key,
	string issuerName = "CN=myserver,O=myorganisation,C=IT",
	string notBefore = "20140101000000",
	string notAfter = "20340101000000"
)

Parameters

key
Type: GodotCryptoKey

[Missing <param name="key"/> documentation for "M:Godot.Crypto.GenerateSelfSignedCertificate(Godot.CryptoKey,System.String,System.String,System.String)"]

issuerName (Optional)
Type: SystemString

[Missing <param name="issuerName"/> documentation for "M:Godot.Crypto.GenerateSelfSignedCertificate(Godot.CryptoKey,System.String,System.String,System.String)"]

notBefore (Optional)
Type: SystemString

[Missing <param name="notBefore"/> documentation for "M:Godot.Crypto.GenerateSelfSignedCertificate(Godot.CryptoKey,System.String,System.String,System.String)"]

notAfter (Optional)
Type: SystemString

[Missing <param name="notAfter"/> documentation for "M:Godot.Crypto.GenerateSelfSignedCertificate(Godot.CryptoKey,System.String,System.String,System.String)"]

Return Value

Type: X509Certificate

[Missing <returns> documentation for "M:Godot.Crypto.GenerateSelfSignedCertificate(Godot.CryptoKey,System.String,System.String,System.String)"]

See Also