File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed
Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ interface client {
2+ use types . {error };
3+
4+ resource connector {
5+ constructor ();
6+
7+ /// Set up the encryption stream transform.
8+ /// This takes an unprotected `cleartext` application data stream and
9+ /// returns an encrypted data stream, ready to be sent out over the network.
10+ /// Closing the `cleartext` stream will cause a `close_notify` packet to be emitted on the returned output stream.
11+ send : func (cleartext : stream <u8 >) -> tuple <stream <u8 >, future <result <_ , error >>>;
12+
13+ /// Set up the decryption stream transform.
14+ /// This takes an encrypted data stream, as received via e.g. the network,
15+ /// and returns a decrypted application data stream.
16+ receive : func (ciphertext : stream <u8 >) -> tuple <stream <u8 >, future <result <_ , error >>>;
17+
18+ /// Perform the handshake.
19+ /// The `send` & `receive` streams must be set up before calling this method.
20+ connect : static async func (this : connector , server-name : string ) -> result <_ , error >;
21+ }
22+ }
Original file line number Diff line number Diff line change 1+ interface types {
2+ resource error {
3+ to-debug-string : func () -> string ;
4+ }
5+ }
Original file line number Diff line number Diff line change 1+ package wasi : tls @ 0.3.0-draft;
2+
3+ world imports {
4+ import client ;
5+ import types ;
6+ }
You can’t perform that action at this time.
0 commit comments