FRAIdentityDatabaseSQLiteOperations.m revision 0fc1bec9becddcbec0d26541dd7ef40b43c0a67b
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2016 ForgeRock AS.
*/
#import "FMDatabase.h"
#import "FRAError.h"
#import "FRAFMDatabaseConnectionHelper.h"
#import "FRAHotpOathMechanism.h"
#import "FRAIdentity.h"
#import "FRAIdentityDatabaseSQLiteOperations.h"
#import "FRAMechanism.h"
#import "FRANotification.h"
#import "FRAOathCode.h"
#import "FRAPushMechanism.h"
#import "FRASerialization.h"
#import "FRATotpOathMechanism.h"
}
if (self) {
}
return self;
}
- (BOOL)performStatement:(NSString *)schema withValues:(NSArray *)values error:(NSError * __autoreleasing *)error {
// Get schema
return NO;
}
// Open Database
@try {
return NO;
}
// Perform update
return result;
}
@finally {
}
}
// Issuer
// Account Name
// Image URL
} else {
}
// Background Color
if (identity.backgroundColor) {
} else {
}
}
// Issuer
// Account Name
}
// idIssuer
// idAccountName
// mechanismUID - Special case for PushMechanism
if ([mechanism isKindOfClass:[FRAHotpOathMechanism class]] || [mechanism isKindOfClass:[FRATotpOathMechanism class]]) {
} else {
}
// Mechanism Type
// Version
// Options
// Secret Key
// Algorithm
// Code Length
NSString *digitsString = [[NSNumber numberWithUnsignedInteger:hotpOathMechanism.codeLength] stringValue];
// Counter
NSString *counterString = [[NSNumber numberWithUnsignedLongLong:hotpOathMechanism.counter] stringValue];
// Secret Key
// Algorithm
// Code Length
NSString *digitsString = [[NSNumber numberWithUnsignedInteger:totpOathMechanism.codeLength] stringValue];
// Period
NSString *periodString = [[NSNumber numberWithUnsignedInteger:totpOathMechanism.period] stringValue];
// Secret Key as String
[options setObject:[FRASerialization nonNilString:pushMechanism.secret] forKey:PUSH_MECHANISM_SECRET];
// Auth Endpoint as String
[options setObject:[FRASerialization nonNilString:pushMechanism.authEndpoint] forKey:PUSH_MECHANISM_AUTH_END_POINT];
// Version integer as String
} else {
}
// Convert options to JSON
return NO;
}
}
// Issuer
// Account Name
// Mechanism Type
}
}
- (BOOL)insertNotification:(FRANotification *)notification error:(NSError *__autoreleasing *)error {
// mechanismUID
if ([parent isKindOfClass:[FRAHotpOathMechanism class]] || [parent isKindOfClass:[FRATotpOathMechanism class]]) {
mechanismUID = nil;
} else {
@throw [[NSException alloc] initWithName:@"Illegal State" reason:@"Unrecognised class of Mechanism" userInfo:nil];
}
// timeReceived
// timeExpired
// Data Json Map
// Data: Message ID
// Data: Push Challenge
// Data: Time to Live
// Data: Load Balancer cookie
// Convert map to JSON
return NO;
}
// pending
// approved
}
- (BOOL)deleteNotification:(FRANotification *)notification error:(NSError *__autoreleasing *)error {
// mechanismUID
if ([parent isKindOfClass:[FRAHotpOathMechanism class]] || [parent isKindOfClass:[FRATotpOathMechanism class]]) {
mechanismUID = nil;
} else {
@throw [[NSException alloc] initWithName:@"Illegal State" reason:@"Unrecognised class of Mechanism" userInfo:nil];
}
// timeReceived
}
- (BOOL)updateNotification:(FRANotification *)notification error:(NSError *__autoreleasing *)error {
}
@end