/
CryptoKey.hx
119 lines (100 loc) · 3.95 KB
/
CryptoKey.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other `godot.Resource`.
They can be used to generate a self-signed `godot.X509Certificate` via `godot.Crypto.generateSelfSignedCertificate` and as private key in `godot.StreamPeerSSL.acceptStream` along with the appropriate certificate.
Note: Not available in HTML5 exports.
**/
@:libType
@:csNative
@:native("Godot.CryptoKey")
@:autoBuild(godot.Godot.buildUserClass())
extern class CryptoKey extends godot.Resource {
@:native("new")
public function new():Void;
#if doc_gen
/**
Saves a key to the given `path`. If `public_only` is `true`, only the public key will be saved.
Note: `path` should be a "*.pub" file if `public_only` is `true`, a "*.key" file otherwise.
**/
@:native("Save")
public function save(path:std.String, ?publicOnly:Bool):godot.Error;
#else
/**
Saves a key to the given `path`. If `public_only` is `true`, only the public key will be saved.
Note: `path` should be a "*.pub" file if `public_only` is `true`, a "*.key" file otherwise.
**/
@:native("Save")
public overload function save(path:std.String):godot.Error;
/**
Saves a key to the given `path`. If `public_only` is `true`, only the public key will be saved.
Note: `path` should be a "*.pub" file if `public_only` is `true`, a "*.key" file otherwise.
**/
@:native("Save")
public overload function save(path:std.String, publicOnly:Bool):godot.Error;
#end
#if doc_gen
/**
Loads a key from `path`. If `public_only` is `true`, only the public key will be loaded.
Note: `path` should be a "*.pub" file if `public_only` is `true`, a "*.key" file otherwise.
**/
@:native("Load")
public function load(path:std.String, ?publicOnly:Bool):godot.Error;
#else
/**
Loads a key from `path`. If `public_only` is `true`, only the public key will be loaded.
Note: `path` should be a "*.pub" file if `public_only` is `true`, a "*.key" file otherwise.
**/
@:native("Load")
public overload function load(path:std.String):godot.Error;
/**
Loads a key from `path`. If `public_only` is `true`, only the public key will be loaded.
Note: `path` should be a "*.pub" file if `public_only` is `true`, a "*.key" file otherwise.
**/
@:native("Load")
public overload function load(path:std.String, publicOnly:Bool):godot.Error;
#end
/**
Return `true` if this CryptoKey only has the public part, and not the private one.
**/
@:native("IsPublicOnly")
public function isPublicOnly():Bool;
#if doc_gen
/**
Returns a string containing the key in PEM format. If `public_only` is `true`, only the public key will be included.
**/
@:native("SaveToString")
public function saveToString(?publicOnly:Bool):std.String;
#else
/**
Returns a string containing the key in PEM format. If `public_only` is `true`, only the public key will be included.
**/
@:native("SaveToString")
public overload function saveToString():std.String;
/**
Returns a string containing the key in PEM format. If `public_only` is `true`, only the public key will be included.
**/
@:native("SaveToString")
public overload function saveToString(publicOnly:Bool):std.String;
#end
#if doc_gen
/**
Loads a key from the given `string`. If `public_only` is `true`, only the public key will be loaded.
**/
@:native("LoadFromString")
public function loadFromString(stringKey:std.String, ?publicOnly:Bool):godot.Error;
#else
/**
Loads a key from the given `string`. If `public_only` is `true`, only the public key will be loaded.
**/
@:native("LoadFromString")
public overload function loadFromString(stringKey:std.String):godot.Error;
/**
Loads a key from the given `string`. If `public_only` is `true`, only the public key will be loaded.
**/
@:native("LoadFromString")
public overload function loadFromString(stringKey:std.String, publicOnly:Bool):godot.Error;
#end
}