#if OCTAGON
#import "keychain/ckks/CKKS.h"
#import "keychain/ckks/CKKSSQLDatabaseObject.h"
#import "keychain/ckks/CKKSRecordHolder.h"
#include <utilities/SecDb.h>
#include <securityd/SecDbItem.h>
#ifndef CKKSItem_h
#define CKKSItem_h
#import <CloudKit/CloudKit.h>
@class CKKSWrappedAESSIVKey;
@interface CKKSItem : CKKSCKRecordHolder {
}
@property (copy) NSString* uuid;
@property (copy) NSString* parentKeyUUID;
@property (copy) NSData* encitem;
@property (getter=base64Item, setter=setBase64Item:) NSString* base64encitem;
@property (copy) CKKSWrappedAESSIVKey* wrappedkey;
@property NSUInteger generationCount;
@property enum SecCKKSItemEncryptionVersion encver;
@property NSNumber* plaintextPCSServiceIdentifier;
@property NSData* plaintextPCSPublicKey;
@property NSData* plaintextPCSPublicIdentity;
- (NSDictionary<NSString*, NSData*>*)makeAuthenticatedDataDictionaryUpdatingCKKSItem:(CKKSItem*) olditem encryptionVersion:(SecCKKSItemEncryptionVersion)encversion;
- (instancetype) initWithCKRecord: (CKRecord*) record;
- (instancetype) initCopyingCKKSItem: (CKKSItem*) item;
- (instancetype) initWithUUID: (NSString*) uuid
parentKeyUUID: (NSString*) parentKeyUUID
zoneID: (CKRecordZoneID*) zoneID;
- (instancetype) initWithUUID: (NSString*) uuid
parentKeyUUID: (NSString*) parentKeyUUID
zoneID: (CKRecordZoneID*) zoneID
encItem: (NSData*) encitem
wrappedkey: (CKKSWrappedAESSIVKey*) wrappedkey
generationCount: (NSUInteger) genCount
encver: (NSUInteger) encver;
- (instancetype) initWithUUID: (NSString*) uuid
parentKeyUUID: (NSString*) parentKeyUUID
zoneID: (CKRecordZoneID*)zoneID
encodedCKRecord: (NSData*) encodedrecord
encItem: (NSData*) encitem
wrappedkey: (CKKSWrappedAESSIVKey*) wrappedkey
generationCount: (NSUInteger) genCount
encver: (NSUInteger) encver;
- (instancetype) initWithUUID: (NSString*) uuid
parentKeyUUID: (NSString*) parentKeyUUID
zoneID: (CKRecordZoneID*)zoneID
encodedCKRecord: (NSData*) encodedrecord
encItem: (NSData*) encitem
wrappedkey: (CKKSWrappedAESSIVKey*) wrappedkey
generationCount: (NSUInteger) genCount
encver: (NSUInteger) encver
plaintextPCSServiceIdentifier: (NSNumber*) pcsServiceIdentifier
plaintextPCSPublicKey: (NSData*) pcsPublicKey
plaintextPCSPublicIdentity: (NSData*) pcsPublicIdentity;
+ (void)setOSVersionInRecord: (CKRecord*) record;
@end
@interface CKKSSQLDatabaseObject (CKKSZoneExtras)
+ (NSArray<NSString*>*) allUUIDs: (NSError * __autoreleasing *) error;
+ (NSArray*) all:(CKRecordZoneID*) zoneID error: (NSError * __autoreleasing *) error;
+ (bool) deleteAll:(CKRecordZoneID*) zoneID error: (NSError * __autoreleasing *) error;
@end
#endif
#endif