]> git.saurik.com Git - apple/security.git/blob - OSX/sec/Security/SecRecoveryKey.h
Security-58286.260.20.tar.gz
[apple/security.git] / OSX / sec / Security / SecRecoveryKey.h
1 //
2 // SecRecoveryKey.h
3 //
4 //
5
6 #ifndef SecRecoveryKey_h
7 #define SecRecoveryKey_h
8
9 #include <Security/Security.h>
10
11 #if __OBJC__
12 @class SecRecoveryKey;
13 #else
14 typedef struct __SecRecoveryKey SecRecoveryKey;
15 #endif
16
17 bool
18 SecRKRegisterBackupPublicKey(SecRecoveryKey *rk, CFErrorRef *error);
19
20 #if __OBJC__
21
22 /*
23 * Constants for the verifier dictionary returned from SecRKCopyAccountRecoveryVerifier
24 */
25
26 extern NSString *const kSecRVSalt;
27 extern NSString *const kSecRVIterations;
28 extern NSString *const kSecRVProtocol;
29 extern NSString *const kSecRVVerifier;
30 extern NSString *const kSecRVMasterID;
31
32
33 SecRecoveryKey *
34 SecRKCreateRecoveryKey(NSString *recoveryKey);
35
36 SecRecoveryKey *
37 SecRKCreateRecoveryKeyWithError(NSString *masterKey, NSError **error);
38
39 NSString *
40 SecRKCreateRecoveryKeyString(NSError **error);
41
42 NSString *
43 SecRKCopyAccountRecoveryPassword(SecRecoveryKey *rk);
44
45 NSData *
46 SecRKCopyBackupFullKey(SecRecoveryKey *rk);
47
48 NSData *
49 SecRKCopyBackupPublicKey(SecRecoveryKey *rk);
50
51 NSDictionary *
52 SecRKCopyAccountRecoveryVerifier(NSString *recoveryKey,
53 NSError **error);
54
55 #else
56
57 SecRecoveryKey *
58 SecRKCreateRecoveryKey(CFStringRef recoveryKey);
59
60 CFDataRef
61 SecRKCopyBackupFullKey(SecRecoveryKey *rk);
62
63 CFDataRef
64 SecRKCopyBackupPublicKey(SecRecoveryKey *rk);
65
66 #endif
67
68 #endif