Skip to content

DeviceCheck watchOS xcode14.0 beta1

Manuel de la Pena edited this page Aug 5, 2022 · 3 revisions

#DeviceCheck.framework https://github.com/xamarin/xamarin-macios/pull/15639

diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DCAppAttestService.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DCAppAttestService.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DCAppAttestService.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DCAppAttestService.h	2022-05-31 15:03:22.000000000 -0400
@@ -0,0 +1,64 @@
+//
+//  DCAppAttestService.h
+//  DeviceCheck
+//
+//  Copyright © 2020 Apple Inc. All rights reserved.
+//
+
+
+#import <DeviceCheck/DeviceCheck.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+DC_EXPORT
+API_AVAILABLE(macos(11.0), ios(14.0), tvos(15.0), watchos(9.0))
+@interface DCAppAttestService : NSObject
+
+/**
+ * The shared service instance
+ */
+@property (class, readonly) DCAppAttestService *sharedService;
+
+/**
+ * Check if this API is supported on the current device for this application instance
+ */
+@property (getter=isSupported, readonly) BOOL supported;
+
+/**
+ * Generate a new unattested key.  This call generates a new
+ * key every time.  the key identifier keyId is returned.
+ *
+ * @param completionHandler
+ *        The key identifier (KeyId) for the newly generated unattested key upon success, or an error
+ */
+- (void)generateKeyWithCompletionHandler:(void (^)(NSString * _Nullable keyId, NSError * _Nullable error))completionHandler;
+
+/**
+ * Attest the key by keyId.  The same key may be attested more than once, provided that the key has
+ * not been used for generating assertions.
+ *
+ * @param keyId
+ *        The key identifier to be attested
+ * @param clientDataHash
+ *        An arbitrary byte (up to 32 bytes) to be supplied by caller.  It will be used to compute a nonce to be embedded into the certificate that certifies the key.
+ * @param completionHandler
+ *        The completion callback, returning the attestationObject upon success, or an error
+ */
+- (void)attestKey:(NSString *)keyId clientDataHash:(NSData *)clientDataHash completionHandler:(void (^)(NSData * _Nullable attestationObject, NSError * _Nullable error))completionHandler;
+
+/**
+ * Attest the key by keyId.  The same key may be attested more than once, provided that the key has
+ * not been used for generating assertions.
+ *
+ * @param keyId
+ *        The key identifier to the key to generate assertions with
+ * @param clientDataHash
+ *        An arbitrary byte (up to 32 bytes) to be supplied by caller.  It will be used to compute a nonce to be embedded into the certificate that certifies the key.
+ * @param completionHandler
+ *        The completion callback, returning the assertionObject upon success, or an error
+ */
+- (void)generateAssertion:(NSString *)keyId clientDataHash:(NSData *)clientDataHash completionHandler:(void (^)(NSData * _Nullable assertionObject, NSError * _Nullable error))completionHandler;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DCDevice.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DCDevice.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DCDevice.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DCDevice.h	2022-05-31 15:03:22.000000000 -0400
@@ -0,0 +1,34 @@
+//
+//  DCDevice.h
+//  DeviceCheck
+//
+//  Copyright © 2017 Apple Inc. All rights reserved.
+//
+
+#import <DeviceCheck/DeviceCheck.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+DC_EXPORT
+API_AVAILABLE(ios(11.0), macos(10.15), tvos(11.0), watchos(9.0))
+@interface DCDevice : NSObject
+
+/**
+ The current device. 
+ */
+@property (class, readonly) DCDevice *currentDevice;
+
+/**
+ Check if this API is supported on the current device.
+ */
+@property (getter=isSupported, readonly) BOOL supported;
+
+/**
+ Generate a new device token that can be used to get/set the persistent bits for this device.
+ This call generates a new value every time.
+ */
+- (void)generateTokenWithCompletionHandler:(void(^)(NSData * _Nullable token, NSError * _Nullable error))completion;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DCError.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DCError.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DCError.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DCError.h	2022-05-31 15:03:22.000000000 -0400
@@ -0,0 +1,23 @@
+//
+//  DCError.h
+//  DeviceCheck
+//
+//  Copyright © 2017 Apple Inc. All rights reserved.
+//
+
+#import <DeviceCheck/DeviceCheck.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+extern NSErrorDomain const DCErrorDomain API_AVAILABLE(ios(11.0), macos(10.15), tvos(11.0), watchos(9.0));
+
+typedef NS_ERROR_ENUM(DCErrorDomain, DCError) {
+    DCErrorUnknownSystemFailure,
+    DCErrorFeatureUnsupported,
+    DCErrorInvalidInput,
+    DCErrorInvalidKey,
+    DCErrorServerUnavailable,
+} API_AVAILABLE(ios(11.0), macos(10.15), tvos(11.0), watchos(9.0));
+
+NS_ASSUME_NONNULL_END
+
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DeviceCheck.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DeviceCheck.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DeviceCheck.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/DeviceCheck.framework/Headers/DeviceCheck.h	2022-05-21 05:17:26.000000000 -0400
@@ -0,0 +1,13 @@
+//
+//  DeviceCheck.h
+//  DeviceCheck
+//
+//  Copyright © 2017 Apple Inc. All rights reserved.
+//
+
+#define DC_EXPORT __attribute__((visibility("default")))
+
+#import <Foundation/Foundation.h>
+#import <DeviceCheck/DCDevice.h>
+#import <DeviceCheck/DCAppAttestService.h>
+#import <DeviceCheck/DCError.h>
Clone this wiki locally