Files
ManagerDemo/Pods/DTFoundation/Core/Source/NSData+DTCrypto.h
T
2014-08-08 13:27:54 +08:00

40 lines
957 B
Objective-C

//
// NSData+DTCrypto.h
// DTFoundation
//
// Created by Stefan Gugarel on 10/3/12.
// Copyright (c) 2012 Cocoanetics. All rights reserved.
//
/**
Useful cryptography methods.
*/
@interface NSData (DTCrypto)
/**-------------------------------------------------------------------------------------
@name Generating HMAC Hashes
---------------------------------------------------------------------------------------
*/
/**
Generates a HMAC from the receiver using the SHA1 algorithm
@param key The encryption key
@returns The encrypted hash
*/
- (NSData *)encryptedDataUsingSHA1WithKey:(NSData *)key;
/**-------------------------------------------------------------------------------------
@name Digest Hashes
---------------------------------------------------------------------------------------
*/
/**
Generate an md5 checksum from the receiver
@returns An `NSData` containing the md5 digest.
*/
-(NSData *)dataWithMD5Hash;
@end