RTCCryptoOptions.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright 2018 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #import <Foundation/Foundation.h>
  11. #import "RTCMacros.h"
  12. NS_ASSUME_NONNULL_BEGIN
  13. /**
  14. * Objective-C bindings for webrtc::CryptoOptions. This API had to be flattened
  15. * as Objective-C doesn't support nested structures.
  16. */
  17. RTC_OBJC_EXPORT
  18. @interface RTC_OBJC_TYPE (RTCCryptoOptions) : NSObject
  19. /**
  20. * Enable GCM crypto suites from RFC 7714 for SRTP. GCM will only be used
  21. * if both sides enable it
  22. */
  23. @property(nonatomic, assign) BOOL srtpEnableGcmCryptoSuites;
  24. /**
  25. * If set to true, the (potentially insecure) crypto cipher
  26. * SRTP_AES128_CM_SHA1_32 will be included in the list of supported ciphers
  27. * during negotiation. It will only be used if both peers support it and no
  28. * other ciphers get preferred.
  29. */
  30. @property(nonatomic, assign) BOOL srtpEnableAes128Sha1_32CryptoCipher;
  31. /**
  32. * If set to true, encrypted RTP header extensions as defined in RFC 6904
  33. * will be negotiated. They will only be used if both peers support them.
  34. */
  35. @property(nonatomic, assign) BOOL srtpEnableEncryptedRtpHeaderExtensions;
  36. /**
  37. * If set all RtpSenders must have an FrameEncryptor attached to them before
  38. * they are allowed to send packets. All RtpReceivers must have a
  39. * FrameDecryptor attached to them before they are able to receive packets.
  40. */
  41. @property(nonatomic, assign) BOOL sframeRequireFrameEncryption;
  42. /**
  43. * Initializes CryptoOptions with all possible options set explicitly. This
  44. * is done when converting from a native RTCConfiguration.crypto_options.
  45. */
  46. - (instancetype)initWithSrtpEnableGcmCryptoSuites:(BOOL)srtpEnableGcmCryptoSuites
  47. srtpEnableAes128Sha1_32CryptoCipher:(BOOL)srtpEnableAes128Sha1_32CryptoCipher
  48. srtpEnableEncryptedRtpHeaderExtensions:(BOOL)srtpEnableEncryptedRtpHeaderExtensions
  49. sframeRequireFrameEncryption:(BOOL)sframeRequireFrameEncryption
  50. NS_DESIGNATED_INITIALIZER;
  51. - (instancetype)init NS_UNAVAILABLE;
  52. @end
  53. NS_ASSUME_NONNULL_END