#ifndef SOSCIRCLE_PIGGIGGYBACK_H
#define SOSCIRCLE_PIGGIGGYBACK_H 1
#include <CoreFoundation/CoreFoundation.h>
#include <Security/Security.h>
#include "keychain/SecureObjectSync/SOSCircle.h"
__BEGIN_DECLS
bool SOSPiggyBackBlobCreateFromData(SOSGenCountRef *gencount, SecKeyRef *pubKey, CFDataRef *signature,
CFDataRef blobData, PiggyBackProtocolVersion version, bool *setInitialSyncTimeoutToV0, CFErrorRef *error);
bool SOSPiggyBackBlobCreateFromDER(SOSGenCountRef *retGencount, SecKeyRef *retPubKey, CFDataRef *retSignature,
const uint8_t** der_p, const uint8_t *der_end, PiggyBackProtocolVersion version, bool *setInitialSyncTimeoutToV0, CFErrorRef *error);
CFDataRef SOSPiggyBackBlobCopyEncodedData(SOSGenCountRef gencount, SecKeyRef pubKey, CFDataRef signature, CFErrorRef *error);
#if __OBJC__
bool SOSPiggyBackAddToKeychain(NSArray<NSData*>* identity, NSArray<NSDictionary*>* tlk);
NSDictionary * SOSPiggyCopyInitialSyncData(const uint8_t** der, const uint8_t *der_end);
#endif
__END_DECLS
#endif