]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cryptkit/lib/NSFEEPublicKey.h
Security-58286.31.2.tar.gz
[apple/security.git] / OSX / libsecurity_cryptkit / lib / NSFEEPublicKey.h
1 /* Copyright (c) 1998,2011,2014 Apple Inc. All Rights Reserved.
2 *
3 * NOTICE: USE OF THE MATERIALS ACCOMPANYING THIS NOTICE IS SUBJECT
4 * TO THE TERMS OF THE SIGNED "FAST ELLIPTIC ENCRYPTION (FEE) REFERENCE
5 * SOURCE CODE EVALUATION AGREEMENT" BETWEEN APPLE, INC. AND THE
6 * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE,
7 * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL
8 * EXPOSE YOU TO LIABILITY.
9 ***************************************************************************
10 *
11 * NSFEEPublicKey.h
12 *
13 * Revision History
14 * ----------------
15 * 27 Feb 1997 at Apple
16 * Broke out from NSCryptors.h.
17 */
18
19 #import <CryptKit/NSCryptors.h>
20
21 @interface NSFEEPublicKey : NSObject
22 <NSPublicKey,NSDigitalSignature,NSCryptor> {
23 @private
24 void *_pubKey;
25 }
26
27 + keyWithPrivateData:(NSData *)private
28 depth:(unsigned)depth // depth is in range 0-23
29 usageName:(NSString *)uname;
30 // able to encrypt/decrypt data
31 // able to create/verify digital signatures
32
33 + keyWithPublicKeyString:(NSString *)hexstr;
34 // able to encrypt data
35 // able to verify digital signatures
36
37 /*
38 * Create new key with curve parameters matching existing oldKey.
39 */
40 + keyWithPrivateData:(NSData *)passwd
41 andKey:(NSFEEPublicKey *)oldKey
42 usageName:(NSString *)uname;
43
44 /*
45 * Convenience methods. The first three use the default depth
46 * (FEE_DEPTH_DEFAULT).
47 */
48 + keyWithPrivateData:(NSData *)passwd
49 usageName:(NSString *)uname;
50 + keyWithPrivateString:(NSString *)private
51 usageName:(NSString *)uname;
52 + keyWithPrivateString:(NSString *)private
53 andKey:(NSFEEPublicKey *)oldKey
54 usageName:(NSString *)uname;
55
56 + keyWithPrivateString:(NSString *)private
57 depth:(unsigned)depth
58 usageName:(NSString *)uname;
59
60 /*
61 * NSCryptor protocol
62 */
63 - (NSData *)encryptData:(NSData *)data; // done with public knowledge
64 - (NSData *)decryptData:(NSData *)data; // done with private knowledge
65
66 /*
67 * NSDigitalSignature protocol
68 */
69 - (NSData *)digitalSignatureForData:(NSData *)data;
70 // data is hashed with MD5 and then signed with private knowledge
71 - (BOOL)isValidDigitalSignature:(NSData *)sig forData:(NSData *)data;
72 // data is hashed with MD5 and then verified with public knowledge
73
74 @end