Skip to content

Commit

Permalink
Updated framework to 0.2.0 version
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaoj committed Dec 9, 2021
1 parent c491ce3 commit aa0428f
Show file tree
Hide file tree
Showing 19 changed files with 79 additions and 80 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ You need to implemented the SecureUnlockDelegate protocol.

```swift
extension MyClass: SecureUnlockDelegate {
func secureUnlockSuccess(online: Bool) {
func secureUnlockSuccess(online: Bool, duration: TimeInterval) {
// Callback when unlock succeeds.
// Online parameter indicates if it was an online or offline unlock.
// Duration parameter tells how long the unlock took
}

func secureUnlockFailure(error: SecureT2UError) {
// Login id callback.
// If you only support 1 login you can ignore the organization property and simply return the login id for the logged in user. Otherwise you must find the login id for the given organization.
func secureUnlockFailure(error: SecureT2UError, duration: TimeInterval) {
// Unlock failed
// Note that if because of needsDeviceOwnerVerification you should prompt user to unlock phone or setup passcode.
// Duration parameter tells how long the unlock took
}

func secureUnlockLoginIDForOrganization(_ organization: Int?) -> Int? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ SWIFT_CLASS("_TtC12SecureUnlock13BeaconManager")




@interface NSNotification (SWIFT_EXTENSION(SecureUnlock))
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) NSNotificationName _Nonnull BeaconManagerDidEnterRegionNotification;)
+ (NSNotificationName _Nonnull)BeaconManagerDidEnterRegionNotification SWIFT_WARN_UNUSED_RESULT;
Expand All @@ -250,10 +251,10 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) SecureUnlock
+ (SecureUnlockManager * _Nonnull)shared SWIFT_WARN_UNUSED_RESULT;
- (void)start;
- (void)stop;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end


@class CBPeripheralManager;
@class CBATTRequest;
@class CBService;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import _Concurrency
public enum SecureT2UError : Swift.Error {
case invalidTransition
case invalidData
case failedToGenerateRandomData
case failedToEncrypt
case failedToDecrypt
case scramFetchError
Expand All @@ -23,6 +22,7 @@ public enum SecureT2UError : Swift.Error {
case needsDeviceOwnerVerification
case unexpectedCommand
case missingDelegate
case offsetReadOutOfBounds
public static func == (a: SecureUnlock.SecureT2UError, b: SecureUnlock.SecureT2UError) -> Swift.Bool
public func hash(into hasher: inout Swift.Hasher)
public var hashValue: Swift.Int {
Expand Down Expand Up @@ -78,15 +78,14 @@ extension SecureUnlock.BeaconManager : CoreLocation.CLLocationManagerDelegate {
@objc final public func locationManager(_ manager: CoreLocation.CLLocationManager, didRangeBeacons beacons: [CoreLocation.CLBeacon], in region: CoreLocation.CLBeaconRegion)
@objc final public func locationManager(_ manager: CoreLocation.CLLocationManager, rangingBeaconsDidFailFor region: CoreLocation.CLBeaconRegion, withError error: Swift.Error)
}
@objc @_inheritsConvenienceInitializers final public class SecureUnlockManager : ObjectiveC.NSObject {
@objc @_hasMissingDesignatedInitializers final public class SecureUnlockManager : ObjectiveC.NSObject {
@objc public static let shared: SecureUnlock.SecureUnlockManager
weak final public var delegate: SecureUnlock.SecureUnlockDelegate? {
get
set
}
@objc final public func start()
@objc final public func stop()
@objc override dynamic public init()
@objc deinit
}
extension SecureUnlock.SecureUnlockManager : CoreBluetooth.CBPeripheralManagerDelegate {
Expand All @@ -98,8 +97,8 @@ extension SecureUnlock.SecureUnlockManager : CoreBluetooth.CBPeripheralManagerDe
@objc final public func peripheralManager(_ peripheral: CoreBluetooth.CBPeripheralManager, willRestoreState dict: [Swift.String : Any])
}
public protocol SecureUnlockDelegate : AnyObject {
func secureUnlockSuccess(online: Swift.Bool)
func secureUnlockFailure(error: SecureUnlock.SecureT2UError)
func secureUnlockSuccess(online: Swift.Bool, duration: Foundation.TimeInterval)
func secureUnlockFailure(error: SecureUnlock.SecureT2UError, duration: Foundation.TimeInterval)
func secureUnlockLoginIDForOrganization(_ organization: Swift.Int?) -> Swift.Int?
func secureUnlockPhoneKeyForLogin(_ login: Swift.Int) -> Swift.String?
func secureUnlockFetchCertificate(login: Swift.Int, reader: Swift.Int, online: Swift.Bool, completion: @escaping (Swift.Result<Swift.String, SecureUnlock.SecureT2UError>) -> Swift.Void)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import _Concurrency
public enum SecureT2UError : Swift.Error {
case invalidTransition
case invalidData
case failedToGenerateRandomData
case failedToEncrypt
case failedToDecrypt
case scramFetchError
Expand All @@ -23,6 +22,7 @@ public enum SecureT2UError : Swift.Error {
case needsDeviceOwnerVerification
case unexpectedCommand
case missingDelegate
case offsetReadOutOfBounds
public static func == (a: SecureUnlock.SecureT2UError, b: SecureUnlock.SecureT2UError) -> Swift.Bool
public func hash(into hasher: inout Swift.Hasher)
public var hashValue: Swift.Int {
Expand Down Expand Up @@ -78,15 +78,14 @@ extension SecureUnlock.BeaconManager : CoreLocation.CLLocationManagerDelegate {
@objc final public func locationManager(_ manager: CoreLocation.CLLocationManager, didRangeBeacons beacons: [CoreLocation.CLBeacon], in region: CoreLocation.CLBeaconRegion)
@objc final public func locationManager(_ manager: CoreLocation.CLLocationManager, rangingBeaconsDidFailFor region: CoreLocation.CLBeaconRegion, withError error: Swift.Error)
}
@objc @_inheritsConvenienceInitializers final public class SecureUnlockManager : ObjectiveC.NSObject {
@objc @_hasMissingDesignatedInitializers final public class SecureUnlockManager : ObjectiveC.NSObject {
@objc public static let shared: SecureUnlock.SecureUnlockManager
weak final public var delegate: SecureUnlock.SecureUnlockDelegate? {
get
set
}
@objc final public func start()
@objc final public func stop()
@objc override dynamic public init()
@objc deinit
}
extension SecureUnlock.SecureUnlockManager : CoreBluetooth.CBPeripheralManagerDelegate {
Expand All @@ -98,8 +97,8 @@ extension SecureUnlock.SecureUnlockManager : CoreBluetooth.CBPeripheralManagerDe
@objc final public func peripheralManager(_ peripheral: CoreBluetooth.CBPeripheralManager, willRestoreState dict: [Swift.String : Any])
}
public protocol SecureUnlockDelegate : AnyObject {
func secureUnlockSuccess(online: Swift.Bool)
func secureUnlockFailure(error: SecureUnlock.SecureT2UError)
func secureUnlockSuccess(online: Swift.Bool, duration: Foundation.TimeInterval)
func secureUnlockFailure(error: SecureUnlock.SecureT2UError, duration: Foundation.TimeInterval)
func secureUnlockLoginIDForOrganization(_ organization: Swift.Int?) -> Swift.Int?
func secureUnlockPhoneKeyForLogin(_ login: Swift.Int) -> Swift.String?
func secureUnlockFetchCertificate(login: Swift.Int, reader: Swift.Int, online: Swift.Bool, completion: @escaping (Swift.Result<Swift.String, SecureUnlock.SecureT2UError>) -> Swift.Void)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<dict>
<key>Headers/SecureUnlock-Swift.h</key>
<data>
qMG2cOmoiYlZfL33M/jli0gFAKY=
ttCRSzfA3fqrvrKZwOSpzNFLTc8=
</data>
<key>Headers/SecureUnlock.h</key>
<data>
Expand All @@ -18,27 +18,27 @@
</data>
<key>Modules/SecureUnlock.swiftmodule/arm64-apple-ios.swiftdoc</key>
<data>
y1a3EbmoptQFB5i31QwNVSID2J4=
ZU8axXF0hJaT3riFwlRCqF2RAwE=
</data>
<key>Modules/SecureUnlock.swiftmodule/arm64-apple-ios.swiftinterface</key>
<data>
/+1JxyV8T0vnI714hPNUwTodVYM=
J8unAW11pjMn55aK5qIb/9YQSrc=
</data>
<key>Modules/SecureUnlock.swiftmodule/arm64-apple-ios.swiftmodule</key>
<data>
nsA5aLrO7khmDpgixyxoL2RuQyI=
h9tH9CdzQlquQAU60NbpZn67Jkw=
</data>
<key>Modules/SecureUnlock.swiftmodule/arm64.swiftdoc</key>
<data>
y1a3EbmoptQFB5i31QwNVSID2J4=
ZU8axXF0hJaT3riFwlRCqF2RAwE=
</data>
<key>Modules/SecureUnlock.swiftmodule/arm64.swiftinterface</key>
<data>
/+1JxyV8T0vnI714hPNUwTodVYM=
J8unAW11pjMn55aK5qIb/9YQSrc=
</data>
<key>Modules/SecureUnlock.swiftmodule/arm64.swiftmodule</key>
<data>
nsA5aLrO7khmDpgixyxoL2RuQyI=
h9tH9CdzQlquQAU60NbpZn67Jkw=
</data>
<key>Modules/module.modulemap</key>
<data>
Expand All @@ -51,7 +51,7 @@
<dict>
<key>hash2</key>
<data>
VqxA+lCxrHbwP6G/36kOEqOxxerfKVzEe5fg8CaeBPI=
7iHTuqTd4i3ci7GfOyfK/JFPBmQQviehdCJt7eRGGAo=
</data>
</dict>
<key>Headers/SecureUnlock.h</key>
Expand All @@ -65,42 +65,42 @@
<dict>
<key>hash2</key>
<data>
97kYQlnHPH4iZwILJ5CQwc/rvkzsZqENVwL1bRGHvpU=
1qpisK/6iPvPceQ/hAhyitvpj2Xq0WkyQMbvVA+lu1o=
</data>
</dict>
<key>Modules/SecureUnlock.swiftmodule/arm64-apple-ios.swiftinterface</key>
<dict>
<key>hash2</key>
<data>
HsjRsLK0Qc9jtfWUZ2sLoybvj1f3GTN2w9N9uH3CiIs=
UesWgmYkcjCEn2zC3U3mkrIQk3CiApaSbPmP5DKkllw=
</data>
</dict>
<key>Modules/SecureUnlock.swiftmodule/arm64-apple-ios.swiftmodule</key>
<dict>
<key>hash2</key>
<data>
cIdbNLx4kqG/6DBC0jzYQnCC7ld4WI81Ct27K8v+bY4=
CPP3hCV+6m9uozO3uXD0V7BTWKm8cgmvUzlQHG/ZhGA=
</data>
</dict>
<key>Modules/SecureUnlock.swiftmodule/arm64.swiftdoc</key>
<dict>
<key>hash2</key>
<data>
97kYQlnHPH4iZwILJ5CQwc/rvkzsZqENVwL1bRGHvpU=
1qpisK/6iPvPceQ/hAhyitvpj2Xq0WkyQMbvVA+lu1o=
</data>
</dict>
<key>Modules/SecureUnlock.swiftmodule/arm64.swiftinterface</key>
<dict>
<key>hash2</key>
<data>
HsjRsLK0Qc9jtfWUZ2sLoybvj1f3GTN2w9N9uH3CiIs=
UesWgmYkcjCEn2zC3U3mkrIQk3CiApaSbPmP5DKkllw=
</data>
</dict>
<key>Modules/SecureUnlock.swiftmodule/arm64.swiftmodule</key>
<dict>
<key>hash2</key>
<data>
cIdbNLx4kqG/6DBC0jzYQnCC7ld4WI81Ct27K8v+bY4=
CPP3hCV+6m9uozO3uXD0V7BTWKm8cgmvUzlQHG/ZhGA=
</data>
</dict>
<key>Modules/module.modulemap</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ SWIFT_CLASS("_TtC12SecureUnlock13BeaconManager")




@interface NSNotification (SWIFT_EXTENSION(SecureUnlock))
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) NSNotificationName _Nonnull BeaconManagerDidEnterRegionNotification;)
+ (NSNotificationName _Nonnull)BeaconManagerDidEnterRegionNotification SWIFT_WARN_UNUSED_RESULT;
Expand All @@ -252,10 +253,10 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) SecureUnlock
+ (SecureUnlockManager * _Nonnull)shared SWIFT_WARN_UNUSED_RESULT;
- (void)start;
- (void)stop;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end


@class CBPeripheralManager;
@class CBATTRequest;
@class CBService;
Expand Down Expand Up @@ -515,6 +516,7 @@ SWIFT_CLASS("_TtC12SecureUnlock13BeaconManager")




@interface NSNotification (SWIFT_EXTENSION(SecureUnlock))
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) NSNotificationName _Nonnull BeaconManagerDidEnterRegionNotification;)
+ (NSNotificationName _Nonnull)BeaconManagerDidEnterRegionNotification SWIFT_WARN_UNUSED_RESULT;
Expand All @@ -529,10 +531,10 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) SecureUnlock
+ (SecureUnlockManager * _Nonnull)shared SWIFT_WARN_UNUSED_RESULT;
- (void)start;
- (void)stop;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end


@class CBPeripheralManager;
@class CBATTRequest;
@class CBService;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import _Concurrency
public enum SecureT2UError : Swift.Error {
case invalidTransition
case invalidData
case failedToGenerateRandomData
case failedToEncrypt
case failedToDecrypt
case scramFetchError
Expand All @@ -23,6 +22,7 @@ public enum SecureT2UError : Swift.Error {
case needsDeviceOwnerVerification
case unexpectedCommand
case missingDelegate
case offsetReadOutOfBounds
public static func == (a: SecureUnlock.SecureT2UError, b: SecureUnlock.SecureT2UError) -> Swift.Bool
public func hash(into hasher: inout Swift.Hasher)
public var hashValue: Swift.Int {
Expand Down Expand Up @@ -78,15 +78,14 @@ extension SecureUnlock.BeaconManager : CoreLocation.CLLocationManagerDelegate {
@objc final public func locationManager(_ manager: CoreLocation.CLLocationManager, didRangeBeacons beacons: [CoreLocation.CLBeacon], in region: CoreLocation.CLBeaconRegion)
@objc final public func locationManager(_ manager: CoreLocation.CLLocationManager, rangingBeaconsDidFailFor region: CoreLocation.CLBeaconRegion, withError error: Swift.Error)
}
@objc @_inheritsConvenienceInitializers final public class SecureUnlockManager : ObjectiveC.NSObject {
@objc @_hasMissingDesignatedInitializers final public class SecureUnlockManager : ObjectiveC.NSObject {
@objc public static let shared: SecureUnlock.SecureUnlockManager
weak final public var delegate: SecureUnlock.SecureUnlockDelegate? {
get
set
}
@objc final public func start()
@objc final public func stop()
@objc override dynamic public init()
@objc deinit
}
extension SecureUnlock.SecureUnlockManager : CoreBluetooth.CBPeripheralManagerDelegate {
Expand All @@ -98,8 +97,8 @@ extension SecureUnlock.SecureUnlockManager : CoreBluetooth.CBPeripheralManagerDe
@objc final public func peripheralManager(_ peripheral: CoreBluetooth.CBPeripheralManager, willRestoreState dict: [Swift.String : Any])
}
public protocol SecureUnlockDelegate : AnyObject {
func secureUnlockSuccess(online: Swift.Bool)
func secureUnlockFailure(error: SecureUnlock.SecureT2UError)
func secureUnlockSuccess(online: Swift.Bool, duration: Foundation.TimeInterval)
func secureUnlockFailure(error: SecureUnlock.SecureT2UError, duration: Foundation.TimeInterval)
func secureUnlockLoginIDForOrganization(_ organization: Swift.Int?) -> Swift.Int?
func secureUnlockPhoneKeyForLogin(_ login: Swift.Int) -> Swift.String?
func secureUnlockFetchCertificate(login: Swift.Int, reader: Swift.Int, online: Swift.Bool, completion: @escaping (Swift.Result<Swift.String, SecureUnlock.SecureT2UError>) -> Swift.Void)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import _Concurrency
public enum SecureT2UError : Swift.Error {
case invalidTransition
case invalidData
case failedToGenerateRandomData
case failedToEncrypt
case failedToDecrypt
case scramFetchError
Expand All @@ -23,6 +22,7 @@ public enum SecureT2UError : Swift.Error {
case needsDeviceOwnerVerification
case unexpectedCommand
case missingDelegate
case offsetReadOutOfBounds
public static func == (a: SecureUnlock.SecureT2UError, b: SecureUnlock.SecureT2UError) -> Swift.Bool
public func hash(into hasher: inout Swift.Hasher)
public var hashValue: Swift.Int {
Expand Down Expand Up @@ -78,15 +78,14 @@ extension SecureUnlock.BeaconManager : CoreLocation.CLLocationManagerDelegate {
@objc final public func locationManager(_ manager: CoreLocation.CLLocationManager, didRangeBeacons beacons: [CoreLocation.CLBeacon], in region: CoreLocation.CLBeaconRegion)
@objc final public func locationManager(_ manager: CoreLocation.CLLocationManager, rangingBeaconsDidFailFor region: CoreLocation.CLBeaconRegion, withError error: Swift.Error)
}
@objc @_inheritsConvenienceInitializers final public class SecureUnlockManager : ObjectiveC.NSObject {
@objc @_hasMissingDesignatedInitializers final public class SecureUnlockManager : ObjectiveC.NSObject {
@objc public static let shared: SecureUnlock.SecureUnlockManager
weak final public var delegate: SecureUnlock.SecureUnlockDelegate? {
get
set
}
@objc final public func start()
@objc final public func stop()
@objc override dynamic public init()
@objc deinit
}
extension SecureUnlock.SecureUnlockManager : CoreBluetooth.CBPeripheralManagerDelegate {
Expand All @@ -98,8 +97,8 @@ extension SecureUnlock.SecureUnlockManager : CoreBluetooth.CBPeripheralManagerDe
@objc final public func peripheralManager(_ peripheral: CoreBluetooth.CBPeripheralManager, willRestoreState dict: [Swift.String : Any])
}
public protocol SecureUnlockDelegate : AnyObject {
func secureUnlockSuccess(online: Swift.Bool)
func secureUnlockFailure(error: SecureUnlock.SecureT2UError)
func secureUnlockSuccess(online: Swift.Bool, duration: Foundation.TimeInterval)
func secureUnlockFailure(error: SecureUnlock.SecureT2UError, duration: Foundation.TimeInterval)
func secureUnlockLoginIDForOrganization(_ organization: Swift.Int?) -> Swift.Int?
func secureUnlockPhoneKeyForLogin(_ login: Swift.Int) -> Swift.String?
func secureUnlockFetchCertificate(login: Swift.Int, reader: Swift.Int, online: Swift.Bool, completion: @escaping (Swift.Result<Swift.String, SecureUnlock.SecureT2UError>) -> Swift.Void)
Expand Down
Binary file not shown.
Loading

0 comments on commit aa0428f

Please sign in to comment.