diff options
Diffstat (limited to 'src/ssl.d.tl')
| -rw-r--r-- | src/ssl.d.tl | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/src/ssl.d.tl b/src/ssl.d.tl new file mode 100644 index 00000000..1bd40348 --- /dev/null +++ b/src/ssl.d.tl | |||
| @@ -0,0 +1,113 @@ | |||
| 1 | local socket = require("socket") | ||
| 2 | local TCP = socket.TCP | ||
| 3 | |||
| 4 | local record ssl | ||
| 5 | record SSLCertificate | ||
| 6 | certificate: string | ||
| 7 | key: string | ||
| 8 | password: string|function | ||
| 9 | end | ||
| 10 | record SSLContext | ||
| 11 | mode: string | ||
| 12 | protocol: string | ||
| 13 | key: string | ||
| 14 | password: string|function | ||
| 15 | certificate: string | ||
| 16 | certificates: {SSLCertificate} | ||
| 17 | cafile: string | ||
| 18 | capath: string | ||
| 19 | verify: string|{string} | ||
| 20 | options: string|{string} | ||
| 21 | ciphers: string | ||
| 22 | ciphersuites: string | ||
| 23 | depth: number | ||
| 24 | dhparam: function | ||
| 25 | curve: string | ||
| 26 | curves_list: string | ||
| 27 | verifyext: string|{string} | ||
| 28 | alpn: string|function|{string} | ||
| 29 | dane: boolean | ||
| 30 | end | ||
| 31 | record X509Certificate | ||
| 32 | enum Algorithm | ||
| 33 | "sha1" | ||
| 34 | "sha256" | ||
| 35 | "sha512" | ||
| 36 | end | ||
| 37 | digest: function(X509Certificate, Algorithm): string | ||
| 38 | extensions: function(X509Certificate): {string} | ||
| 39 | issued: function(X509Certificate, X509Certificate): string | ||
| 40 | issuer: function(X509Certificate): string | ||
| 41 | notbefore: function(X509Certificate): string | ||
| 42 | notafter: function(X509Certificate): string | ||
| 43 | pem: function(X509Certificate): string | ||
| 44 | pubkey: function(X509Certificate): string | ||
| 45 | serial: function(X509Certificate): string | ||
| 46 | enum Encoding | ||
| 47 | "ai5" | ||
| 48 | "utf8" | ||
| 49 | end | ||
| 50 | setencode: function(X509Certificate, Encoding): string | ||
| 51 | subject: function(X509Certificate): string | ||
| 52 | validat: function(X509Certificate, string): boolean | ||
| 53 | end | ||
| 54 | record SSLConnection | ||
| 55 | close: function(SSLConnection) | ||
| 56 | dohandshake: function(SSLConnection): boolean, string | ||
| 57 | getalpn: function(SSLConnection): string | ||
| 58 | getfinished: function(SSLConnection): string | ||
| 59 | getpeercertificate: function(SSLConnection): X509Certificate | ||
| 60 | getpeercertificate: function(SSLConnection, number): X509Certificate | ||
| 61 | getpeerchain: function(SSLConnection): X509Certificate | ||
| 62 | getpeerverification: function(SSLConnection): string | ||
| 63 | getpeerfinished: function(SSLConnection): string | ||
| 64 | getsniname: function(SSLConnection): string | ||
| 65 | getstats: function(SSLConnection): number, number, number | ||
| 66 | info: function(SSLConnection): table | ||
| 67 | info: function(SSLConnection, string): string | ||
| 68 | enum ReceivePattern | ||
| 69 | "*a" | ||
| 70 | "*l" | ||
| 71 | end | ||
| 72 | receive: function(SSLConnection, number|ReceivePattern): string, string | ||
| 73 | receive: function(SSLConnection, number|ReceivePattern, string): string, string | ||
| 74 | send: function(SSLConnection): number, number|string, number | ||
| 75 | send: function(SSLConnection, number): number, number|string, number | ||
| 76 | send: function(SSLConnection, number, number): number, number|string, number | ||
| 77 | setdane: function(SSLConnection, string) | ||
| 78 | setstats: function(SSLConnection, number, number, number): number | ||
| 79 | enum TimeoutMode | ||
| 80 | "b" | ||
| 81 | "t" | ||
| 82 | end | ||
| 83 | settimeout: function(SSLConnection, number) | ||
| 84 | settimeout: function(SSLConnection, number, TimeoutMode) | ||
| 85 | settlsa: function(SSLConnection, number, number, number, number) | ||
| 86 | sni: function(SSLConnection, string) | ||
| 87 | sni: function(SSLConnection, {string:SSLContext}) | ||
| 88 | sni: function(SSLConnection, {string:SSLContext}, boolean) | ||
| 89 | enum Reason | ||
| 90 | "read" | ||
| 91 | "write" | ||
| 92 | "nothing" | ||
| 93 | end | ||
| 94 | want: function(SSLConnection): Reason | ||
| 95 | end | ||
| 96 | |||
| 97 | record config | ||
| 98 | protocols: {string:boolean} | ||
| 99 | curves: {string:boolean} | ||
| 100 | capabilities: {string:boolean} | ||
| 101 | options: {string:boolean} | ||
| 102 | algorithms: {string:boolean} | ||
| 103 | end | ||
| 104 | |||
| 105 | newcontext: function(SSLContext): SSLContext | ||
| 106 | wrap: function(TCP, SSLContext): SSLConnection | ||
| 107 | loadcertificate: function(string): X509Certificate | ||
| 108 | |||
| 109 | _COPYRIGHT: string | ||
| 110 | _VERSION: string | ||
| 111 | end | ||
| 112 | |||
| 113 | return ssl \ No newline at end of file | ||
