X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/80e2389990082500d76eb566d4946be3e786c3ef..d8f41ccd20de16f8ebe2ccc84d47bf1cb2b26bbb:/Security/libsecurity_cryptkit/lib/NSFEEPublicKey.h diff --git a/Security/libsecurity_cryptkit/lib/NSFEEPublicKey.h b/Security/libsecurity_cryptkit/lib/NSFEEPublicKey.h new file mode 100644 index 00000000..42377a28 --- /dev/null +++ b/Security/libsecurity_cryptkit/lib/NSFEEPublicKey.h @@ -0,0 +1,74 @@ +/* Copyright (c) 1998,2011,2014 Apple Inc. All Rights Reserved. + * + * NOTICE: USE OF THE MATERIALS ACCOMPANYING THIS NOTICE IS SUBJECT + * TO THE TERMS OF THE SIGNED "FAST ELLIPTIC ENCRYPTION (FEE) REFERENCE + * SOURCE CODE EVALUATION AGREEMENT" BETWEEN APPLE, INC. AND THE + * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE, + * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL + * EXPOSE YOU TO LIABILITY. + *************************************************************************** + * + * NSFEEPublicKey.h + * + * Revision History + * ---------------- + * 27 Feb 1997 at Apple + * Broke out from NSCryptors.h. + */ + +#import + +@interface NSFEEPublicKey : NSObject + { +@private + void *_pubKey; +} + ++ keyWithPrivateData:(NSData *)private + depth:(unsigned)depth // depth is in range 0-23 + usageName:(NSString *)uname; + // able to encrypt/decrypt data + // able to create/verify digital signatures + ++ keyWithPublicKeyString:(NSString *)hexstr; + // able to encrypt data + // able to verify digital signatures + +/* + * Create new key with curve parameters matching existing oldKey. + */ ++ keyWithPrivateData:(NSData *)passwd + andKey:(NSFEEPublicKey *)oldKey + usageName:(NSString *)uname; + +/* + * Convenience methods. The first three use the default depth + * (FEE_DEPTH_DEFAULT). + */ ++ keyWithPrivateData:(NSData *)passwd + usageName:(NSString *)uname; ++ keyWithPrivateString:(NSString *)private + usageName:(NSString *)uname; ++ keyWithPrivateString:(NSString *)private + andKey:(NSFEEPublicKey *)oldKey + usageName:(NSString *)uname; + ++ keyWithPrivateString:(NSString *)private + depth:(unsigned)depth + usageName:(NSString *)uname; + +/* + * NSCryptor protocol + */ +- (NSData *)encryptData:(NSData *)data; // done with public knowledge +- (NSData *)decryptData:(NSData *)data; // done with private knowledge + +/* + * NSDigitalSignature protocol + */ +- (NSData *)digitalSignatureForData:(NSData *)data; + // data is hashed with MD5 and then signed with private knowledge +- (BOOL)isValidDigitalSignature:(NSData *)sig forData:(NSData *)data; + // data is hashed with MD5 and then verified with public knowledge + +@end