summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLEncryptionLifecycleManager.h
blob: eb6aa951e3001443bea9b0571a8c9cbcea59f833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
//  SDLEncryptionLifecycleManager.h
//  SmartDeviceLink
//
//  Created by standa1 on 6/27/19.
//  Copyright © 2019 smartdevicelink. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SDLConnectionManagerType.h"
#import "SDLProtocolListener.h"

@class SDLEncryptionConfiguration;
@class SDLProtocol;

NS_ASSUME_NONNULL_BEGIN

@interface SDLEncryptionLifecycleManager : NSObject <SDLProtocolListener>

/**
 *  Whether or not the encryption session is connected.
 */
@property (assign, nonatomic, readonly, getter=isEncryptionReady) BOOL encryptionReady;


- (instancetype)init NS_UNAVAILABLE;

/**
 Create a new encryption lifecycle manager for apps that need encryption.
 
 @param connectionManager The pass-through for RPCs
 @param configuration This session's configuration
 @return A new encryption lifecycle manager
 */
- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager configuration:(SDLEncryptionConfiguration *)configuration;

/**
 *  Start the manager. This is used internally to get notified of the ACK message.
 */
- (void)startWithProtocol:(SDLProtocol *)protocol;

/**
 *  Stop the manager. This method is used internally.
 */
- (void)stop;

/**
 *  Check whether or not an RPC needs encryption.
 */
- (BOOL)rpcRequiresEncryption:(__kindof SDLRPCMessage *)rpc;

/**
 *  Attempt to manually start a secure service.
 */
- (void)startEncryptionService;

@end

NS_ASSUME_NONNULL_END