implemented crypto and started pairing
This commit is contained in:
1 parent
bd91d74de8
commit
9226a05ad8
6 files changed
+142
-2
No files matched your search
@@ -8,7 +8,7 @@
|
||||
|
||||
#import "CryptoManager.h"
|
||||
#import "mkcert.h"
|
||||
|
||||
#import <AdSupport/ASIdentifierManager.h>
|
||||
|
||||
@implementation CryptoManager
|
||||
|
||||
@@ -31,4 +31,18 @@
|
||||
freeCertKeyPair(certKeyPair);
|
||||
}
|
||||
|
||||
- (NSString*) getUniqueID {
|
||||
// generate a UUID
|
||||
NSUUID* uuid = [ASIdentifierManager sharedManager].advertisingIdentifier;
|
||||
NSString* idString = [NSString stringWithString:[uuid UUIDString]];
|
||||
|
||||
// we need a 16byte hex-string so we take the last 17 characters
|
||||
// and remove the '-' to get a 16 character string
|
||||
NSMutableString* uniqueId = [NSMutableString stringWithString:[idString substringFromIndex:19]];
|
||||
[uniqueId deleteCharactersInRange:NSMakeRange(4, 1)];
|
||||
|
||||
//NSLog(@"Unique ID: %@", uniqueId);
|
||||
return [NSString stringWithString:uniqueId];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user