-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from lolgear/master
New API Introduced
- Loading branch information
Showing
20 changed files
with
341 additions
and
201 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
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,79 @@ | ||
// | ||
// JWTAlgorithmDataHolder.h | ||
// JWT | ||
// | ||
// Created by Lobanov Dmitry on 31.08.16. | ||
// Copyright © 2016 Karma. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "JWTAlgorithm.h" | ||
#import "JWTDeprecations.h" | ||
|
||
// TODO: available in 3.0 | ||
// All methods with secret as NSString in algorithms will be deprecated or removed. | ||
|
||
@protocol JWTAlgorithmDataHolder <NSObject> | ||
/** | ||
The verification key to use when encoding/decoding a JWT in data form | ||
*/ | ||
@property (copy, nonatomic, readonly) NSData *currentSecretData __deprecated_msg("msg"); | ||
|
||
/** | ||
The <JWTAlgorithm> to use for encoding a JWT | ||
*/ | ||
@property (strong, nonatomic, readonly) id <JWTAlgorithm> currentAlgorithm; | ||
@end | ||
|
||
@interface JWTAlgorithmBaseDataHolder : NSObject <JWTAlgorithmDataHolder> | ||
|
||
#pragma mark - Getters | ||
/** | ||
The verification key to use when encoding/decoding a JWT | ||
*/ | ||
@property (copy, nonatomic, readonly) NSString *currentSecret; | ||
|
||
/** | ||
The algorithm name to use for decoding the JWT. Required unless force decode is true | ||
*/ | ||
@property (copy, nonatomic, readonly) NSString *currentAlgorithmName; | ||
|
||
#pragma mark - Setters | ||
/** | ||
Sets jwtSecret and returns the JWTAlgorithmBaseDataHolder to allow for method chaining | ||
*/ | ||
@property (copy, nonatomic, readonly) JWTAlgorithmBaseDataHolder *(^secret)(NSString *secret); | ||
|
||
/** | ||
Sets jwtSecretData and returns the JWTAlgorithmBaseDataHolder to allow for method chaining | ||
*/ | ||
@property (copy, nonatomic, readonly) JWTAlgorithmBaseDataHolder *(^secretData)(NSData *secretData); | ||
|
||
/** | ||
Sets jwtAlgorithm and returns the JWTAlgorithmBaseDataHolder to allow for method chaining | ||
*/ | ||
@property (copy, nonatomic, readonly) JWTAlgorithmBaseDataHolder *(^algorithm)(id<JWTAlgorithm>algorithm); | ||
|
||
/** | ||
Sets jwtAlgorithmName and returns the JWTAlgorithmBaseDataHolder to allow for method chaining. See list of names in appropriate headers. | ||
*/ | ||
@property (copy, nonatomic, readonly) JWTAlgorithmBaseDataHolder *(^algorithmName)(NSString *algorithmName); | ||
|
||
@end | ||
|
||
@interface JWTAlgorithmHSFamilyDataHolder : JWTAlgorithmBaseDataHolder | ||
@end | ||
|
||
@interface JWTAlgorithmRSFamilyDataHolder : JWTAlgorithmBaseDataHolder | ||
#pragma mark - Getters | ||
/** | ||
The passphrase for the PKCS12 blob, which represents the certificate containing the private key for the RS algorithms. | ||
*/ | ||
@property (copy, nonatomic, readonly) NSString *currentPrivateKeyCertificatePassphrase; | ||
|
||
#pragma mark - Setters | ||
/** | ||
Sets jwtPrivateKeyCertificatePassphrase and returns the JWTAlgorithmRSFamilyDataHolder to allow for method chaining | ||
*/ | ||
@property (copy, nonatomic, readonly) JWTAlgorithmRSFamilyDataHolder *(^privateKeyCertificatePassphrase)(NSString *privateKeyCertificatePassphrase); | ||
@end |
Oops, something went wrong.