2
0
MasterPassword/MasterPassword/MPElementGeneratedEntity.m
Maarten Billemont 02ffa9611a Prepare key handling logic for sharing with OS X.
[MOVED]     Key logic now in a common class extension on MPAppDelegate
            so it can be shared between iOS and OS X apps.
[MOVED]     MPConfig for sharing between iOS and OS X apps.
[CHANGED]   keyphrase -> key.
2012-03-05 22:19:05 +01:00

32 lines
772 B
Objective-C

//
// MPElementGeneratedEntity.m
// MasterPassword
//
// Created by Maarten Billemont on 16/01/12.
// Copyright (c) 2012 Lyndir. All rights reserved.
//
#import "MPElementGeneratedEntity.h"
#import "MPAppDelegate_Key.h"
@implementation MPElementGeneratedEntity
@dynamic counter;
- (id)content {
assert(self.type & MPElementTypeClassCalculated);
if (![self.name length])
return nil;
if (self.type & MPElementTypeClassCalculated)
return MPCalculateContent(self.type, self.name, [MPAppDelegate get].key, self.counter);
@throw [NSException exceptionWithName:NSInternalInconsistencyException
reason:[NSString stringWithFormat:@"Unsupported type: %d", self.type] userInfo:nil];
}
@end