#import <ZSM/ZSMClient.h>

NS_ASSUME_NONNULL_BEGIN

@interface FIDO2Client : ZSMClient


#pragma mark - Registration and initialization

- (instancetype)init NS_UNAVAILABLE;

#pragma mark - Encryption and signing

/**
 * Performs WebAuthn creation (attestation). Will use the currently configured user identifier (config.consumerId).
 * @param options JSON dictionary of WebAuthn creation options.
 * @param completion Callback to be invoked upon completion with result data or error.
 */
- (void)webauthnCreateWithOptions:(NSDictionary<NSString *, id> *)options completion:(ZSMJSONCompletion)completion
NS_SWIFT_NAME(webauthnCreate(options:completion:));

/**
 * Performs WebAuthn creation (attestation) with trace ID for end-to-end tracing.
 * @param traceId Optional trace ID for operation tracking.
 * @param options JSON dictionary of WebAuthn creation options.
 * @param completion Callback to be invoked upon completion with result data or error.
 */
- (void)webauthnCreateWithTraceId:(nullable NSString *)traceId options:(NSDictionary<NSString *, id> *)options completion:(ZSMJSONCompletion)completion
NS_SWIFT_NAME(webauthnCreate(traceId:options:completion:));

/**
 * Performs WebAuthn creation (attestation).
 * @param user user idenfifier this applies to
 * @param options JSON dictionary of WebAuthn creation options.
 * @param completion Callback to be invoked upon completion with result data or error.
 */
- (void)webauthnCreateForUser:(NSString *)user withOptions:(NSDictionary<NSString *, id> *)options completion:(ZSMJSONCompletion)completion
NS_SWIFT_NAME(webauthnCreate(user:options:completion:));

/**
 * Performs WebAuthn get (assertion).
 * @param options JSON dictionary of WebAuthn get options.
 * @param completion Callback to be invoked upon completion with result data or error.
 */
- (void)webauthnGetWithOptions:(NSDictionary<NSString *, id> *)options completion:(ZSMJSONCompletion)completion
NS_SWIFT_NAME(webauthnGet(options:completion:));

/**
 * Performs WebAuthn get (assertion). Will use the currently configured user identifier (config.consumerId).
 * @param user user idenfifier this applies to
 * @param options JSON dictionary of WebAuthn get options.
 * @param completion Callback to be invoked upon completion with result data or error.
 */
- (void)webauthnGetForUser:(NSString *)user withOptions:(NSDictionary<NSString *, id> *)options completion:(ZSMJSONCompletion)completion
NS_SWIFT_NAME(webauthnGet(user:options:completion:));

/**
 * Retrieves the attestation from create
 * @param completion Callback to be invoked upon completion with result data.
 */
- (void)webauthnRetrieveWithCompletion:(ZSMJSONCompletion)completion
NS_SWIFT_NAME(webauthnRetrieve(completion:));

/**
 * Retrieves the attestation from create with trace ID for end-to-end tracing.
 * @param traceId Optional trace ID for operation tracking.
 * @param completion Callback to be invoked upon completion with result data.
 */
- (void)webauthnRetrieveWithTraceId:(nullable NSString *)traceId completion:(ZSMJSONCompletion)completion
NS_SWIFT_NAME(webauthnRetrieve(traceId:completion:));

/**
 * Retrieves the attestation from create. Will use the currently configured user identifier (config.consumerId).
 * @param completion Callback to be invoked upon completion with result data.
 */
- (void)webauthnRetrieveForUser:(NSString *)user withCompletion:(ZSMJSONCompletion)completion
NS_SWIFT_NAME(webauthnRetrieve(user:completion:));

@end

NS_ASSUME_NONNULL_END

