This repository has been archived by the owner on Sep 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CryptoKitEngine.h
58 lines (46 loc) · 2.2 KB
/
CryptoKitEngine.h
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
//
// CryptoKitEngine.h
// CryptoKit
//
// Created by Andreas Meingast on 09/06/16.
// Copyright © 2016 Andreas Meingast. All rights reserved.
//
#import <CryptoKit/CryptoKitTypes.h>
NS_ASSUME_NONNULL_BEGIN
@interface CryptoKitEngine : NSObject
+ (CryptoKitEngine *)sharedInstance;
#pragma mark - Digests
- (nullable NSData *)calculateDigest:(NSInputStream *)inputStream
digestType:(CryptoKitDigestType)digestType
error:(NSError *__nullable *)error;
- (nullable CKDigestBatchResult *)calculateDigests:(NSInputStream *)inputStream
error:(NSError *__nullable *)error;
- (nullable NSString *)digestToHumanReadableRepresentation:(NSData *)data
digestType:(CryptoKitDigestType)digestType
error:(NSError *__nullable *)error;
#pragma mark - Encryption
- (BOOL)encryptStream:(NSInputStream *)inputStream
outputStream:(NSOutputStream *)outputStream
password:(NSString *)password
error:(NSError *__nullable *)error;
- (BOOL)decryptStream:(NSInputStream *)inputStream
outputStream:(NSOutputStream *)outputStream
password:(NSString *)password
error:(NSError *__nullable *)error;
- (BOOL)recryptInputStream:(NSInputStream *)inputStream
toOutputStream:(NSOutputStream *)outputStream
password:(NSString *)password
newPassword:(NSString *)newPassword
error:(NSError *__nullable *)error;
#pragma mark - Partitioning
- (BOOL)disassembleFromInputStream:(NSInputStream *)inputStream
partitionStrategy:(CKPartitionStrategy)partitionStrategy
password:(NSString *)password
chunkHandler:(CKChunkHandler)chunkHandler
error:(NSError *__nullable *)error;
- (BOOL)assembleToOutputStream:(NSOutputStream *)outputStream
password:(NSString *)password
chunkProvider:(CKChunkProvider)chunkProvider
error:(NSError *__nullable *)error;
@end
NS_ASSUME_NONNULL_END