fork/rust-sdks
git clone https://git.julia.blue/fork/rust-sdks
e6f2164
livekit/livekit-ffi@0.13.0
1// Copyright 2023 LiveKit, Inc. 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto2" ; 16 17package livekit . proto ; 18option csharp_namespace= "LiveKit.Proto" ; 19 20// TODO(theomonnom): Should FrameCryptor be stateful on the client side and have their own handle? 21 22enum EncryptionType { 23NONE = 0 ; 24GCM = 1 ; 25CUSTOM = 2 ; 26} 27 28message FrameCryptor { 29required string participant_identity = 1 ; 30required string track_sid = 2 ; 31required int32 key_index = 3 ; 32required bool enabled = 4 ; 33} 34 35message KeyProviderOptions { 36// Only specify if you want to use a shared_key 37optional bytes shared_key = 1 ; 38required int32 ratchet_window_size = 2 ; 39required bytes ratchet_salt = 3 ; 40required int32 failure_tolerance = 4 ; // -1 = no tolerance 41} 42 43message E2eeOptions { 44required EncryptionType encryption_type = 1 ; 45required KeyProviderOptions key_provider_options = 2 ; 46} 47 48enum EncryptionState { 49NEW = 0 ; 50OK = 1 ; 51ENCRYPTION_FAILED = 2 ; 52DECRYPTION_FAILED = 3 ; 53MISSING_KEY = 4 ; 54KEY_RATCHETED = 5 ; 55INTERNAL_ERROR = 6 ; 56} 57 58message E2eeManagerSetEnabledRequest { 59required bool enabled = 1 ; 60} 61message E2eeManagerSetEnabledResponse {} 62 63message E2eeManagerGetFrameCryptorsRequest {} 64message E2eeManagerGetFrameCryptorsResponse { 65repeated FrameCryptor frame_cryptors = 1 ; 66} 67 68message FrameCryptorSetEnabledRequest { 69required string participant_identity = 1 ; 70required string track_sid = 2 ; 71required bool enabled = 3 ; 72} 73message FrameCryptorSetEnabledResponse {} 74 75message FrameCryptorSetKeyIndexRequest { 76required string participant_identity = 1 ; 77required string track_sid = 2 ; 78required int32 key_index = 3 ; 79} 80message FrameCryptorSetKeyIndexResponse {} 81 82message SetSharedKeyRequest { 83required bytes shared_key = 1 ; 84required int32 key_index = 2 ; 85} 86message SetSharedKeyResponse {} 87 88message RatchetSharedKeyRequest { 89required int32 key_index = 1 ; 90} 91message RatchetSharedKeyResponse { 92optional bytes new_key = 1 ; 93} 94 95message GetSharedKeyRequest { 96required int32 key_index = 1 ; 97} 98message GetSharedKeyResponse { 99optional bytes key = 1 ; 100} 101 102message SetKeyRequest { 103required string participant_identity = 1 ; 104required bytes key = 2 ; 105required int32 key_index = 3 ; 106} 107message SetKeyResponse {} 108 109message RatchetKeyRequest { 110required string participant_identity = 1 ; 111required int32 key_index = 2 ; 112} 113message RatchetKeyResponse { 114optional bytes new_key = 1 ; 115} 116 117message GetKeyRequest { 118required string participant_identity = 1 ; 119required int32 key_index = 2 ; 120} 121message GetKeyResponse { 122optional bytes key = 1 ; 123} 124 125message E2eeRequest { 126required uint64 room_handle = 1 ; 127oneof message { 128E2eeManagerSetEnabledRequest manager_set_enabled = 2 ; 129E2eeManagerGetFrameCryptorsRequest manager_get_frame_cryptors = 3 ; 130FrameCryptorSetEnabledRequest cryptor_set_enabled = 4 ; 131FrameCryptorSetKeyIndexRequest cryptor_set_key_index = 5 ; 132SetSharedKeyRequest set_shared_key = 6 ; 133RatchetSharedKeyRequest ratchet_shared_key = 7 ; 134GetSharedKeyRequest get_shared_key = 8 ; 135SetKeyRequest set_key = 9 ; 136RatchetKeyRequest ratchet_key = 10 ; 137GetKeyRequest get_key = 11 ; 138} 139} 140 141message E2eeResponse { 142oneof message { 143E2eeManagerSetEnabledResponse manager_set_enabled = 1 ; 144E2eeManagerGetFrameCryptorsResponse manager_get_frame_cryptors = 2 ; 145FrameCryptorSetEnabledResponse cryptor_set_enabled = 3 ; 146FrameCryptorSetKeyIndexResponse cryptor_set_key_index = 4 ; 147SetSharedKeyResponse set_shared_key = 5 ; 148RatchetSharedKeyResponse ratchet_shared_key = 6 ; 149GetSharedKeyResponse get_shared_key = 7 ; 150SetKeyResponse set_key = 8 ; 151RatchetKeyResponse ratchet_key = 9 ; 152GetKeyResponse get_key = 10 ; 153} 154}