-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jens/bio-multi-protocol'
- Loading branch information
Showing
19 changed files
with
578 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
YubiKit/YubiKit/Connections/Shared/Errors/YKFInvalidPinError.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2018-2024 Yubico AB | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef YKFInvalidPinError_h | ||
#define YKFInvalidPinError_h | ||
|
||
extern NSString* const YKFInvalidPinErrorDomain; | ||
extern NSInteger const YKFInvalidPinErrorCode; | ||
|
||
@interface YKFInvalidPinError: NSError | ||
|
||
@property (nonatomic, readonly) int retries; | ||
|
||
+ (instancetype)invalidPinErrorWithRetries:(int)retries; | ||
|
||
@end | ||
#endif /* YKFInvalidPinError_h */ |
35 changes: 35 additions & 0 deletions
35
YubiKit/YubiKit/Connections/Shared/Errors/YKFInvalidPinError.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2018-2024 Yubico AB | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "YKFInvalidPinError.h" | ||
|
||
NSString* const YKFInvalidPinErrorDomain = @"com.yubico.invalid-pin"; | ||
NSInteger const YKFInvalidPinErrorCode = 1; | ||
|
||
@interface YKFInvalidPinError() | ||
|
||
@property (nonatomic, readwrite) int retries; | ||
|
||
@end | ||
|
||
@implementation YKFInvalidPinError | ||
|
||
+ (instancetype)invalidPinErrorWithRetries:(int)retries { | ||
YKFInvalidPinError *error = [[YKFInvalidPinError alloc] initWithDomain:YKFInvalidPinErrorDomain code:YKFInvalidPinErrorCode userInfo:nil]; | ||
error.retries = retries; | ||
return error; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
YubiKit/YubiKit/Connections/Shared/Sessions/PIV/YKFPIVBioMetadata+Private.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2018-2024 Yubico AB | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
#ifndef YKFPIVBioMetadata_Private_h | ||
#define YKFPIVBioMetadata_Private_h | ||
|
||
#import "YKFPIVBioMetadata.h" | ||
|
||
@interface YKFPIVBioMetadata() | ||
|
||
- (instancetype)initWithIsConfigured:(bool)isConfigured attemptsRemaining:(int)attemptsRemaining temporaryPin:(bool)temporaryPin NS_DESIGNATED_INITIALIZER; | ||
|
||
@end | ||
|
||
#endif /* YKFPIVBioMetadata_Private_h */ |
27 changes: 27 additions & 0 deletions
27
YubiKit/YubiKit/Connections/Shared/Sessions/PIV/YKFPIVBioMetadata.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2018-2024 Yubico AB | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface YKFPIVBioMetadata : NSObject | ||
|
||
@property (nonatomic, readonly) bool isConfigured; | ||
@property (nonatomic, readonly) int attemptsRemaining; | ||
@property (nonatomic, readonly) bool temporaryPin; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
38 changes: 38 additions & 0 deletions
38
YubiKit/YubiKit/Connections/Shared/Sessions/PIV/YKFPIVBioMetadata.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2018-2024 Yubico AB | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#import "YKFPIVBioMetadata.h" | ||
|
||
@interface YKFPIVBioMetadata() | ||
|
||
@property (nonatomic, readwrite) bool isConfigured; | ||
@property (nonatomic, readwrite) int attemptsRemaining; | ||
@property (nonatomic, readwrite) bool temporaryPin; | ||
|
||
@end | ||
|
||
@implementation YKFPIVBioMetadata | ||
|
||
- (instancetype)initWithIsConfigured:(bool)isConfigured attemptsRemaining:(int)attemptsRemaining temporaryPin:(bool)temporaryPin | ||
{ | ||
self = [super init]; | ||
if (self) { | ||
self.isConfigured = isConfigured; | ||
self.attemptsRemaining = attemptsRemaining; | ||
self.temporaryPin = temporaryPin; | ||
} | ||
return self; | ||
} | ||
|
||
@end |
14 changes: 10 additions & 4 deletions
14
YubiKit/YubiKit/Connections/Shared/Sessions/PIV/YKFPIVKeyType.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 10 additions & 4 deletions
14
YubiKit/YubiKit/Connections/Shared/Sessions/PIV/YKFPIVKeyType.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 10 additions & 4 deletions
14
YubiKit/YubiKit/Connections/Shared/Sessions/PIV/YKFPIVSession+Private.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.