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