Skip to content

Commit 2806a3b

Browse files
authored
Update documentation and version for release (#38)
* update documentation for release * update podspec * fix typos in documentation
1 parent 24c359c commit 2806a3b

File tree

7 files changed

+107
-14
lines changed

7 files changed

+107
-14
lines changed

Changelog.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
# YubiKit Changelog
22

3+
#### 3.1.0 (3.0.0 -> 3.1.0)
4+
5+
- Raw commands service `YKFKeyRawCommandService` now allows to specify timeouts on each command using `YKFKeyCommandConfiguration` in case if user wants to speed up communication with YubiKey or getting timeouts on execution of specific command.
6+
7+
- Reduced default timeout between sending command to YubiKey and receiving response from YubiKey in order to be more performant over Lightning.
8+
9+
- This SDK version now provides `YKFKeyChallengeResponseService` which allows to calculate HMAC-SHA1 on pre-programmed YubiKey. Read more about usage of [Challenge-response](./docs/chr.md)
10+
11+
- Added `YKFKeyMGMTService` which allows to check whether application is available on YubiKey. And can enable or disable interfaces/application on YubiKey (if they are available). Read more about usage of [management service](./docs/mgmt.md)
12+
13+
- Fixes OATH credential parser for credentials that contain "\" or ":".
14+
15+
- Added `YKFKeyOATHService` method `selectOATHApplication` that provides response on selection of OATH applet. It contains firmware version which can be used as one of the methods to detect firmware version over NFC.
16+
17+
- Improvements in YubiKitDemo application: U2F and FIDO2 in Other demo section now support NFC-Enabled YubiKeys.
18+
---
19+
320
#### 3.0.0 (3.0.0-Preview2 -> 3.0.0)
421

5-
- Improvements to NFC API: ability to cusomize NFC alert message at any point of time it's visible, an error in case if NFC session was closed without successful invalidation (including cancellation), allows to handle multiple tags during one open nfc session and do not close session if key was removed from NFC reader.
22+
- Improvements to NFC API: ability to customize NFC alert message at any point of time it's visible, an error in case if NFC session was closed without successful invalidation (including cancellation), allows to handle multiple tags during one open nfc session and do not close session if key was removed from NFC reader.
23+
624
- Added ability for application to subscribe for logger events and customize/create it's own logger (e.g. sent logs to the file)
25+
---
726

827
#### 3.0.0-Preview2 [3.0.0-Preview1 -> 3.0.0-Preview2]
928

1029
- Adds support for OATH protocol over NFC on devices running iOS 13 or newer. Also wraps and simplifies raw APDU communication with NFC-Enabled YubiKeys.
30+
---
1131

1232
#### 3.0.0-Preview1 [2.0.1 -> 3.0.0-Preview1]
1333

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Add YubiKit to your [Podfile](https://guides.cocoapods.org/using/the-podfile.htm
3434
```ruby
3535
use_frameworks!
3636

37-
pod 'YubiKit', '~> 3.0.0'
37+
pod 'YubiKit', '~> 3.1.0'
3838

3939
```
4040
If you want to have latest changes, replace the last line with:
@@ -45,13 +45,16 @@ pod 'YubiKit', :git => 'https://github.com/Yubico/yubikit-ios.git'
4545

4646
```
4747

48-
Once YubiKit is added to your `Podfile`, run `pod install` and open the `*.xcworkspace` with Xcode.
48+
Once YubiKit is added to your `Podfile`, run `pod install` and open the `*.xcworkspace` with Xcode.
4949

50-
Continue SDK setup by skipping over `Manual Setup` to `Enable Custom Lightning Protocol`.
50+
Then import the YubiKit module and you can use it's classes and methods.
51+
```
52+
import YubiKit
53+
```
5154

52-
---
55+
Continue SDK setup by skipping over `Manual Setup` to `Enable Custom Lightning Protocol`.
5356

54-
**[Manual Setup]**
57+
<details><summary><strong>Manual Setup</strong></summary><p>
5558

5659
Download or Clone YubiKit SDK source
5760
1. [Download](https://github.com/Yubico/yubikit-ios/releases/) the latest YubiKit SDK (.zip) to your desktop `or`
@@ -81,7 +84,8 @@ Click + and add the ``libYubiKit.a``
8184

8285
6. If your target project is written in Swift, you need to provide a bridge to the YubiKit library by adding ``#import <YubiKit/YubiKit.h>`` to your bridging header. If a bridging header does not exist within your project, you can add one by following this [documentation](https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html).
8386

84-
<details><summary><strong>Additional instructions</strong></summary><p>
87+
</details>
88+
8589
---
8690

8791
**Enable Custom Lightning Protocol**
@@ -142,10 +146,9 @@ Open info.plist and add the following usage:
142146
'Privacy - Camera Usage Description' - "This application needs access to Camera for reading QR codes."
143147

144148
</p>
145-
</details>
146149

147150
## Documentation
148-
YubiKit headers are documented and the documentation is available either by reading the header file or by using the QuickHelp from Xcode (Option + Click symbol). Use this documentation for a more detailed explanation of all the methods, properties, and parameters from the API. If you are interested in implementation details for a specific category like U2F, FIDO2, or OATH, checkout the [./docs](./docs/) section.
151+
YubiKit headers are documented and the documentation is available either by reading the header file or by using the QuickHelp from Xcode (Option + Click symbol). Use this documentation for a more detailed explanation of all the methods, properties, and parameters from the API. If you are interested in implementation details for a specific category like U2F, FIDO2, or OATH, check out the [./docs](./docs/) section.
149152

150153
## Using the Library
151154

@@ -200,6 +203,8 @@ List of services is documented below with it's own specifics and samples:
200203

201204
- [Challenge-response](./docs/chr.md) - Provides a method to use HMAC-SHA1 challenge-response.
202205

206+
- [MGMT](./docs/mgmt.md) - Provides ability to enable or disable available application on YubiKey
207+
203208

204209
## Customize the Library
205210
YubiKit allows customizing some of its behavior by using `YubiKitConfiguration` and `YubiKitExternalLocalization`.

YubiKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'YubiKit'
3-
s.version = '3.0.0'
3+
s.version = '3.1.0'
44
s.license = 'Apache 2.0'
55
s.summary = 'YubiKit is an iOS library provided by Yubico to interact with YubiKeys on iOS devices.'
66
s.homepage = 'https://github.com/Yubico/yubikit-ios'

YubiKit/YubiKit.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
811F91F023848D5E002158ED /* YKFKeyOATHCalculateAllRequest.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 95A4566F21777D0E00AD5A94 /* YKFKeyOATHCalculateAllRequest.h */; };
1111
81311F3A23AAFA4A00765522 /* YKFKeyChallengeResponseService.m in Sources */ = {isa = PBXBuildFile; fileRef = 81311F3923AAFA4A00765522 /* YKFKeyChallengeResponseService.m */; };
1212
813271EC240F265B0084E105 /* YKFKeyMGMTService.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 814813E923EA381F0003893B /* YKFKeyMGMTService.h */; };
13+
813FF86E241C6E4D00F5CD1E /* YKFKeyCommandConfiguration.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 951446A221874CC2002BB3C5 /* YKFKeyCommandConfiguration.h */; };
1314
814813CF23EA37F60003893B /* YKFMGMTReadAPDU.m in Sources */ = {isa = PBXBuildFile; fileRef = 814813C923EA37F60003893B /* YKFMGMTReadAPDU.m */; };
1415
814813D023EA37F60003893B /* YKFSelectMGMTApplicationAPDU.m in Sources */ = {isa = PBXBuildFile; fileRef = 814813CA23EA37F60003893B /* YKFSelectMGMTApplicationAPDU.m */; };
1516
814813D123EA37F60003893B /* YKFMGMTWriteAPDU.m in Sources */ = {isa = PBXBuildFile; fileRef = 814813CD23EA37F60003893B /* YKFMGMTWriteAPDU.m */; };
@@ -264,6 +265,7 @@
264265
dstPath = "include/$(PRODUCT_NAME)";
265266
dstSubfolderSpec = 16;
266267
files = (
268+
813FF86E241C6E4D00F5CD1E /* YKFKeyCommandConfiguration.h in CopyFiles */,
267269
813271EC240F265B0084E105 /* YKFKeyMGMTService.h in CopyFiles */,
268270
81FD3B99240488F6004C4FE9 /* YKFKeyVersion.h in CopyFiles */,
269271
81F94D9123F4DF4400475A70 /* YKFMGMTInterfaceConfiguration.h in CopyFiles */,

YubiKitDemo/YubiKitDemo/UI/About/AboutViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class AboutViewController: UIViewController {
2828

2929
let appBundle = Bundle(for: AboutViewController.self)
3030

31-
let libraryVersion = "3.0.0"
31+
let libraryVersion = "3.1.0"
3232
let appVersion = appBundle.object(forInfoDictionaryKey: "CFBundleShortVersionString")!
3333

3434
frameworkVersionLabel.text = "Library version: \(libraryVersion)"

docs/chr.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
## Using the HMAC-SHA1 challenge response Service
22

3-
This service usage is different from other service because it's not coming as part of list of serviced provided by YubiKitManager singleton, but it's using `YKFKeyRawCommandService` in implementation to communicate with YubiKey. How to implement such service yourself using `YKFKeyRawCommandService` read [here](../docs/raw.md)
3+
This service usage is not coming as part of list of serviced provided by YubiKitManager singleton, but it's using `YKFKeyRawCommandService` in implementation to communicate with YubiKey. How to implement such services yourself using `YKFKeyRawCommandService` read [here](../docs/raw.md)
44

5-
The `YKFKeyChallengeResponseService` provides a simple API for sending synchronous request that exchanges chellenge for response from YubiKey.
5+
The `YKFKeyChallengeResponseService` provides a simple API for sending asynchronous request that exchanges challenge for response from YubiKey.
66

7-
This method also requires to provide a slot on YubiKey (1 or 2). By default all YubiKeys are programmed to have OTP secret on 1st slot (which requires short touch of YubiKey), but it can be swapped/programmed to use 2nd slot (requires long touch). One slot can be used to keep OTP secret or challenge-respose secret and it's up to user which slot he would prefer to program for one feature or another.
7+
This method also requires to provide a slot on YubiKey (1 or 2). By default all YubiKeys are programmed to have OTP secret on 1st slot (which requires short touch of YubiKey), but it can be swapped/programmed to use 2nd slot (requires long touch). One slot can be used to keep OTP secret or challenge-response secret and it's up to user which slot he would prefer to program for one feature or another.
88

99
### Prerequisite
1010

docs/mgmt.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
## Using YubiKey Management Service
2+
3+
This `YKFKeyMGMTService` is using `YKFKeyRawCommandService` to communicate with YubiKey. How to implement such service yourself using `YKFKeyRawCommandService` read [here](../docs/raw.md)
4+
5+
The `YKFKeyMGMTService` provides 2 methods:
6+
1) reading request that provides you `YKFMGMTInterfaceConfiguration` YubiKey within reading response.
7+
2) writing request that accepts the same `YKFMGMTInterfaceConfiguration` with updated flags on properties that needs to be tweaked (enabled/disabled)
8+
9+
##### Objective-C
10+
11+
```objective-c
12+
#import <YubiKit/YubiKit.h>
13+
14+
...
15+
YKFKeyMGMTService *service = [[YKFKeyMGMTService alloc] init];
16+
[service readConfigurationWithCompletion:^(YKFKeyMGMTReadConfigurationResponse *selectionResponse, NSError *error) {
17+
if (error) {
18+
// Handle the error
19+
return;
20+
}
21+
YKFMGMTInterfaceConfiguration *configuration = selectionResponse.configuration;
22+
23+
if([configuration isSupported:YKFMGMTApplicationTypeOTP overTransport:YKFMGMTTransportTypeNFC]) {
24+
//if OTP/YubiKey/Challenge-response application is supported on the app
25+
}
26+
27+
if ([configuration isEnabled:YKFMGMTApplicationTypeOTP overTransport:YKFMGMTTransportTypeNFC]) {
28+
//if OTP/YubiKey/Challenge-response application is enabled on the app
29+
}
30+
31+
}];
32+
```
33+
34+
##### Swift
35+
36+
```swift
37+
let service = YKFKeyMGMTService()
38+
mgtmService.readConfiguration { [weak self] (response, error) in
39+
guard let self = self else {
40+
return
41+
}
42+
43+
if let error = error {
44+
// Handle the error
45+
return
46+
}
47+
48+
let configuration = response.configuration
49+
50+
...
51+
52+
configuration.setEnabled(true, application: .OTP, overTransport: .USB)
53+
54+
mgtmService.write(self.configuration, reboot: true) { [weak self] error in
55+
if let error = error {
56+
// Handle the error
57+
return
58+
}
59+
//successfully updated
60+
}
61+
}
62+
```
63+
64+
If method is invoked when there is no connection with YubiKey than methods of this service will return an error. So it's delegated to user of APIs to make sure that YubiKey is plugged in or tapped over NFC reader when prompted. This can be reached by observing state properties of sessions that has been started by user: the `sessionState` property of `YKFAccessorySession` ( or `iso7816SessionState` property of `NFCSession`). If state is open it means that connection has been established.
65+
The example of such observer can be found in the Examples/Observers project group of YubiKitDemo project.
66+

0 commit comments

Comments
 (0)