RTCFrameCryptorKeyProvider.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright 2022 LiveKit
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. #import <WebRTC/RTCMacros.h>
  18. NS_ASSUME_NONNULL_BEGIN
  19. RTC_OBJC_EXPORT
  20. @interface RTC_OBJC_TYPE (RTCFrameCryptorKeyProvider) : NSObject
  21. - (void)setSharedKey:(NSData *)key withIndex:(int)index;
  22. - (NSData *)ratchetSharedKey:(int)index;
  23. - (NSData *)exportSharedKey:(int)index;
  24. - (void)setKey:(NSData *)key withIndex:(int)index forParticipant:(NSString *)participantId;
  25. - (NSData *)ratchetKey:(NSString *)participantId withIndex:(int)index;
  26. - (NSData *)exportKey:(NSString *)participantId withIndex:(int)index;
  27. - (void)setSifTrailer:(NSData *)trailer;
  28. - (instancetype)initWithRatchetSalt:(NSData *)salt
  29. ratchetWindowSize:(int)windowSize
  30. sharedKeyMode:(BOOL)sharedKey
  31. uncryptedMagicBytes:(nullable NSData *)uncryptedMagicBytes;
  32. - (instancetype)initWithRatchetSalt:(NSData *)salt
  33. ratchetWindowSize:(int)windowSize
  34. sharedKeyMode:(BOOL)sharedKey
  35. uncryptedMagicBytes:(nullable NSData *)uncryptedMagicBytes
  36. failureTolerance:(int)failureTolerance;
  37. @end
  38. NS_ASSUME_NONNULL_END