[
  {
    "path": ".github/CONTRIBUTING.md",
    "content": "# Contributing to JWT\n\nWe want to make contributing to this project as easy and transparent as possible. Here are a few guidelines for making all our lives easier.\n\n## Reporting Issues\n\nA great way to contribute to the project is to send a detailed issue when you encounter an problem.\nIt is very important to check for the same problem or suggestion in the project's issue list first. If you find a match, just add a small comment there.\nDoing this helps prioritize the most common problems and requests.\n\nWhen reporting issues, please include the following:\n\n- The platform name and version (e.g. iOS 8.1)\n- The library version\n- The integration method (e.g. CocoaPods/Carthage/manually)\n- The version of Xcode you're using\n- The full output of any stack trace or compiler error\n- A small demo project that replicates the issue (especially if the way to reproduce the issue is not straight-forward)\n- Any other details that would be useful in understanding the problem\n\nThis information will help us review and fix your issue faster.\n\n\nPlease do not be offended if we close your issue and reference this document.\nIf you believe the issue is truely a fault in the project’s codebase, re-open it.\n\n## Pull Requests\n\nWe gladly accept any PR's assuming they are well written, documented ( if necessary ) and preferably have test code.\nIf you're unsure if we'll accept a new feature please open an issue requesting it and we can have a discussion before you code and submit a PR.\n\nChecklist:\n- Fork the repo and create your branch from the latest master (to minimize the conflicts)\n- If you've added code that should be tested, add tests.\n- If you've changed APIs, update the documentation.\n- Ensure the test suite passes.\n- Make sure your code lints (pod lib lint)\n\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "content": "### New Issue Checklist\n\n- [ ] I have read and understood the [CONTRIBUTING guide](https://github.com/yourkarma/JWT/blob/master/.github/CONTRIBUTING.md)\n- [ ] I have read the [Documentation](https://github.com/yourkarma/JWT#documentation)\n- [ ] I have searched for a similar issue in the [project](https://github.com/yourkarma/JWT/issues) and found none\n\n### Issue Info\n\n Info                    | Value                               |\n-------------------------|-------------------------------------|\n Platform Name           | e.g. ios / osx / tvos / watchos\n Platform Version        | e.g. 8.0\n CocoaLumberjack Version | e.g. 2.3.0\n Integration Method      | e.g. carthage / cocoapods / manually\n Xcode Version           | e.g. Xcode 7.3\n Repro rate              | e.g. all the time (100%) / sometimes x% / only once\n Demo project link       | e.g. link to a demo project that highlights the issue\n\n### Issue Description and Steps\n\nPlease fill in the detailed description of the issue (full output of any stack trace, compiler error, ...) and the steps to reproduce the issue."
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "content": "### New Pull Request Checklist\n\n- [ ] I have searched for a similar pull request in the [project](https://github.com/yourkarma/JWT/pulls) and found none\n- [ ] I have updated this branch with the latest master to avoid conflicts (via merge from master or rebase)\n- [ ] I have added the required tests to prove the fix/feature I am adding\n- [ ] I have updated the documentation (if necessary)\n- [ ] I have run the tests and they pass\n- [ ] I have run the lint and it passes (`pod lib lint`)\n\nBefore merge, please, assure that your commits are grouped.\nPlease, don't make several PRs with single commit, group PRs into one if possible.\n\nThis merge request fixes / refers to the following issues: ...\n\n### Pull Request Description\n\n...\n"
  },
  {
    "path": ".github/workflows/library-builds.yaml",
    "content": "name: Library Builds\n\non:\n  push:\n    branches: [ ci/github_actions, master ]\n  pull_request:\n    branches: [ master ]\n\n  # Allows you to run this workflow manually from the Actions tab\n  workflow_dispatch:\n\nenv:\n  LC_CTYPE: en_US.UTF-8\n  LANG: en_US.UTF-8\n\njobs:\n  static-library:\n    runs-on: macos-11\n    strategy:\n      matrix:\n        include:\n          - scheme: JWT\n            sdk: macosx\n            destination: 'platform=macosx'\n          - scheme: JWT\n            sdk: iphonesimulator\n            destination: 'platform=iOS Simulator,name=iPhone 13,OS=latest'\n          - scheme: JWT\n            sdk: appletvsimulator\n            destination: 'platform=tvOS Simulator,name=Apple TV,OS=latest'\n          - scheme: JWT\n            sdk: watchsimulator\n            destination: 'platform=watchOS Simulator,name=Apple Watch Series 6 - 44mm,OS=latest'\n    steps:\n      - uses: actions/checkout@v2\n      - run: gem install xcpretty --no-document\n      - run: set -o pipefail\n      - run: ./Scripts/ci-xcode-select.sh\n      - run: xcodebuild clean build -scheme \"${{ matrix.scheme }}\" -sdk \"${{ matrix.sdk }}\" -destination \"${{ matrix.destination }}\" | xcpretty && exit ${PIPESTATUS[0]}\n"
  },
  {
    "path": ".github/workflows/unit-tests.yaml",
    "content": "name: Unit Tests\n\non:\n  push:\n    branches: [ ci/github_actions, master ]\n  pull_request:\n    branches: [ master ]\n\n  # Allows you to run this workflow manually from the Actions tab\n  workflow_dispatch:\n\nenv:\n  LC_CTYPE: en_US.UTF-8\n  LANG: en_US.UTF-8\n\njobs:\n  caution:\n    runs-on:  macos-11\n    steps:\n      - run: echo \"Do not forget to change runs-on (os target) to macos-latest when it become latest\"\n      - run: echo \"Do not forget to add macOS tests when Apple fix Apple.car catalog compilation for macOS\"\n  xcode:\n    runs-on: macos-11\n    strategy:\n      matrix:\n        include:\n          - scheme: JWT\n            sdk: iphonesimulator\n            destination: 'platform=iOS Simulator,name=iPhone 13,OS=latest'\n          - scheme: JWT\n            sdk: appletvsimulator\n            destination: 'platform=tvOS Simulator,name=Apple TV,OS=latest'\n          - scheme: JWT\n            sdk: watchsimulator\n            destination: 'platform=watchOS Simulator,name=Apple Watch Series 6 - 44mm,OS=latest'\n    steps:\n      - uses: actions/checkout@v2\n      - run: gem install xcpretty --no-document\n      - run: ./Scripts/ci-xcode-select.sh\n      - run: xcodebuild test -scheme \"${{ matrix.scheme }}\" -sdk \"${{ matrix.sdk }}\" -destination \"${{ matrix.destination }}\" | xcpretty && exit ${PIPESTATUS[0]}\n"
  },
  {
    "path": ".github/workflows/validations.yaml",
    "content": "name: Validations\n\non:\n  push:\n    branches: [ ci/github_actions, master ]\n  pull_request:\n    branches: [ master ]\n\n  # Allows you to run this workflow manually from the Actions tab\n  workflow_dispatch:\n\njobs:\n  validate-third-party-packages-managers:\n    runs-on: macos-11\n    steps:\n      - uses: actions/checkout@v2\n      - run: gem install xcpretty --no-document\n      - run: set -o pipefail\n      - run: swift --version\n      - run: xcodebuild -version\n      - run: ./Scripts/ci-xcode-select.sh\n      # cocoapods\n      - run: pod lib lint --allow-warnings\n      # also add validation for spm later.\n"
  },
  {
    "path": ".gitignore",
    "content": "# Mac OS\n.DS_Store\n# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\n*.moved-aside\nDerivedData\n*.hmap\n*.ipa\n*.xcuserstate\n\n# AppCode JetBrains\n.idea/\n\n# rvm\n.ruby-version\n.ruby-gemset\nExample/**/.ruby-version\nExample/**/.ruby-gemset\nInspection/**/.ruby-version\nInspection/**/.ruby-gemset\n\n# Pods\nPods/Pods.xcodeproj/xcuserdata/\nPods/\nExample/**/Pods/Pods.xcodeproj/xcuserdata/\nExample/**/Pods/\nInspection/**/Pods/Pods.xcodeproj/xcuserdata/\nInspection/**/Pods/\n\n# Carthage\nExample/CarthageCompatibility/Carthage/"
  },
  {
    "path": ".gitmodules",
    "content": ""
  },
  {
    "path": ".local_run_travis_script.sh",
    "content": "cat .travis.yml | perl -lne '/^script:/ ... eof() and /^\\s+-/ and s/^\\s+-// and print and print qx($_)'"
  },
  {
    "path": ".travis.yml",
    "content": "language: objective-c\nmatrix:\n    include:\n        - osx_image: xcode12.5\n        # - osx_image: xcode8.3\n\nbefore_install:\n    # - brew update\n    #- if brew outdated | grep -qx xctool; then brew upgrade xctool; fi\n    # install\n    # - rvm use 2.2.2 --install --binary --fuzzy\n    # - gem install cocoapods --no-rdoc --no-ri --no-document --quiet\n    - gem install xcpretty --no-document\n    # - pod --version\n    # - pod setup --silent > /dev/null\n    # - pod repo update --silent\n    - xcpretty --version\n    - xcodebuild -version\n    - xcodebuild -showsdks\nscript:\n    # 32-bit tests\n    # - xctool -sdk iphonesimulator clean test -destination \"name=iPhone 5\" -find-target \"JWTTests\"\n    # 64-bit tests\n    # - xctool -sdk iphonesimulator clean test -destination \"name=iPhone 5s\" -find-target \"JWTTests\"\n\n    # Thanks CocoaLumberjack!\n\n    - set -o pipefail\n\n    - echo Check if the library described by the podspec can be built\n    - pod lib lint --allow-warnings\n\n    # Unused.\n    # - echo \"Build as dynamic framework (ObjectiveC), each platform (osx, ios)\"\n    # - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-macOS' -configuration Release -sdk macosx | xcpretty -c\n    # - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-iOS' -configuration Release -sdk iphonesimulator | xcpretty -c\n\n    # - echo \"Build as dynamic framework (Swift), each platform (osx, ios)\"\n    # - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-macOS-Swift' -configuration Release -sdk macosx | xcpretty -c\n    # - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-iOS-Swift' -configuration Release -sdk iphonesimulator | xcpretty -c\n\n    # Framework.\n    - echo \"Build dynamic universal for each platform (osx, ios)\"\n    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT' -configuration Release -sdk macosx | xcpretty -c\n    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT' -configuration Release -sdk iphonesimulator | xcpretty -c\n    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT' -configuration Release -sdk appletvsimulator | xcpretty -c\n    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT' -configuration Release -sdk watchsimulator | xcpretty -c\n\n    # Static Library.\n    # We need to change order in case of xcodebuild bug.\n    # xcodebuild does not remove static library on -clean action.\n    # In this case\n    # static library after framework is ok.\n    # framework after static library is bad.\n    # beer and wine order, heh.\n    - echo \"Build iOS Static library\"\n    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-Static' -configuration Release -sdk macosx | xcpretty -c\n    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-Static' -configuration Release -sdk iphonesimulator | xcpretty -c\n    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-Static' -configuration Release -sdk appletvsimulator | xcpretty -c\n    - xcodebuild clean build -project Framework/JWT.xcodeproj -scheme 'JWT-Static' -configuration Release -sdk watchsimulator | xcpretty -c\n    \n    # Tests.\n    - echo Run iOS Tests\n    # 32-bit tests\n    # TODO: Add xsimctl invocation to install iPhone 5 or 5s simulators.\n    # - echo 32-bit tests\n    # - xcodebuild test -project 'Tests/Tests.xcodeproj' -scheme 'iOS_Tests' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 5,OS=latest' | xcpretty -c\n    # # 64-bit tests\n    - echo Run iOS 64-bit tests\n    - xcodebuild test -project 'Tests/Tests.xcodeproj' -scheme 'iOS_Tests' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11,OS=latest' | xcpretty -c\n    # mac OS tests\n    - echo Run Mac OS tests\n    - xcodebuild test -project 'Tests/Tests.xcodeproj' -scheme 'macOS_Tests' -sdk macosx | xcpretty -c\n    # tvOS tests\n    - echo Run tvOS tests\n    - xcodebuild test -project 'Tests/Tests.xcodeproj' -scheme 'tvOS_Tests' -sdk appletvsimulator -destination 'platform=tvOS Simulator,name=Apple TV,OS=latest' | xcpretty -c\n    # watchOS tests\n    - echo Run watchOS tests\n    - xcodebuild test -project 'Tests/Tests.xcodeproj' -scheme 'watchOS_Tests' -sdk watchsimulator -destination 'platform=watchOS Simulator,name=Apple Watch Series 6 - 44mm,OS=latest'"
  },
  {
    "path": "Cartfile",
    "content": "github \"https://github.com/soheilbm/Base64.git\" \"Cartfile\""
  },
  {
    "path": "Cartfile.resolved",
    "content": "github \"soheilbm/Base64\" \"67083ec1e3e970ec920cbf126e6957c6e9e88ae4\"\n"
  },
  {
    "path": "Documentation/Prerelease/custom_claims.md",
    "content": "# Custom Claims.\n\n## Intro.\n\nConsider the following problem.\nYou have an integer interval and you would like to know if untrusted and trusted intervals intersection is empty or not.\n\nIf they have intersection and it is not empty, then, we would like to say \"yes\" to untrusted value.\nOtherwise we treat it as malicious and discard it.\n\nIn simple example, we may have\n\n```\ntrustedValue\n// 1...5 \nuntrustedValue\n// 2...6\n```\n\nThey have non-empty intersection which equals to `2...5`.\n\n## Example Data.\n\nWe may encode this special claim as two numbers that are separated by comma.\n\nLet's call our claim as \"intersection\".\n\nJSON for this claim `1...5` will be equal to\n```json\n{\n\"intersection\": \"1,5\"\n}\n```\n\n## Example.\n\nWe have to define three components for our case.\n\n1. Define a claim.\n2. Define a serializer.\n3. Define a verifier.\n\n## Define a claim.\n\n```objective-c\n/// Define a name of a claim.\n@interface JWTClaimsNames (Custom)\n@property (copy, nonatomic, readonly, class) NSString *intersectionOfIntervals;\n@end\n\n@implementation JWTClaimsNames (Custom)\n+ (NSString *)intersectionOfIntervals { return @\"intersectionOfIntervals\"; }\n@end\n\n/// Define a claim\n@interface JWTClaimCustomIntersectionOfIntervals : JWTClaimBase\n@end\n\n@implementation JWTClaimCustomIntersectionOfIntervals\n+ (NSString *)name { return JWTClaimsNames.intersectionOfIntervals; }\n@end\n```\n\n## Define a serializer.\n\n```objective-c\n/// Define a serializer\n@interface JWTClaimSerializerForInterval : JWTClaimSerializerBase\n@end\n\n@implementation JWTClaimSerializerForInterval\n\n- (NSObject *)deserializedClaimValue:(NSObject *)value forName:(NSString *)name {\n    if ([value isKindOfClass:NSString.class]) {\n        __auto_type array = [(NSString *)value componentsSeparatedByString:@\",\"];\n        __auto_type result = [NSMutableArray array];\n        for (NSString *item in array) {\n            [result addObject:@(item.integerValue)];\n        }\n        __auto_type descriptor = [[NSSortDescriptor alloc] initWithKey:@\"integerValue\" ascending:YES];\n\n        return [result sortedArrayUsingDescriptors:@[descriptor]];\n    }\n    return value;\n}\n\n- (NSObject *)serializedClaimValue:(id<JWTClaimProtocol>)claim {\n    __auto_type value = claim.value;\n    if ([value isKindOfClass:NSArray.class]) {\n        __auto_type descriptor = [[NSSortDescriptor alloc] initWithKey:@\"integerValue\" ascending:YES];\n        __auto_type sortedArray = [(NSArray *)claim.value sortedArrayUsingDescriptors:@[descriptor]];\n        return [sortedArray componentsJoinedByString:@\",\"];\n    }\n    return value;\n}\n\n@end\n```\n\n## Define a verifier.\n\n```objective-c\n/// Define a verifier.\n@interface JWTClaimVerifierForIntersection : JWTClaimVerifierBase\n@end\n\n@implementation JWTClaimVerifierForIntersection\n- (BOOL)verifyValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue {\n    if ([value isKindOfClass:NSArray.class] && [trustedValue isKindOfClass:NSArray.class]) {\n        __auto_type lhs = (NSArray *)value;\n        __auto_type rhs = (NSArray *)trustedValue;\n        \n        if (rhs.count != 2) {\n            return NO;\n        }\n        \n        if (lhs.count > 2 || lhs.count == 0) {\n            return NO;\n        }\n        \n        __auto_type lowerBorder = ((NSNumber *)rhs.firstObject).integerValue;\n        __auto_type upperBorder = ((NSNumber *)rhs.lastObject).integerValue;\n        \n        if (lhs.count == 1) {\n            __auto_type checkValue = ((NSNumber *)lhs.firstObject).integerValue;\n            return lowerBorder <= checkValue && upperBorder >= checkValue;\n        }\n        \n        if (lhs.count == 2) {\n            __auto_type untrustedLowerBorder = ((NSNumber *)lhs.firstObject).integerValue;\n            __auto_type untrustedUpperBorder = ((NSNumber *)lhs.lastObject).integerValue;\n            return (untrustedLowerBorder >= lowerBorder && untrustedLowerBorder <= upperBorder) || (untrustedUpperBorder >= lowerBorder && untrustedUpperBorder <= upperBorder);\n        }\n    }\n    return NO;\n}\n@end\n```\n\n## Add DSL if needed.\n\n```objective-c\n@interface JWTClaimsSetDSLBase (CustomDSL)\n@property (copy, nonatomic, readwrite) NSArray *intersection;\n@end\n\n@implementation JWTClaimsSetDSLBase (CustomDSL)\n- (NSArray *)intersection {\n    return (NSArray *)[self dslValueForName:JWTClaimsNames.intersectionOfIntervals];\n}\n- (void)setIntersection:(NSArray *)intersection {\n    [self dslSetValue:intersection forName:JWTClaimsNames.intersectionOfIntervals];\n}\n@end\n\n@interface JWTClaimVariations (CustomDSL)\n+ (id<JWTClaimProtocol>)intersectionOfIntervals;\n@end\n\n@implementation JWTClaimVariations (CustomDSL)\n+ (id<JWTClaimProtocol>)intersectionOfIntervals {\n    return [JWTClaimCustomIntersectionOfIntervals new];\n}\n@end\n\n@interface JWTClaimSerializerVariations (CustomDSL)\n+ (id<JWTClaimSerializerProtocol>)interval;\n@end\n\n@implementation JWTClaimSerializerVariations (CustomDSL)\n+ (id<JWTClaimSerializerProtocol>)interval {\n    return [JWTClaimSerializerForInterval new];\n}\n@end\n\n@interface JWTClaimVerifierVariations (CustomDSL)\n+ (id<JWTClaimVerifierProtocol>)intersection;\n@end\n\n@implementation JWTClaimVerifierVariations (CustomDSL)\n+ (id<JWTClaimVerifierProtocol>)intersection {\n    return [JWTClaimVerifierForIntersection new];\n}\n@end\n```\n\n## Put everything together.\n```objective-c\n- (void)test {\n    /// Setup ClaimsSetCoordinator\n    __auto_type claim = JWTClaimVariations.intersectionOfIntervals;\n    __auto_type claimSerializer = JWTClaimSerializerVariations.interval;\n    __auto_type claimVerifier = JWTClaimVerifierVariations.intersection;\n\n    id<JWTClaimsSetCoordinatorProtocol> claimsSetCoordinator = [JWTClaimsSetCoordinatorBase new];\n    [claimsSetCoordinator registerClaim:claim serializer:claimSerializer verifier:claimVerifier forClaimName:JWTClaimsNames.intersectionOfIntervals];\n\n    __auto_type deserialized = ({\n        claimsSetCoordinator.configureClaimsSet(^JWTClaimsSetDSLBase *(JWTClaimsSetDSLBase *claimsSetDSL) {\n            claimsSetDSL.intersection = @[@(2), @(5)];\n            return claimsSetDSL;\n        });\n        self.claimsSetCoordinator.claimsSetStorage;\n    });\n    \n    __auto_type serialized = ({\n        __auto_type dictionary = [self.claimsSetCoordinator.claimsSetSerializer dictionaryFromClaimsSet:deserialized];\n        dictionary;\n    });\n    \n    __auto_type result = @{\n        JWTClaimsNames.intersectionOfIntervals : @\"2,5\"\n    };\n    XCTAssertEqual(serialized.count, 1);\n    XCTAssertEqualObjects(serialized, result);\n}\n```\n\n## Use with decoding and encoding.\n\n```objective-c\n- (void)testEncodingAndDecodingViaCoordinator {\n    id<JWTClaimsSetCoordinatorProtocol> claimsSetCoordinator = [JWTClaimsSetCoordinatorBase new];\n    __auto_type claimsSetDSL = claimsSetCoordinator.dslDesrciption;\n    // fill it\n    claimsSetDSL.issuer = @\"Facebook\";\n    claimsSetDSL.subject = @\"Token\";\n    claimsSetDSL.audience = @\"https://jwt.io\";\n    \n    claimsSetCoordinator.claimsSetStorage = claimsSetDSL.claimsSetStorage;\n    // encode it\n    __auto_type secret = @\"secret\";\n    __auto_type algorithmName = @\"HS384\";\n    __auto_type headers = @{@\"custom\":@\"value\"};\n\n    id<JWTAlgorithmDataHolderProtocol>holder = [JWTAlgorithmHSFamilyDataHolder new].algorithmName(algorithmName).secret(secret);\n\n    JWTCodingResultType *result = [JWTEncodingBuilder encodeClaimsSetWithCoordinator:claimsSetCoordinator].headers(headers).addHolder(holder).result;\n\n    NSString *encodedToken = result.successResult.encoded;\n    if (result.successResult) {\n        // handle encoded result\n        NSLog(@\"encoded result: %@\", result.successResult.encoded);\n    }\n    else {\n        // handle error\n        NSLog(@\"encode failed, error: %@\", result.errorResult.error);\n    }\n\n    // decode it\n    // you can set any property that you want, all properties are optional\n    __auto_type trustedClaimsSet = claimsSetDSL.claimsSetStorage;\n\n    NSNumber *options = @(JWTCodingDecodingOptionsNone);\n    NSString *yourJwt = encodedToken; // from previous example\n    JWTCodingResultType *decodedResult = [JWTDecodingBuilder decodeMessage:yourJwt].claimsSetCoordinator(claimsSetCoordinator).addHolder(holder).options(options).and.result;\n\n    if (decodedResult.successResult) {\n        // handle decoded result\n        NSLog(@\"decoded result: %@\", decodedResult.successResult.headerAndPayloadDictionary);\n        NSLog(@\"headers: %@\", decodedResult.successResult.headers);\n        NSLog(@\"payload: %@\", decodedResult.successResult.payload);\n        NSLog(@\"trustedClaimsSet: %@\", [claimsSetCoordinator.claimsSetSerializer dictionaryFromClaimsSet:trustedClaimsSet]);\n        NSLog(@\"decodedClaimsSet: %@\", [claimsSetCoordinator.claimsSetSerializer dictionaryFromClaimsSet:decodedResult.successResult.claimsSetStorage]);\n    }\n    else {\n        // handle error\n        NSLog(@\"decode failed, error: %@\", decodedResult.errorResult.error);\n    }\n\n}\n```"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/AppDelegate.h",
    "content": "//\n//  AppDelegate.h\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 23.05.16.\n//  Copyright © 2016 JWT. All rights reserved.\n//\n\n#import <Cocoa/Cocoa.h>\n\n@interface AppDelegate : NSObject <NSApplicationDelegate>\n\n\n@end\n\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/AppDelegate.m",
    "content": "//\n//  AppDelegate.m\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 23.05.16.\n//  Copyright © 2016 JWT. All rights reserved.\n//\n\n#import \"AppDelegate.h\"\n\n@interface AppDelegate ()\n\n@end\n\n@implementation AppDelegate\n\n- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {\n    // Insert code here to initialize your application\n}\n\n- (void)applicationWillTerminate:(NSNotification *)aNotification {\n    // Insert code here to tear down your application\n}\n\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"size\" : \"16x16\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"jwt_icon_16x16.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"16x16\",\n      \"filename\" : \"jwt_icon_32x32.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"32x32\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"jwt_icon_32x32.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"32x32\",\n      \"filename\" : \"jwt_icon_64x64.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"128x128\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"jwt_icon_128x128.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"128x128\",\n      \"filename\" : \"jwt_icon_256x256.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"256x256\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"jwt_icon_256x256.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"256x256\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"jwt_icon_512x512.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"512x512\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"jwt_icon_512x512.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"512x512\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"jwt_icon_1024x1024.png\",\n      \"scale\" : \"2x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/Base.lproj/Main.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"18122\" targetRuntime=\"MacOSX.Cocoa\" propertyAccessControl=\"none\" useAutolayout=\"YES\" initialViewController=\"B8D-0N-5wS\">\n    <dependencies>\n        <deployment identifier=\"macosx\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.CocoaPlugin\" version=\"18122\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <scenes>\n        <!--Application-->\n        <scene sceneID=\"JPo-4y-FX3\">\n            <objects>\n                <application id=\"hnw-xV-0zn\" sceneMemberID=\"viewController\">\n                    <menu key=\"mainMenu\" title=\"Main Menu\" systemMenu=\"main\" id=\"AYu-sK-qS6\">\n                        <items>\n                            <menuItem title=\"JWTDesktop\" id=\"1Xt-HY-uBw\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <menu key=\"submenu\" title=\"JWTDesktop\" systemMenu=\"apple\" id=\"uQy-DD-JDr\">\n                                    <items>\n                                        <menuItem title=\"About JWTDesktop\" id=\"5kV-Vb-QxS\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <connections>\n                                                <action selector=\"orderFrontStandardAboutPanel:\" target=\"Ady-hI-5gd\" id=\"Exp-CZ-Vem\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"VOq-y0-SEH\"/>\n                                        <menuItem title=\"Preferences…\" keyEquivalent=\",\" id=\"BOF-NM-1cW\"/>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"wFC-TO-SCJ\"/>\n                                        <menuItem title=\"Services\" id=\"NMo-om-nkz\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Services\" systemMenu=\"services\" id=\"hz9-B4-Xy5\"/>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"4je-JR-u6R\"/>\n                                        <menuItem title=\"Hide JWTDesktop\" keyEquivalent=\"h\" id=\"Olw-nP-bQN\">\n                                            <connections>\n                                                <action selector=\"hide:\" target=\"Ady-hI-5gd\" id=\"PnN-Uc-m68\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Hide Others\" keyEquivalent=\"h\" id=\"Vdr-fp-XzO\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\" option=\"YES\" command=\"YES\"/>\n                                            <connections>\n                                                <action selector=\"hideOtherApplications:\" target=\"Ady-hI-5gd\" id=\"VT4-aY-XCT\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Show All\" id=\"Kd2-mp-pUS\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <connections>\n                                                <action selector=\"unhideAllApplications:\" target=\"Ady-hI-5gd\" id=\"Dhg-Le-xox\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"kCx-OE-vgT\"/>\n                                        <menuItem title=\"Quit JWTDesktop\" keyEquivalent=\"q\" id=\"4sb-4s-VLi\">\n                                            <connections>\n                                                <action selector=\"terminate:\" target=\"Ady-hI-5gd\" id=\"Te7-pn-YzF\"/>\n                                            </connections>\n                                        </menuItem>\n                                    </items>\n                                </menu>\n                            </menuItem>\n                            <menuItem title=\"File\" id=\"dMs-cI-mzQ\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <menu key=\"submenu\" title=\"File\" id=\"bib-Uj-vzu\">\n                                    <items>\n                                        <menuItem title=\"New\" keyEquivalent=\"n\" id=\"Was-JA-tGl\">\n                                            <connections>\n                                                <action selector=\"newDocument:\" target=\"Ady-hI-5gd\" id=\"4Si-XN-c54\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Open…\" keyEquivalent=\"o\" id=\"IAo-SY-fd9\">\n                                            <connections>\n                                                <action selector=\"openDocument:\" target=\"Ady-hI-5gd\" id=\"bVn-NM-KNZ\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Open Recent\" id=\"tXI-mr-wws\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Open Recent\" systemMenu=\"recentDocuments\" id=\"oas-Oc-fiZ\">\n                                                <items>\n                                                    <menuItem title=\"Clear Menu\" id=\"vNY-rz-j42\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"clearRecentDocuments:\" target=\"Ady-hI-5gd\" id=\"Daa-9d-B3U\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"m54-Is-iLE\"/>\n                                        <menuItem title=\"Close\" keyEquivalent=\"w\" id=\"DVo-aG-piG\">\n                                            <connections>\n                                                <action selector=\"performClose:\" target=\"Ady-hI-5gd\" id=\"HmO-Ls-i7Q\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Save…\" keyEquivalent=\"s\" id=\"pxx-59-PXV\">\n                                            <connections>\n                                                <action selector=\"saveDocument:\" target=\"Ady-hI-5gd\" id=\"teZ-XB-qJY\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Save As…\" keyEquivalent=\"S\" id=\"Bw7-FT-i3A\">\n                                            <connections>\n                                                <action selector=\"saveDocumentAs:\" target=\"Ady-hI-5gd\" id=\"mDf-zr-I0C\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Revert to Saved\" id=\"KaW-ft-85H\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <connections>\n                                                <action selector=\"revertDocumentToSaved:\" target=\"Ady-hI-5gd\" id=\"iJ3-Pv-kwq\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"aJh-i4-bef\"/>\n                                        <menuItem title=\"Page Setup…\" keyEquivalent=\"P\" id=\"qIS-W8-SiK\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\" shift=\"YES\" command=\"YES\"/>\n                                            <connections>\n                                                <action selector=\"runPageLayout:\" target=\"Ady-hI-5gd\" id=\"Din-rz-gC5\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Print…\" keyEquivalent=\"p\" id=\"aTl-1u-JFS\">\n                                            <connections>\n                                                <action selector=\"print:\" target=\"Ady-hI-5gd\" id=\"qaZ-4w-aoO\"/>\n                                            </connections>\n                                        </menuItem>\n                                    </items>\n                                </menu>\n                            </menuItem>\n                            <menuItem title=\"Edit\" id=\"5QF-Oa-p0T\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <menu key=\"submenu\" title=\"Edit\" id=\"W48-6f-4Dl\">\n                                    <items>\n                                        <menuItem title=\"Undo\" keyEquivalent=\"z\" id=\"dRJ-4n-Yzg\">\n                                            <connections>\n                                                <action selector=\"undo:\" target=\"Ady-hI-5gd\" id=\"M6e-cu-g7V\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Redo\" keyEquivalent=\"Z\" id=\"6dh-zS-Vam\">\n                                            <connections>\n                                                <action selector=\"redo:\" target=\"Ady-hI-5gd\" id=\"oIA-Rs-6OD\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"WRV-NI-Exz\"/>\n                                        <menuItem title=\"Cut\" keyEquivalent=\"x\" id=\"uRl-iY-unG\">\n                                            <connections>\n                                                <action selector=\"cut:\" target=\"Ady-hI-5gd\" id=\"YJe-68-I9s\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Copy\" keyEquivalent=\"c\" id=\"x3v-GG-iWU\">\n                                            <connections>\n                                                <action selector=\"copy:\" target=\"Ady-hI-5gd\" id=\"G1f-GL-Joy\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Paste\" keyEquivalent=\"v\" id=\"gVA-U4-sdL\">\n                                            <connections>\n                                                <action selector=\"paste:\" target=\"Ady-hI-5gd\" id=\"UvS-8e-Qdg\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Paste and Match Style\" keyEquivalent=\"V\" id=\"WeT-3V-zwk\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\" option=\"YES\" command=\"YES\"/>\n                                            <connections>\n                                                <action selector=\"pasteAsPlainText:\" target=\"Ady-hI-5gd\" id=\"cEh-KX-wJQ\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Delete\" id=\"pa3-QI-u2k\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <connections>\n                                                <action selector=\"delete:\" target=\"Ady-hI-5gd\" id=\"0Mk-Ml-PaM\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Select All\" keyEquivalent=\"a\" id=\"Ruw-6m-B2m\">\n                                            <connections>\n                                                <action selector=\"selectAll:\" target=\"Ady-hI-5gd\" id=\"VNm-Mi-diN\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"uyl-h8-XO2\"/>\n                                        <menuItem title=\"Find\" id=\"4EN-yA-p0u\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Find\" id=\"1b7-l0-nxx\">\n                                                <items>\n                                                    <menuItem title=\"Find…\" tag=\"1\" keyEquivalent=\"f\" id=\"Xz5-n4-O0W\">\n                                                        <connections>\n                                                            <action selector=\"performFindPanelAction:\" target=\"Ady-hI-5gd\" id=\"cD7-Qs-BN4\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Find and Replace…\" tag=\"12\" keyEquivalent=\"f\" id=\"YEy-JH-Tfz\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\" option=\"YES\" command=\"YES\"/>\n                                                        <connections>\n                                                            <action selector=\"performFindPanelAction:\" target=\"Ady-hI-5gd\" id=\"WD3-Gg-5AJ\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Find Next\" tag=\"2\" keyEquivalent=\"g\" id=\"q09-fT-Sye\">\n                                                        <connections>\n                                                            <action selector=\"performFindPanelAction:\" target=\"Ady-hI-5gd\" id=\"NDo-RZ-v9R\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Find Previous\" tag=\"3\" keyEquivalent=\"G\" id=\"OwM-mh-QMV\">\n                                                        <connections>\n                                                            <action selector=\"performFindPanelAction:\" target=\"Ady-hI-5gd\" id=\"HOh-sY-3ay\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Use Selection for Find\" tag=\"7\" keyEquivalent=\"e\" id=\"buJ-ug-pKt\">\n                                                        <connections>\n                                                            <action selector=\"performFindPanelAction:\" target=\"Ady-hI-5gd\" id=\"U76-nv-p5D\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Jump to Selection\" keyEquivalent=\"j\" id=\"S0p-oC-mLd\">\n                                                        <connections>\n                                                            <action selector=\"centerSelectionInVisibleArea:\" target=\"Ady-hI-5gd\" id=\"IOG-6D-g5B\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                        <menuItem title=\"Spelling and Grammar\" id=\"Dv1-io-Yv7\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Spelling\" id=\"3IN-sU-3Bg\">\n                                                <items>\n                                                    <menuItem title=\"Show Spelling and Grammar\" keyEquivalent=\":\" id=\"HFo-cy-zxI\">\n                                                        <connections>\n                                                            <action selector=\"showGuessPanel:\" target=\"Ady-hI-5gd\" id=\"vFj-Ks-hy3\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Check Document Now\" keyEquivalent=\";\" id=\"hz2-CU-CR7\">\n                                                        <connections>\n                                                            <action selector=\"checkSpelling:\" target=\"Ady-hI-5gd\" id=\"fz7-VC-reM\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"bNw-od-mp5\"/>\n                                                    <menuItem title=\"Check Spelling While Typing\" id=\"rbD-Rh-wIN\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleContinuousSpellChecking:\" target=\"Ady-hI-5gd\" id=\"7w6-Qz-0kB\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Check Grammar With Spelling\" id=\"mK6-2p-4JG\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleGrammarChecking:\" target=\"Ady-hI-5gd\" id=\"muD-Qn-j4w\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Correct Spelling Automatically\" id=\"78Y-hA-62v\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleAutomaticSpellingCorrection:\" target=\"Ady-hI-5gd\" id=\"2lM-Qi-WAP\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                        <menuItem title=\"Substitutions\" id=\"9ic-FL-obx\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Substitutions\" id=\"FeM-D8-WVr\">\n                                                <items>\n                                                    <menuItem title=\"Show Substitutions\" id=\"z6F-FW-3nz\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"orderFrontSubstitutionsPanel:\" target=\"Ady-hI-5gd\" id=\"oku-mr-iSq\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"gPx-C9-uUO\"/>\n                                                    <menuItem title=\"Smart Copy/Paste\" id=\"9yt-4B-nSM\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleSmartInsertDelete:\" target=\"Ady-hI-5gd\" id=\"3IJ-Se-DZD\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Smart Quotes\" id=\"hQb-2v-fYv\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleAutomaticQuoteSubstitution:\" target=\"Ady-hI-5gd\" id=\"ptq-xd-QOA\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Smart Dashes\" id=\"rgM-f4-ycn\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleAutomaticDashSubstitution:\" target=\"Ady-hI-5gd\" id=\"oCt-pO-9gS\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Smart Links\" id=\"cwL-P1-jid\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleAutomaticLinkDetection:\" target=\"Ady-hI-5gd\" id=\"Gip-E3-Fov\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Data Detectors\" id=\"tRr-pd-1PS\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleAutomaticDataDetection:\" target=\"Ady-hI-5gd\" id=\"R1I-Nq-Kbl\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Text Replacement\" id=\"HFQ-gK-NFA\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleAutomaticTextReplacement:\" target=\"Ady-hI-5gd\" id=\"DvP-Fe-Py6\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                        <menuItem title=\"Transformations\" id=\"2oI-Rn-ZJC\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Transformations\" id=\"c8a-y6-VQd\">\n                                                <items>\n                                                    <menuItem title=\"Make Upper Case\" id=\"vmV-6d-7jI\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"uppercaseWord:\" target=\"Ady-hI-5gd\" id=\"sPh-Tk-edu\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Make Lower Case\" id=\"d9M-CD-aMd\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"lowercaseWord:\" target=\"Ady-hI-5gd\" id=\"iUZ-b5-hil\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Capitalize\" id=\"UEZ-Bs-lqG\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"capitalizeWord:\" target=\"Ady-hI-5gd\" id=\"26H-TL-nsh\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                        <menuItem title=\"Speech\" id=\"xrE-MZ-jX0\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Speech\" id=\"3rS-ZA-NoH\">\n                                                <items>\n                                                    <menuItem title=\"Start Speaking\" id=\"Ynk-f8-cLZ\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"startSpeaking:\" target=\"Ady-hI-5gd\" id=\"654-Ng-kyl\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Stop Speaking\" id=\"Oyz-dy-DGm\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"stopSpeaking:\" target=\"Ady-hI-5gd\" id=\"dX8-6p-jy9\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                    </items>\n                                </menu>\n                            </menuItem>\n                            <menuItem title=\"Format\" id=\"jxT-CU-nIS\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <menu key=\"submenu\" title=\"Format\" id=\"GEO-Iw-cKr\">\n                                    <items>\n                                        <menuItem title=\"Font\" id=\"Gi5-1S-RQB\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Font\" systemMenu=\"font\" id=\"aXa-aM-Jaq\">\n                                                <items>\n                                                    <menuItem title=\"Show Fonts\" keyEquivalent=\"t\" id=\"Q5e-8K-NDq\"/>\n                                                    <menuItem title=\"Bold\" tag=\"2\" keyEquivalent=\"b\" id=\"GB9-OM-e27\"/>\n                                                    <menuItem title=\"Italic\" tag=\"1\" keyEquivalent=\"i\" id=\"Vjx-xi-njq\"/>\n                                                    <menuItem title=\"Underline\" keyEquivalent=\"u\" id=\"WRG-CD-K1S\">\n                                                        <connections>\n                                                            <action selector=\"underline:\" target=\"Ady-hI-5gd\" id=\"FYS-2b-JAY\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"5gT-KC-WSO\"/>\n                                                    <menuItem title=\"Bigger\" tag=\"3\" keyEquivalent=\"+\" id=\"Ptp-SP-VEL\"/>\n                                                    <menuItem title=\"Smaller\" tag=\"4\" keyEquivalent=\"-\" id=\"i1d-Er-qST\"/>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"kx3-Dk-x3B\"/>\n                                                    <menuItem title=\"Kern\" id=\"jBQ-r6-VK2\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <menu key=\"submenu\" title=\"Kern\" id=\"tlD-Oa-oAM\">\n                                                            <items>\n                                                                <menuItem title=\"Use Default\" id=\"GUa-eO-cwY\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"useStandardKerning:\" target=\"Ady-hI-5gd\" id=\"6dk-9l-Ckg\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Use None\" id=\"cDB-IK-hbR\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"turnOffKerning:\" target=\"Ady-hI-5gd\" id=\"U8a-gz-Maa\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Tighten\" id=\"46P-cB-AYj\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"tightenKerning:\" target=\"Ady-hI-5gd\" id=\"hr7-Nz-8ro\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Loosen\" id=\"ogc-rX-tC1\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"loosenKerning:\" target=\"Ady-hI-5gd\" id=\"8i4-f9-FKE\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                            </items>\n                                                        </menu>\n                                                    </menuItem>\n                                                    <menuItem title=\"Ligatures\" id=\"o6e-r0-MWq\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <menu key=\"submenu\" title=\"Ligatures\" id=\"w0m-vy-SC9\">\n                                                            <items>\n                                                                <menuItem title=\"Use Default\" id=\"agt-UL-0e3\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"useStandardLigatures:\" target=\"Ady-hI-5gd\" id=\"7uR-wd-Dx6\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Use None\" id=\"J7y-lM-qPV\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"turnOffLigatures:\" target=\"Ady-hI-5gd\" id=\"iX2-gA-Ilz\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Use All\" id=\"xQD-1f-W4t\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"useAllLigatures:\" target=\"Ady-hI-5gd\" id=\"KcB-kA-TuK\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                            </items>\n                                                        </menu>\n                                                    </menuItem>\n                                                    <menuItem title=\"Baseline\" id=\"OaQ-X3-Vso\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <menu key=\"submenu\" title=\"Baseline\" id=\"ijk-EB-dga\">\n                                                            <items>\n                                                                <menuItem title=\"Use Default\" id=\"3Om-Ey-2VK\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"unscript:\" target=\"Ady-hI-5gd\" id=\"0vZ-95-Ywn\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Superscript\" id=\"Rqc-34-cIF\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"superscript:\" target=\"Ady-hI-5gd\" id=\"3qV-fo-wpU\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Subscript\" id=\"I0S-gh-46l\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"subscript:\" target=\"Ady-hI-5gd\" id=\"Q6W-4W-IGz\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Raise\" id=\"2h7-ER-AoG\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"raiseBaseline:\" target=\"Ady-hI-5gd\" id=\"4sk-31-7Q9\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Lower\" id=\"1tx-W0-xDw\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"lowerBaseline:\" target=\"Ady-hI-5gd\" id=\"OF1-bc-KW4\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                            </items>\n                                                        </menu>\n                                                    </menuItem>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"Ndw-q3-faq\"/>\n                                                    <menuItem title=\"Show Colors\" keyEquivalent=\"C\" id=\"bgn-CT-cEk\">\n                                                        <connections>\n                                                            <action selector=\"orderFrontColorPanel:\" target=\"Ady-hI-5gd\" id=\"mSX-Xz-DV3\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"iMs-zA-UFJ\"/>\n                                                    <menuItem title=\"Copy Style\" keyEquivalent=\"c\" id=\"5Vv-lz-BsD\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\" option=\"YES\" command=\"YES\"/>\n                                                        <connections>\n                                                            <action selector=\"copyFont:\" target=\"Ady-hI-5gd\" id=\"GJO-xA-L4q\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Paste Style\" keyEquivalent=\"v\" id=\"vKC-jM-MkH\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\" option=\"YES\" command=\"YES\"/>\n                                                        <connections>\n                                                            <action selector=\"pasteFont:\" target=\"Ady-hI-5gd\" id=\"JfD-CL-leO\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                        <menuItem title=\"Text\" id=\"Fal-I4-PZk\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Text\" id=\"d9c-me-L2H\">\n                                                <items>\n                                                    <menuItem title=\"Align Left\" keyEquivalent=\"{\" id=\"ZM1-6Q-yy1\">\n                                                        <connections>\n                                                            <action selector=\"alignLeft:\" target=\"Ady-hI-5gd\" id=\"zUv-R1-uAa\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Center\" keyEquivalent=\"|\" id=\"VIY-Ag-zcb\">\n                                                        <connections>\n                                                            <action selector=\"alignCenter:\" target=\"Ady-hI-5gd\" id=\"spX-mk-kcS\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Justify\" id=\"J5U-5w-g23\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"alignJustified:\" target=\"Ady-hI-5gd\" id=\"ljL-7U-jND\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Align Right\" keyEquivalent=\"}\" id=\"wb2-vD-lq4\">\n                                                        <connections>\n                                                            <action selector=\"alignRight:\" target=\"Ady-hI-5gd\" id=\"r48-bG-YeY\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"4s2-GY-VfK\"/>\n                                                    <menuItem title=\"Writing Direction\" id=\"H1b-Si-o9J\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <menu key=\"submenu\" title=\"Writing Direction\" id=\"8mr-sm-Yjd\">\n                                                            <items>\n                                                                <menuItem title=\"Paragraph\" enabled=\"NO\" id=\"ZvO-Gk-QUH\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                </menuItem>\n                                                                <menuItem id=\"YGs-j5-SAR\">\n                                                                    <string key=\"title\">\tDefault</string>\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"makeBaseWritingDirectionNatural:\" target=\"Ady-hI-5gd\" id=\"qtV-5e-UBP\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem id=\"Lbh-J2-qVU\">\n                                                                    <string key=\"title\">\tLeft to Right</string>\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"makeBaseWritingDirectionLeftToRight:\" target=\"Ady-hI-5gd\" id=\"S0X-9S-QSf\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem id=\"jFq-tB-4Kx\">\n                                                                    <string key=\"title\">\tRight to Left</string>\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"makeBaseWritingDirectionRightToLeft:\" target=\"Ady-hI-5gd\" id=\"5fk-qB-AqJ\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem isSeparatorItem=\"YES\" id=\"swp-gr-a21\"/>\n                                                                <menuItem title=\"Selection\" enabled=\"NO\" id=\"cqv-fj-IhA\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                </menuItem>\n                                                                <menuItem id=\"Nop-cj-93Q\">\n                                                                    <string key=\"title\">\tDefault</string>\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"makeTextWritingDirectionNatural:\" target=\"Ady-hI-5gd\" id=\"lPI-Se-ZHp\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem id=\"BgM-ve-c93\">\n                                                                    <string key=\"title\">\tLeft to Right</string>\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"makeTextWritingDirectionLeftToRight:\" target=\"Ady-hI-5gd\" id=\"caW-Bv-w94\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem id=\"RB4-Sm-HuC\">\n                                                                    <string key=\"title\">\tRight to Left</string>\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"makeTextWritingDirectionRightToLeft:\" target=\"Ady-hI-5gd\" id=\"EXD-6r-ZUu\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                            </items>\n                                                        </menu>\n                                                    </menuItem>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"fKy-g9-1gm\"/>\n                                                    <menuItem title=\"Show Ruler\" id=\"vLm-3I-IUL\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleRuler:\" target=\"Ady-hI-5gd\" id=\"FOx-HJ-KwY\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Copy Ruler\" keyEquivalent=\"c\" id=\"MkV-Pr-PK5\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\" control=\"YES\" command=\"YES\"/>\n                                                        <connections>\n                                                            <action selector=\"copyRuler:\" target=\"Ady-hI-5gd\" id=\"71i-fW-3W2\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Paste Ruler\" keyEquivalent=\"v\" id=\"LVM-kO-fVI\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\" control=\"YES\" command=\"YES\"/>\n                                                        <connections>\n                                                            <action selector=\"pasteRuler:\" target=\"Ady-hI-5gd\" id=\"cSh-wd-qM2\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                    </items>\n                                </menu>\n                            </menuItem>\n                            <menuItem title=\"View\" id=\"H8h-7b-M4v\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <menu key=\"submenu\" title=\"View\" id=\"HyV-fh-RgO\">\n                                    <items>\n                                        <menuItem title=\"Show Toolbar\" keyEquivalent=\"t\" id=\"snW-S8-Cw5\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\" option=\"YES\" command=\"YES\"/>\n                                            <connections>\n                                                <action selector=\"toggleToolbarShown:\" target=\"Ady-hI-5gd\" id=\"BXY-wc-z0C\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Customize Toolbar…\" id=\"1UK-8n-QPP\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <connections>\n                                                <action selector=\"runToolbarCustomizationPalette:\" target=\"Ady-hI-5gd\" id=\"pQI-g3-MTW\"/>\n                                            </connections>\n                                        </menuItem>\n                                    </items>\n                                </menu>\n                            </menuItem>\n                            <menuItem title=\"Window\" id=\"aUF-d1-5bR\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <menu key=\"submenu\" title=\"Window\" systemMenu=\"window\" id=\"Td7-aD-5lo\">\n                                    <items>\n                                        <menuItem title=\"Minimize\" keyEquivalent=\"m\" id=\"OY7-WF-poV\">\n                                            <connections>\n                                                <action selector=\"performMiniaturize:\" target=\"Ady-hI-5gd\" id=\"VwT-WD-YPe\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Zoom\" id=\"R4o-n2-Eq4\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <connections>\n                                                <action selector=\"performZoom:\" target=\"Ady-hI-5gd\" id=\"DIl-cC-cCs\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"eu3-7i-yIM\"/>\n                                        <menuItem title=\"Bring All to Front\" id=\"LE2-aR-0XJ\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <connections>\n                                                <action selector=\"arrangeInFront:\" target=\"Ady-hI-5gd\" id=\"DRN-fu-gQh\"/>\n                                            </connections>\n                                        </menuItem>\n                                    </items>\n                                </menu>\n                            </menuItem>\n                            <menuItem title=\"Help\" id=\"wpr-3q-Mcd\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <menu key=\"submenu\" title=\"Help\" systemMenu=\"help\" id=\"F2S-fz-NVQ\">\n                                    <items>\n                                        <menuItem title=\"JWTDesktop Help\" keyEquivalent=\"?\" id=\"FKE-Sm-Kum\">\n                                            <connections>\n                                                <action selector=\"showHelp:\" target=\"Ady-hI-5gd\" id=\"y7X-2Q-9no\"/>\n                                            </connections>\n                                        </menuItem>\n                                    </items>\n                                </menu>\n                            </menuItem>\n                        </items>\n                    </menu>\n                    <connections>\n                        <outlet property=\"delegate\" destination=\"Voe-Tx-rLC\" id=\"PrD-fu-P6m\"/>\n                    </connections>\n                </application>\n                <customObject id=\"Voe-Tx-rLC\" customClass=\"AppDelegate\"/>\n                <customObject id=\"Ady-hI-5gd\" userLabel=\"First Responder\" customClass=\"NSResponder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"75\" y=\"0.0\"/>\n        </scene>\n        <!--Window Controller-->\n        <scene sceneID=\"R2V-B0-nI4\">\n            <objects>\n                <windowController id=\"B8D-0N-5wS\" sceneMemberID=\"viewController\">\n                    <window key=\"window\" title=\"Window\" allowsToolTipsWhenApplicationIsInactive=\"NO\" autorecalculatesKeyViewLoop=\"NO\" releasedWhenClosed=\"NO\" visibleAtLaunch=\"NO\" animationBehavior=\"default\" id=\"IQv-IB-iLA\">\n                        <windowStyleMask key=\"styleMask\" titled=\"YES\" closable=\"YES\" miniaturizable=\"YES\" resizable=\"YES\"/>\n                        <windowPositionMask key=\"initialPositionMask\" leftStrut=\"YES\" rightStrut=\"YES\" topStrut=\"YES\" bottomStrut=\"YES\"/>\n                        <rect key=\"contentRect\" x=\"196\" y=\"240\" width=\"1200\" height=\"700\"/>\n                        <rect key=\"screenRect\" x=\"0.0\" y=\"0.0\" width=\"1680\" height=\"1027\"/>\n                        <value key=\"minSize\" type=\"size\" width=\"1200\" height=\"700\"/>\n                        <connections>\n                            <outlet property=\"delegate\" destination=\"B8D-0N-5wS\" id=\"aef-aY-oqt\"/>\n                        </connections>\n                    </window>\n                    <connections>\n                        <segue destination=\"XfG-lQ-9wD\" kind=\"relationship\" relationship=\"window.shadowedContentViewController\" id=\"cq2-FE-JQM\"/>\n                    </connections>\n                </windowController>\n                <customObject id=\"Oky-zY-oP4\" userLabel=\"First Responder\" customClass=\"NSResponder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"75\" y=\"250\"/>\n        </scene>\n        <!--View Controller-->\n        <scene sceneID=\"hIz-AP-VOD\">\n            <objects>\n                <viewController id=\"XfG-lQ-9wD\" customClass=\"ViewController\" sceneMemberID=\"viewController\">\n                    <view key=\"view\" id=\"m2S-Jp-Qdl\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"419\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                        <subviews>\n                            <textField horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"750\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"D7O-XY-wd0\" userLabel=\"AlgorithmLabel\">\n                                <rect key=\"frame\" x=\"200\" y=\"372\" width=\"42\" height=\"17\"/>\n                                <constraints>\n                                    <constraint firstAttribute=\"height\" constant=\"17\" id=\"ogT-iD-x9z\"/>\n                                </constraints>\n                                <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" sendsActionOnEndEditing=\"YES\" title=\"Label\" id=\"Mqt-PB-Gyr\">\n                                    <font key=\"font\" metaFont=\"system\" size=\"15\"/>\n                                    <color key=\"textColor\" name=\"labelColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                </textFieldCell>\n                            </textField>\n                            <popUpButton verticalHuggingPriority=\"750\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"yLZ-Ur-huV\" userLabel=\"AlgorithmPopUpButton\">\n                                <rect key=\"frame\" x=\"245\" y=\"367\" width=\"78\" height=\"25\"/>\n                                <popUpButtonCell key=\"cell\" type=\"push\" title=\"Item 1\" bezelStyle=\"rounded\" alignment=\"left\" lineBreakMode=\"truncatingTail\" state=\"on\" borderStyle=\"borderAndBezel\" imageScaling=\"proportionallyDown\" inset=\"2\" selectedItem=\"ZCZ-l0-XGK\" id=\"MuX-3E-XCZ\">\n                                    <behavior key=\"behavior\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                                    <font key=\"font\" metaFont=\"menu\"/>\n                                    <menu key=\"menu\" id=\"tac-Di-AVm\">\n                                        <items>\n                                            <menuItem title=\"Item 1\" state=\"on\" id=\"ZCZ-l0-XGK\"/>\n                                            <menuItem title=\"Item 2\" id=\"vFH-Hr-A7D\"/>\n                                            <menuItem title=\"Item 3\" id=\"Lh6-h4-7w2\"/>\n                                        </items>\n                                    </menu>\n                                </popUpButtonCell>\n                            </popUpButton>\n                            <scrollView horizontalLineScroll=\"10\" horizontalPageScroll=\"10\" verticalLineScroll=\"10\" verticalPageScroll=\"10\" hasHorizontalScroller=\"NO\" usesPredominantAxisScrolling=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"vXl-0B-yeH\" userLabel=\"EncodedTextView\">\n                                <rect key=\"frame\" x=\"0.0\" y=\"60\" width=\"240\" height=\"214\"/>\n                                <clipView key=\"contentView\" drawsBackground=\"NO\" id=\"R7p-T4-mLk\">\n                                    <rect key=\"frame\" x=\"1\" y=\"1\" width=\"223\" height=\"212\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                    <subviews>\n                                        <textView importsGraphics=\"NO\" verticallyResizable=\"YES\" usesFontPanel=\"YES\" findStyle=\"panel\" continuousSpellChecking=\"YES\" allowsUndo=\"YES\" usesRuler=\"YES\" allowsNonContiguousLayout=\"YES\" quoteSubstitution=\"YES\" dashSubstitution=\"YES\" spellingCorrection=\"YES\" smartInsertDelete=\"YES\" id=\"RyK-m8-XF3\">\n                                            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"223\" height=\"212\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                            <color key=\"textColor\" name=\"textColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                            <color key=\"backgroundColor\" name=\"textBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                            <size key=\"minSize\" width=\"223\" height=\"212\"/>\n                                            <size key=\"maxSize\" width=\"463\" height=\"10000000\"/>\n                                            <color key=\"insertionPointColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        </textView>\n                                    </subviews>\n                                </clipView>\n                                <scroller key=\"horizontalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" doubleValue=\"1\" horizontal=\"YES\" id=\"SoX-cs-HKu\">\n                                    <rect key=\"frame\" x=\"-100\" y=\"-100\" width=\"87\" height=\"18\"/>\n                                    <autoresizingMask key=\"autoresizingMask\"/>\n                                </scroller>\n                                <scroller key=\"verticalScroller\" verticalHuggingPriority=\"750\" horizontal=\"NO\" id=\"zi3-uo-nJE\">\n                                    <rect key=\"frame\" x=\"224\" y=\"1\" width=\"15\" height=\"212\"/>\n                                    <autoresizingMask key=\"autoresizingMask\"/>\n                                </scroller>\n                            </scrollView>\n                            <textField horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"750\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"z9r-5V-pdS\" userLabel=\"SignatureStatusLabel\">\n                                <rect key=\"frame\" x=\"-2\" y=\"0.0\" width=\"484\" height=\"42\"/>\n                                <constraints>\n                                    <constraint firstAttribute=\"height\" constant=\"42\" id=\"6dl-ZT-MyL\"/>\n                                </constraints>\n                                <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" sendsActionOnEndEditing=\"YES\" title=\"Label\" id=\"VyQ-In-KTB\">\n                                    <font key=\"font\" metaFont=\"system\" size=\"20\"/>\n                                    <color key=\"textColor\" name=\"labelColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                </textFieldCell>\n                            </textField>\n                            <customView translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"onc-Qp-bvF\" userLabel=\"DecriptedView\">\n                                <rect key=\"frame\" x=\"240\" y=\"60\" width=\"240\" height=\"214\"/>\n                            </customView>\n                            <scrollView hidden=\"YES\" autohidesScrollers=\"YES\" horizontalLineScroll=\"19\" horizontalPageScroll=\"10\" verticalLineScroll=\"19\" verticalPageScroll=\"10\" usesPredominantAxisScrolling=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"YfF-j3-Hxy\">\n                                <rect key=\"frame\" x=\"240\" y=\"60\" width=\"240\" height=\"214\"/>\n                                <clipView key=\"contentView\" id=\"EN9-WY-TeV\">\n                                    <rect key=\"frame\" x=\"1\" y=\"1\" width=\"238\" height=\"212\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                    <subviews>\n                                        <tableView verticalHuggingPriority=\"750\" allowsExpansionToolTips=\"YES\" columnAutoresizingStyle=\"lastColumnOnly\" columnSelection=\"YES\" multipleSelection=\"NO\" autosaveColumns=\"NO\" rowSizeStyle=\"automatic\" headerView=\"XGD-yA-t3I\" viewBased=\"YES\" id=\"k0L-7X-cJD\">\n                                            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"238\" height=\"189\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                            <size key=\"intercellSpacing\" width=\"3\" height=\"2\"/>\n                                            <color key=\"backgroundColor\" name=\"controlBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                            <color key=\"gridColor\" name=\"gridColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                            <tableColumns>\n                                                <tableColumn width=\"116\" minWidth=\"40\" maxWidth=\"1000\" id=\"LUu-TS-BnO\">\n                                                    <tableHeaderCell key=\"headerCell\" lineBreakMode=\"truncatingTail\" borderStyle=\"border\">\n                                                        <color key=\"textColor\" name=\"headerTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        <color key=\"backgroundColor\" name=\"headerColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                    </tableHeaderCell>\n                                                    <textFieldCell key=\"dataCell\" lineBreakMode=\"truncatingTail\" selectable=\"YES\" editable=\"YES\" title=\"Text Cell\" id=\"zVw-sn-xsB\">\n                                                        <font key=\"font\" metaFont=\"system\"/>\n                                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        <color key=\"backgroundColor\" name=\"controlBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                    </textFieldCell>\n                                                    <tableColumnResizingMask key=\"resizingMask\" resizeWithTable=\"YES\" userResizable=\"YES\"/>\n                                                    <prototypeCellViews>\n                                                        <tableCellView id=\"Ndj-Sw-gih\">\n                                                            <rect key=\"frame\" x=\"1\" y=\"1\" width=\"121\" height=\"17\"/>\n                                                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                                            <subviews>\n                                                                <textField verticalHuggingPriority=\"750\" horizontalCompressionResistancePriority=\"250\" fixedFrame=\"YES\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"ECA-No-Hn9\">\n                                                                    <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"100\" height=\"17\"/>\n                                                                    <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                                                    <textFieldCell key=\"cell\" lineBreakMode=\"truncatingTail\" sendsActionOnEndEditing=\"YES\" title=\"Table View Cell\" id=\"ZpF-cY-Xm5\">\n                                                                        <font key=\"font\" metaFont=\"system\"/>\n                                                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                                    </textFieldCell>\n                                                                </textField>\n                                                            </subviews>\n                                                            <connections>\n                                                                <outlet property=\"textField\" destination=\"ECA-No-Hn9\" id=\"osv-Pt-m98\"/>\n                                                            </connections>\n                                                        </tableCellView>\n                                                    </prototypeCellViews>\n                                                </tableColumn>\n                                                <tableColumn width=\"107\" minWidth=\"40\" maxWidth=\"1000\" id=\"57l-wv-6gg\">\n                                                    <tableHeaderCell key=\"headerCell\" lineBreakMode=\"truncatingTail\" borderStyle=\"border\">\n                                                        <color key=\"textColor\" name=\"headerTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        <color key=\"backgroundColor\" name=\"headerColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                    </tableHeaderCell>\n                                                    <textFieldCell key=\"dataCell\" lineBreakMode=\"truncatingTail\" selectable=\"YES\" editable=\"YES\" title=\"Text Cell\" id=\"pzs-PF-w82\">\n                                                        <font key=\"font\" metaFont=\"system\"/>\n                                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        <color key=\"backgroundColor\" name=\"controlBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                    </textFieldCell>\n                                                    <tableColumnResizingMask key=\"resizingMask\" resizeWithTable=\"YES\" userResizable=\"YES\"/>\n                                                    <prototypeCellViews>\n                                                        <tableCellView id=\"VaR-Ux-pdL\">\n                                                            <rect key=\"frame\" x=\"125\" y=\"1\" width=\"111\" height=\"17\"/>\n                                                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                                            <subviews>\n                                                                <textField verticalHuggingPriority=\"750\" horizontalCompressionResistancePriority=\"250\" fixedFrame=\"YES\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"M6U-vg-KMX\">\n                                                                    <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"100\" height=\"17\"/>\n                                                                    <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                                                    <textFieldCell key=\"cell\" lineBreakMode=\"truncatingTail\" sendsActionOnEndEditing=\"YES\" title=\"Table View Cell\" id=\"Thw-Ot-bJy\">\n                                                                        <font key=\"font\" metaFont=\"system\"/>\n                                                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                                    </textFieldCell>\n                                                                </textField>\n                                                            </subviews>\n                                                            <connections>\n                                                                <outlet property=\"textField\" destination=\"M6U-vg-KMX\" id=\"RwW-7Y-Ysb\"/>\n                                                            </connections>\n                                                        </tableCellView>\n                                                    </prototypeCellViews>\n                                                </tableColumn>\n                                            </tableColumns>\n                                        </tableView>\n                                    </subviews>\n                                </clipView>\n                                <scroller key=\"horizontalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" horizontal=\"YES\" id=\"ZeW-jA-PoF\">\n                                    <rect key=\"frame\" x=\"1\" y=\"403\" width=\"0.0\" height=\"15\"/>\n                                    <autoresizingMask key=\"autoresizingMask\"/>\n                                </scroller>\n                                <scroller key=\"verticalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" horizontal=\"NO\" id=\"HyQ-Zd-Vdq\">\n                                    <rect key=\"frame\" x=\"224\" y=\"17\" width=\"15\" height=\"102\"/>\n                                    <autoresizingMask key=\"autoresizingMask\"/>\n                                </scroller>\n                                <tableHeaderView key=\"headerView\" wantsLayer=\"YES\" id=\"XGD-yA-t3I\">\n                                    <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"238\" height=\"23\"/>\n                                    <autoresizingMask key=\"autoresizingMask\"/>\n                                </tableHeaderView>\n                            </scrollView>\n                            <textField horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"750\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"r3U-FI-Ege\" userLabel=\"SecretLabel\">\n                                <rect key=\"frame\" x=\"200\" y=\"333\" width=\"42\" height=\"19\"/>\n                                <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" sendsActionOnEndEditing=\"YES\" title=\"Label\" id=\"fQG-yn-1WT\">\n                                    <font key=\"font\" metaFont=\"system\" size=\"15\"/>\n                                    <color key=\"textColor\" name=\"labelColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                </textFieldCell>\n                            </textField>\n                            <textField verticalHuggingPriority=\"750\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"BTt-D8-1HI\" userLabel=\"SecretTextField\">\n                                <rect key=\"frame\" x=\"248\" y=\"332\" width=\"96\" height=\"21\"/>\n                                <constraints>\n                                    <constraint firstAttribute=\"width\" constant=\"96\" id=\"s60-lV-Tu8\"/>\n                                </constraints>\n                                <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" selectable=\"YES\" editable=\"YES\" sendsActionOnEndEditing=\"YES\" state=\"on\" borderStyle=\"bezel\" drawsBackground=\"YES\" id=\"Bvo-u9-SsL\">\n                                    <font key=\"font\" metaFont=\"system\"/>\n                                    <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    <color key=\"backgroundColor\" name=\"textBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                </textFieldCell>\n                            </textField>\n                            <button translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"Keu-Ro-sxF\" userLabel=\"SecretBase64EncodedCheckButton\">\n                                <rect key=\"frame\" x=\"350\" y=\"334\" width=\"65\" height=\"18\"/>\n                                <buttonCell key=\"cell\" type=\"check\" title=\"Check\" bezelStyle=\"regularSquare\" imagePosition=\"left\" state=\"on\" inset=\"2\" id=\"Gz5-wv-UKC\">\n                                    <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                    <font key=\"font\" metaFont=\"system\"/>\n                                </buttonCell>\n                            </button>\n                            <button verticalHuggingPriority=\"750\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"hHo-Z6-vG4\">\n                                <rect key=\"frame\" x=\"246\" y=\"295\" width=\"65\" height=\"18\"/>\n                                <buttonCell key=\"cell\" type=\"check\" title=\"Check\" bezelStyle=\"regularSquare\" imagePosition=\"left\" state=\"on\" inset=\"2\" id=\"EV4-dK-pUy\">\n                                    <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                    <font key=\"font\" metaFont=\"system\"/>\n                                </buttonCell>\n                            </button>\n                            <textField horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"750\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"aAy-qn-Th9\" userLabel=\"SecretLabel\">\n                                <rect key=\"frame\" x=\"200\" y=\"294\" width=\"42\" height=\"19\"/>\n                                <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" sendsActionOnEndEditing=\"YES\" title=\"Label\" id=\"p8g-IV-fjY\">\n                                    <font key=\"font\" metaFont=\"system\" size=\"15\"/>\n                                    <color key=\"textColor\" name=\"labelColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                </textFieldCell>\n                            </textField>\n                        </subviews>\n                        <constraints>\n                            <constraint firstItem=\"onc-Qp-bvF\" firstAttribute=\"bottom\" secondItem=\"vXl-0B-yeH\" secondAttribute=\"bottom\" id=\"0HY-I0-wEK\"/>\n                            <constraint firstItem=\"r3U-FI-Ege\" firstAttribute=\"top\" secondItem=\"D7O-XY-wd0\" secondAttribute=\"bottom\" constant=\"20\" id=\"1Qf-Ce-W8e\"/>\n                            <constraint firstItem=\"vXl-0B-yeH\" firstAttribute=\"width\" secondItem=\"m2S-Jp-Qdl\" secondAttribute=\"width\" multiplier=\"0.5\" id=\"3Dn-kb-PNS\"/>\n                            <constraint firstItem=\"z9r-5V-pdS\" firstAttribute=\"leading\" secondItem=\"m2S-Jp-Qdl\" secondAttribute=\"leading\" id=\"494-o1-g5h\"/>\n                            <constraint firstItem=\"r3U-FI-Ege\" firstAttribute=\"trailing\" secondItem=\"D7O-XY-wd0\" secondAttribute=\"trailing\" id=\"EIi-q3-9Wt\"/>\n                            <constraint firstAttribute=\"trailing\" secondItem=\"z9r-5V-pdS\" secondAttribute=\"trailing\" id=\"JXb-Wb-ogn\"/>\n                            <constraint firstItem=\"YfF-j3-Hxy\" firstAttribute=\"width\" secondItem=\"m2S-Jp-Qdl\" secondAttribute=\"width\" multiplier=\"0.5\" id=\"LZE-Uu-4nJ\"/>\n                            <constraint firstItem=\"vXl-0B-yeH\" firstAttribute=\"top\" secondItem=\"aAy-qn-Th9\" secondAttribute=\"bottom\" constant=\"20\" id=\"NvW-rU-RUb\"/>\n                            <constraint firstItem=\"aAy-qn-Th9\" firstAttribute=\"trailing\" secondItem=\"r3U-FI-Ege\" secondAttribute=\"trailing\" id=\"O2p-ba-IzE\"/>\n                            <constraint firstItem=\"yLZ-Ur-huV\" firstAttribute=\"leading\" secondItem=\"D7O-XY-wd0\" secondAttribute=\"trailing\" constant=\"8\" id=\"Vkp-E6-cas\"/>\n                            <constraint firstItem=\"vXl-0B-yeH\" firstAttribute=\"leading\" secondItem=\"m2S-Jp-Qdl\" secondAttribute=\"leading\" id=\"WNg-2P-bo9\"/>\n                            <constraint firstAttribute=\"bottom\" secondItem=\"z9r-5V-pdS\" secondAttribute=\"bottom\" id=\"Xhx-2U-thk\"/>\n                            <constraint firstItem=\"onc-Qp-bvF\" firstAttribute=\"top\" secondItem=\"vXl-0B-yeH\" secondAttribute=\"top\" id=\"Ziw-za-CvC\"/>\n                            <constraint firstItem=\"aAy-qn-Th9\" firstAttribute=\"centerY\" secondItem=\"hHo-Z6-vG4\" secondAttribute=\"centerY\" id=\"ajs-pE-Qpb\"/>\n                            <constraint firstItem=\"aAy-qn-Th9\" firstAttribute=\"top\" secondItem=\"r3U-FI-Ege\" secondAttribute=\"bottom\" constant=\"20\" id=\"fJy-4P-4fw\"/>\n                            <constraint firstItem=\"BTt-D8-1HI\" firstAttribute=\"centerY\" secondItem=\"r3U-FI-Ege\" secondAttribute=\"centerY\" id=\"fjf-QS-OxH\"/>\n                            <constraint firstItem=\"YfF-j3-Hxy\" firstAttribute=\"top\" secondItem=\"vXl-0B-yeH\" secondAttribute=\"top\" id=\"g8n-YR-4sW\"/>\n                            <constraint firstItem=\"yLZ-Ur-huV\" firstAttribute=\"centerY\" secondItem=\"D7O-XY-wd0\" secondAttribute=\"centerY\" id=\"lAI-mA-w2k\"/>\n                            <constraint firstItem=\"BTt-D8-1HI\" firstAttribute=\"leading\" secondItem=\"r3U-FI-Ege\" secondAttribute=\"trailing\" constant=\"8\" id=\"lG2-WC-bz8\"/>\n                            <constraint firstItem=\"YfF-j3-Hxy\" firstAttribute=\"bottom\" secondItem=\"vXl-0B-yeH\" secondAttribute=\"bottom\" id=\"mIQ-YL-mwL\"/>\n                            <constraint firstItem=\"z9r-5V-pdS\" firstAttribute=\"top\" secondItem=\"vXl-0B-yeH\" secondAttribute=\"bottom\" constant=\"18\" id=\"oca-GD-oG2\"/>\n                            <constraint firstItem=\"Keu-Ro-sxF\" firstAttribute=\"leading\" secondItem=\"BTt-D8-1HI\" secondAttribute=\"trailing\" constant=\"8\" id=\"pXk-7F-X4I\"/>\n                            <constraint firstItem=\"Keu-Ro-sxF\" firstAttribute=\"centerY\" secondItem=\"BTt-D8-1HI\" secondAttribute=\"centerY\" id=\"qbF-2d-lJ7\"/>\n                            <constraint firstItem=\"D7O-XY-wd0\" firstAttribute=\"trailing\" secondItem=\"vXl-0B-yeH\" secondAttribute=\"trailing\" id=\"rjF-97-w5U\"/>\n                            <constraint firstItem=\"hHo-Z6-vG4\" firstAttribute=\"leading\" secondItem=\"aAy-qn-Th9\" secondAttribute=\"trailing\" constant=\"8\" id=\"sk8-3o-le0\"/>\n                            <constraint firstItem=\"onc-Qp-bvF\" firstAttribute=\"width\" secondItem=\"m2S-Jp-Qdl\" secondAttribute=\"width\" multiplier=\"0.5\" id=\"tPn-hi-t4X\"/>\n                            <constraint firstItem=\"D7O-XY-wd0\" firstAttribute=\"top\" secondItem=\"m2S-Jp-Qdl\" secondAttribute=\"top\" constant=\"30\" id=\"uuY-0O-dAg\"/>\n                            <constraint firstAttribute=\"trailing\" secondItem=\"YfF-j3-Hxy\" secondAttribute=\"trailing\" id=\"wyt-Tf-7aH\"/>\n                            <constraint firstAttribute=\"trailing\" secondItem=\"onc-Qp-bvF\" secondAttribute=\"trailing\" id=\"zLM-Zt-oqT\"/>\n                        </constraints>\n                    </view>\n                    <connections>\n                        <outlet property=\"algorithmLabel\" destination=\"D7O-XY-wd0\" id=\"1ue-3n-vwa\"/>\n                        <outlet property=\"algorithmPopUpButton\" destination=\"yLZ-Ur-huV\" id=\"EQM-5o-5aG\"/>\n                        <outlet property=\"decodedTableView\" destination=\"k0L-7X-cJD\" id=\"xYU-YU-Cqr\"/>\n                        <outlet property=\"decriptedView\" destination=\"onc-Qp-bvF\" id=\"OGU-wc-0es\"/>\n                        <outlet property=\"encodedTextView\" destination=\"RyK-m8-XF3\" id=\"d26-Oy-Vfp\"/>\n                        <outlet property=\"secretIsBase64EncodedCheckButton\" destination=\"Keu-Ro-sxF\" id=\"tt7-ed-K8b\"/>\n                        <outlet property=\"secretLabel\" destination=\"r3U-FI-Ege\" id=\"QLn-bc-q86\"/>\n                        <outlet property=\"secretTextField\" destination=\"BTt-D8-1HI\" id=\"dpP-AC-fcK\"/>\n                        <outlet property=\"signatureLabel\" destination=\"aAy-qn-Th9\" id=\"Unh-fc-8fV\"/>\n                        <outlet property=\"signatureStatusLabel\" destination=\"z9r-5V-pdS\" id=\"TG0-L5-4mT\"/>\n                        <outlet property=\"signatureVerificationCheckButton\" destination=\"hHo-Z6-vG4\" id=\"rwD-7l-L6q\"/>\n                    </connections>\n                </viewController>\n                <customObject id=\"rPt-NT-nkU\" userLabel=\"First Responder\" customClass=\"NSResponder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"75\" y=\"729.5\"/>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIconFile</key>\n\t<string></string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSMinimumSystemVersion</key>\n\t<string>$(MACOSX_DEPLOYMENT_TARGET)</string>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>Copyright © 2016 JWT. All rights reserved.</string>\n\t<key>NSMainStoryboardFile</key>\n\t<string>Main</string>\n\t<key>NSPrincipalClass</key>\n\t<string>NSApplication</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/JWTDecriptedCollectionViewItem.h",
    "content": "//\n//  JWTDecriptedCollectionViewItem.h\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 25.09.16.\n//  Copyright © 2016 JWT. All rights reserved.\n//\n\n#import <Cocoa/Cocoa.h>\n\n@interface JWTDecriptedCollectionViewItem : NSCollectionViewItem\n\n- (void)updateWithText:(NSString *)text;\n- (void)updateWithTextColor:(NSColor *)color;\n+ (NSFont *)defaultFont;\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/JWTDecriptedCollectionViewItem.m",
    "content": "//\n//  JWTDecriptedCollectionViewItem.m\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 25.09.16.\n//  Copyright © 2016 JWT. All rights reserved.\n//\n\n#import \"JWTDecriptedCollectionViewItem.h\"\n\n@interface JWTDecriptedCollectionViewItem ()\n@property (unsafe_unretained) IBOutlet NSTextView *textView;\n\n@end\n\n@implementation JWTDecriptedCollectionViewItem\n\n- (void)updateWithText:(NSString *)text {\n    self.textView.string = text;\n}\n\n- (void)updateWithTextColor:(NSColor *)color {\n    self.textView.textColor = color;\n}\n\n- (void)viewDidLoad {\n    [super viewDidLoad];\n    self.textView.font = [self.class defaultFont];\n    // Do view setup here.\n}\n\n+ (NSFont *)defaultFont {\n    return [NSFont boldSystemFontOfSize:14];\n}\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/JWTDecriptedCollectionViewItem.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.Cocoa.XIB\" version=\"3.0\" toolsVersion=\"11201\" systemVersion=\"16A323\" targetRuntime=\"MacOSX.Cocoa\" propertyAccessControl=\"none\" useAutolayout=\"YES\" customObjectInstantitationMethod=\"direct\">\n    <dependencies>\n        <deployment identifier=\"macosx\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.CocoaPlugin\" version=\"11201\"/>\n    </dependencies>\n    <objects>\n        <customObject id=\"-2\" userLabel=\"File's Owner\" customClass=\"JWTDecriptedCollectionViewItem\">\n            <connections>\n                <outlet property=\"textView\" destination=\"i9Y-Iw-i8t\" id=\"d8h-28-2Lq\"/>\n                <outlet property=\"view\" destination=\"Hz6-mo-xeY\" id=\"0bl-1N-x8E\"/>\n            </connections>\n        </customObject>\n        <customObject id=\"-1\" userLabel=\"First Responder\" customClass=\"FirstResponder\"/>\n        <customObject id=\"-3\" userLabel=\"Application\" customClass=\"NSObject\"/>\n        <customView id=\"Hz6-mo-xeY\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"272\"/>\n            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n            <subviews>\n                <scrollView horizontalLineScroll=\"10\" horizontalPageScroll=\"10\" verticalLineScroll=\"10\" verticalPageScroll=\"10\" hasHorizontalScroller=\"NO\" usesPredominantAxisScrolling=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"dM4-Vi-CAL\">\n                    <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"272\"/>\n                    <clipView key=\"contentView\" id=\"lrE-qz-q1N\">\n                        <rect key=\"frame\" x=\"1\" y=\"1\" width=\"463\" height=\"270\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <subviews>\n                            <textView importsGraphics=\"NO\" usesFontPanel=\"YES\" findStyle=\"panel\" continuousSpellChecking=\"YES\" allowsUndo=\"YES\" usesRuler=\"YES\" allowsNonContiguousLayout=\"YES\" quoteSubstitution=\"YES\" dashSubstitution=\"YES\" spellingCorrection=\"YES\" smartInsertDelete=\"YES\" id=\"i9Y-Iw-i8t\">\n                                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"463\" height=\"270\"/>\n                                <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                                <size key=\"minSize\" width=\"463\" height=\"270\"/>\n                                <size key=\"maxSize\" width=\"463\" height=\"10000000\"/>\n                                <color key=\"insertionPointColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                            </textView>\n                        </subviews>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    </clipView>\n                    <scroller key=\"horizontalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" doubleValue=\"1\" horizontal=\"YES\" id=\"Pmr-2V-7m1\">\n                        <rect key=\"frame\" x=\"-100\" y=\"-100\" width=\"87\" height=\"18\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                    </scroller>\n                    <scroller key=\"verticalScroller\" verticalHuggingPriority=\"750\" doubleValue=\"1\" horizontal=\"NO\" id=\"zk4-hr-bjg\">\n                        <rect key=\"frame\" x=\"464\" y=\"1\" width=\"15\" height=\"270\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                    </scroller>\n                </scrollView>\n            </subviews>\n            <constraints>\n                <constraint firstItem=\"dM4-Vi-CAL\" firstAttribute=\"leading\" secondItem=\"Hz6-mo-xeY\" secondAttribute=\"leading\" id=\"7wm-ca-hSR\"/>\n                <constraint firstAttribute=\"trailing\" secondItem=\"dM4-Vi-CAL\" secondAttribute=\"trailing\" id=\"gmh-Ft-0ot\"/>\n                <constraint firstAttribute=\"bottom\" secondItem=\"dM4-Vi-CAL\" secondAttribute=\"bottom\" id=\"kJd-T3-rsJ\"/>\n                <constraint firstItem=\"dM4-Vi-CAL\" firstAttribute=\"top\" secondItem=\"Hz6-mo-xeY\" secondAttribute=\"top\" id=\"xkw-5U-Pg1\"/>\n            </constraints>\n        </customView>\n    </objects>\n</document>\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/JWTDecriptedViewController.h",
    "content": "//\n//  JWTDecriptedViewController.h\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 25.09.16.\n//  Copyright © 2016 JWT. All rights reserved.\n//\n\n@import Cocoa;\n@import JWT;\n\n@interface JWTDecriptedViewController : NSViewController\n\n@property (strong, nonatomic, readwrite) JWTBuilder *builder;\n@property (strong, nonatomic, readwrite) JWTCodingResultType *resultType;\n\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/JWTDecriptedViewController.m",
    "content": "//\n//  JWTDecriptedViewController.m\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 25.09.16.\n//  Copyright © 2016 JWT. All rights reserved.\n//\n\n#import \"JWTDecriptedViewController.h\"\n#import \"JWTDecriptedCollectionViewItem.h\"\n#import \"JWTTokenTextTypeDescription.h\"\n\n@interface JWTDecriptedViewController ()\n@property (weak) IBOutlet NSCollectionView *collectionView;\n@property (copy, nonatomic, readwrite) NSString *collectionViewItemIdentifier;\n@property (strong, nonatomic, readwrite) NSArray *cachedResultArray;\n@property (strong, nonatomic, readwrite) NSDictionary *cachedErrorDictionary;\n@property (assign, nonatomic, readwrite) NSInteger countOfRows;\n\n@property (strong, nonatomic, readwrite) JWTTokenTextTypeDescription *tokenDescription;\n@end\n\n@interface JWTDecriptedViewController (NSCollectionViewDelegateFlowLayout)<NSCollectionViewDelegateFlowLayout>\n@end\n\n@interface JWTDecriptedViewController (NSCollectionViewDataSource)<NSCollectionViewDataSource>\n@end\n\n@implementation JWTDecriptedViewController\n\n- (void)setupUIElements {\n    self.collectionView.delegate = self;\n    self.collectionView.dataSource = self;\n    self.collectionView.minItemSize = NSZeroSize;\n    self.collectionView.maxItemSize = NSZeroSize;\n    [self.collectionView registerClass:[JWTDecriptedCollectionViewItem class] forItemWithIdentifier:self.collectionViewItemIdentifier];\n}\n\n- (void)viewDidLoad {\n    [super viewDidLoad];\n    [self setupUIElements];\n    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reload) name:NSWindowDidResizeNotification object:nil];\n}\n- (void)reload {\n    [self reloadCollectionView];\n}\n- (void)reloadCollectionView {\n    [self.collectionView reloadData];\n}\n\n- (NSString *)jsonStringWithObject:(NSDictionary *)object {\n    if (object == nil) {\n        return @\"\";\n    }\n    \n    NSError *error = nil;\n    NSData *data = [NSJSONSerialization dataWithJSONObject:object options:NSJSONWritingPrettyPrinted error:&error];\n    if (error != nil) {\n        return @\"\";\n    }\n    \n    NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];\n    return string ?: @\"\";\n}\n\n- (void)reloadData {\n    self.cachedResultArray = nil;\n    self.cachedErrorDictionary = nil;\n    if (self.resultType) {\n        if (self.resultType.successResult) {\n            NSDictionary *result = self.resultType.successResult.headerAndPayloadDictionary;\n            __auto_type claimsSetStorage = self.resultType.successResult.claimsSetStorage;\n            __auto_type serializer = [JWTClaimsSetSerializerBase new];\n            serializer.skipClaimsProviderLookupCheck = YES;\n            NSDictionary *claims = [serializer dictionaryFromClaimsSet:claimsSetStorage];\n            self.cachedResultArray = @[\n                                       @{@\"header\" : result[JWTCodingResultComponents.headers] ?: @\"\"},\n                                       @{@\"payload\" : result[JWTCodingResultComponents.payload] ?: @\"\"},\n                                       @{@\"claimsSet\" : claims ?: @\"\"}\n                                       ];\n        }\n        else {\n            NSString *errorDescription = self.resultType.errorResult.error ? self.resultType.errorResult.error.localizedDescription : @\"UnknownError! Report about it!\";\n            self.cachedErrorDictionary = @{\n                                           @\"error\" : errorDescription\n                                           };\n        }\n    }\n    else {\n        NSDictionary *result = self.builder.decode;\n        if (self.builder.jwtError != nil) {\n            self.cachedErrorDictionary = @{\n                                           @\"error\" : self.builder.jwtError.localizedDescription\n                                           };\n        }\n        else if (result != nil) {\n            self.cachedResultArray =  @[\n                                        @{@\"header\" : result[@\"header\"] ?: @\"\"},\n                                        @{@\"payload\" : result[@\"payload\"] ?: @\"\"}\n                                        ];\n        }\n    }\n}\n\n- (NSInteger)countOfRows {\n    if (self.cachedErrorDictionary) {\n        return 1;\n    }\n    else if (self.cachedResultArray) {\n        return self.cachedResultArray.count;\n    }\n    else {\n        return 0;\n    }\n}\n\n- (NSString *)collectionViewItemIdentifier {\n    if (_collectionViewItemIdentifier == nil) {\n        _collectionViewItemIdentifier = NSStringFromClass([JWTDecriptedCollectionViewItem class]);\n    }\n    return _collectionViewItemIdentifier;\n}\n\n- (void)setBuilder:(JWTBuilder *)builder {\n    if (_builder != builder) {\n        _builder = builder;\n        [self reloadData];\n        [self reloadCollectionView];\n    }\n}\n\n- (void)setResultType:(JWTCodingResultType *)resultType {\n    if (_resultType != resultType) {\n        _resultType = resultType;\n        [self reloadData];\n        [self reloadCollectionView];\n    }\n}\n\n- (JWTTokenTextTypeDescription *)tokenDescription {\n    if (!_tokenDescription) {\n        _tokenDescription = [JWTTokenTextTypeDescription new];\n    }\n    return _tokenDescription;\n}\n\n#pragma mark - Collection Helpers.\n\n- (NSString *)textForItemAtIndexPath:(NSIndexPath *)path {\n    NSDictionary *itemResult = nil;\n    if (self.cachedErrorDictionary != nil) {\n        itemResult = self.cachedErrorDictionary;\n    }\n    else if(self.cachedResultArray != nil) {\n        itemResult = self.cachedResultArray[path.item];\n    }\n    NSString *text = [self jsonStringWithObject:itemResult];\n    return text;\n}\n\n- (NSColor *)colorWithIndexPath:(NSIndexPath *)path {\n    NSColor *color = nil;\n    if (self.cachedErrorDictionary) {\n        color = [self.tokenDescription colorForType:JWTTokenTextTypeHeader];\n    }\n    else if (self.cachedResultArray) {\n        JWTTokenTextType type = MAX(JWTTokenTextTypeDefault, MIN(path.item + 1, JWTTokenTextTypeSignature));\n        color = [self.tokenDescription colorForType:type];\n    }\n    return color;\n}\n\n\n@end\n\n@implementation JWTDecriptedViewController (NSCollectionViewDelegateFlowLayout)\n\n- (NSSize)sizeWithText:(NSString *)text withWidth:(NSInteger)width {\n    return NSZeroSize;\n}\n\n- (NSSize)collectionView:(NSCollectionView *)collectionView layout:(NSCollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {\n    \n    NSString *stringToDisplay = [self textForItemAtIndexPath:indexPath];\n    CGFloat width = collectionView.frame.size.width;//[[collectionView enclosingScrollView] bounds].size.width;\n    \n    NSRect estimatedSize = [stringToDisplay boundingRectWithSize:CGSizeMake(width, 10000) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{/*NSForegroundColorAttributeName : nil,*/ NSFontAttributeName : JWTDecriptedCollectionViewItem.defaultFont }];\n    \n    NSInteger height = estimatedSize.size.height;\n    \n    NSSize size = NSMakeSize(width, height);\n    return size;\n}\n\n@end\n\n@implementation JWTDecriptedViewController (NSCollectionViewDataSource)\n- (NSInteger)collectionView:(NSCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {\n    NSInteger count = self.countOfRows;\n    return count;\n}\n\n- (NSInteger)numberOfSectionsInCollectionView:(NSCollectionView *)collectionView {\n    return 1;\n}\n\n- (NSCollectionViewItem *)collectionView:(NSCollectionView *)collectionView itemForRepresentedObjectAtIndexPath:(NSIndexPath *)indexPath {\n    NSCollectionViewItem *item = [collectionView makeItemWithIdentifier:self.collectionViewItemIdentifier forIndexPath:indexPath];\n    \n    NSString *text = [self textForItemAtIndexPath:indexPath];\n    JWTDecriptedCollectionViewItem *decriptedItem = (JWTDecriptedCollectionViewItem *)item;\n    \n    [decriptedItem updateWithText:text];\n    [decriptedItem updateWithTextColor:[self colorWithIndexPath:indexPath]];\n    return item;\n}\n\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/JWTDecriptedViewController.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.Cocoa.XIB\" version=\"3.0\" toolsVersion=\"11201\" systemVersion=\"16A323\" targetRuntime=\"MacOSX.Cocoa\" propertyAccessControl=\"none\" useAutolayout=\"YES\" customObjectInstantitationMethod=\"direct\">\n    <dependencies>\n        <deployment identifier=\"macosx\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.CocoaPlugin\" version=\"11201\"/>\n    </dependencies>\n    <objects>\n        <customObject id=\"-2\" userLabel=\"File's Owner\" customClass=\"JWTDecriptedViewController\">\n            <connections>\n                <outlet property=\"collectionView\" destination=\"mXP-VW-npz\" id=\"V1D-I4-wcM\"/>\n                <outlet property=\"view\" destination=\"Hz6-mo-xeY\" id=\"0bl-1N-x8E\"/>\n            </connections>\n        </customObject>\n        <customObject id=\"-1\" userLabel=\"First Responder\" customClass=\"FirstResponder\"/>\n        <customObject id=\"-3\" userLabel=\"Application\" customClass=\"NSObject\"/>\n        <customView id=\"Hz6-mo-xeY\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"272\"/>\n            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n            <subviews>\n                <scrollView autohidesScrollers=\"YES\" horizontalLineScroll=\"10\" horizontalPageScroll=\"10\" verticalLineScroll=\"10\" verticalPageScroll=\"10\" usesPredominantAxisScrolling=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"Ova-Fc-W4C\">\n                    <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"272\"/>\n                    <clipView key=\"contentView\" id=\"xMO-YT-V6e\">\n                        <rect key=\"frame\" x=\"1\" y=\"1\" width=\"478\" height=\"270\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <subviews>\n                            <collectionView id=\"mXP-VW-npz\">\n                                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"478\" height=\"270\"/>\n                                <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                <collectionViewFlowLayout key=\"collectionViewLayout\" minimumInteritemSpacing=\"10\" minimumLineSpacing=\"10\" id=\"KcQ-Vu-xXO\">\n                                    <size key=\"itemSize\" width=\"50\" height=\"50\"/>\n                                </collectionViewFlowLayout>\n                                <color key=\"primaryBackgroundColor\" name=\"controlBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                            </collectionView>\n                        </subviews>\n                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                    </clipView>\n                    <scroller key=\"horizontalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" horizontal=\"YES\" id=\"dAS-nP-5HK\">\n                        <rect key=\"frame\" x=\"1\" y=\"144\" width=\"233\" height=\"15\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                    </scroller>\n                    <scroller key=\"verticalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" doubleValue=\"1\" horizontal=\"NO\" id=\"GVr-s4-nLA\">\n                        <rect key=\"frame\" x=\"234\" y=\"1\" width=\"15\" height=\"143\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                    </scroller>\n                </scrollView>\n            </subviews>\n            <constraints>\n                <constraint firstAttribute=\"bottom\" secondItem=\"Ova-Fc-W4C\" secondAttribute=\"bottom\" id=\"LWr-cT-dGa\"/>\n                <constraint firstItem=\"Ova-Fc-W4C\" firstAttribute=\"top\" secondItem=\"Hz6-mo-xeY\" secondAttribute=\"top\" id=\"hjX-ov-aWZ\"/>\n                <constraint firstItem=\"Ova-Fc-W4C\" firstAttribute=\"leading\" secondItem=\"Hz6-mo-xeY\" secondAttribute=\"leading\" id=\"kHB-Er-WN1\"/>\n                <constraint firstAttribute=\"trailing\" secondItem=\"Ova-Fc-W4C\" secondAttribute=\"trailing\" id=\"qTj-ZS-hGY\"/>\n            </constraints>\n        </customView>\n    </objects>\n</document>\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/JWTTokenDecoder.h",
    "content": "//\n//  JWTTokenDecoder.h\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 30.10.2017.\n//  Copyright © 2017 JWT. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n@import JWT;\n\n@protocol JWTTokenDecoderNecessaryDataObject__Protocol <NSObject>\n@property (copy, nonatomic, readonly) NSString *chosenAlgorithmName;\n@property (copy, nonatomic, readonly) NSString *chosenSecret;\n@property (copy, nonatomic, readonly) NSData *chosenSecretData;\n@property (assign, nonatomic, readonly) BOOL isBase64EncodedSecret;\n@end\n\n@protocol JWTTokenDecoderProtocol\n- (JWTCodingResultType *)decodeToken:(NSString *)token skipSignatureVerification:(BOOL)skipVerification necessaryDataObject:(id<JWTTokenDecoderNecessaryDataObject__Protocol>)object;\n@end\n\n@interface JWTTokenDecoder : NSObject <JWTTokenDecoderProtocol>\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/JWTTokenDecoder.m",
    "content": "//\n//  JWTTokenDecoder.m\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 30.10.2017.\n//  Copyright © 2017 JWT. All rights reserved.\n//\n\n#import \"JWTTokenDecoder.h\"\n@interface JWTTokenDecoder ()\n@property (strong, nonatomic, readwrite) JWTBuilder *builder;\n@property (strong, nonatomic, readwrite) JWTCodingResultType *resultType;\n@property (strong, nonatomic, readonly) JWTTokenDecoder *theDecoder;\n@end\n\n@interface JWTTokenDecoder__V2 : NSObject <JWTTokenDecoderProtocol> @end\n@implementation JWTTokenDecoder__V2\n- (JWTCodingResultType *)decodeToken:(NSString *)token skipSignatureVerification:(BOOL)skipVerification necessaryDataObject:(id<JWTTokenDecoderNecessaryDataObject__Protocol>)object {\n    NSLog(@\"JWT ENCODED TOKEN: %@\", token);\n    NSString *algorithmName = [object chosenAlgorithmName];\n    NSLog(@\"JWT Algorithm NAME: %@\", algorithmName);\n    \n    JWTBuilder *builder = [JWTBuilder decodeMessage:token].algorithmName(algorithmName).options(@(skipVerification));\n    \n    NSData *secretData = [object chosenSecretData];\n    NSString *secret = [object chosenSecret];\n    BOOL isBase64EncodedSecret = [object isBase64EncodedSecret];\n    \n    if (![algorithmName isEqualToString:JWTAlgorithmNameNone]) {\n        if (isBase64EncodedSecret && secretData) {\n            builder.secretData(secretData);\n        }\n        else {\n            builder.secret(secret);\n        }\n    }\n    \n    NSDictionary *decoded = builder.decode;\n    NSLog(@\"JWT ERROR: %@\", builder.jwtError);\n    NSLog(@\"JWT DICTIONARY: %@\", decoded);\n    NSError *theError = builder.jwtError;\n    JWTCodingResultType *resultType = theError ? [[JWTCodingResultType alloc] initWithErrorResult:[[JWTCodingResultTypeError alloc] initWithError:theError]] : nil;\n    return resultType;\n}\n@end\n\n@interface JWTTokenDecoder__V3 : NSObject <JWTTokenDecoderProtocol> @end\n@implementation JWTTokenDecoder__V3\n- (JWTCodingResultType *)decodeToken:(NSString *)token skipSignatureVerification:(BOOL)skipVerification necessaryDataObject:(id<JWTTokenDecoderNecessaryDataObject__Protocol>)object {\n    NSLog(@\"JWT ENCODED TOKEN: %@\", token);\n    NSString *algorithmName = [object chosenAlgorithmName];\n    NSLog(@\"JWT Algorithm NAME: %@\", algorithmName);\n    NSData *secretData = [object chosenSecretData];\n    NSString *secret = [object chosenSecret];\n    BOOL isBase64EncodedSecret = [object isBase64EncodedSecret];\n    \n    NSError *theError = nil;\n    id<JWTAlgorithm> algorithm = [JWTAlgorithmFactory algorithmByName:algorithmName];\n    if (!algorithm) {\n        return nil;\n    }\n    id<JWTAlgorithmDataHolderProtocol> holder = nil;\n    if ([algorithm isKindOfClass:[JWTAlgorithmRSBase class]] || [algorithm.name hasPrefix:@\"RS\"]) {\n        NSError *keyError = nil;\n        id<JWTCryptoKeyProtocol>key = [[JWTCryptoKeyPublic alloc] initWithPemEncoded:secret parameters:nil error:&keyError];\n        theError = keyError;\n        if (!theError) {\n            holder = [JWTAlgorithmRSFamilyDataHolder new].verifyKey(key).algorithmName(algorithmName);\n        }\n    }\n    else if ([algorithm isKindOfClass:[JWTAlgorithmHSBase class]]){\n        JWTAlgorithmHSFamilyDataHolder *aHolder = [JWTAlgorithmHSFamilyDataHolder new];\n        if (isBase64EncodedSecret && secretData) {\n            aHolder.secretData(secretData);\n        }\n        else {\n            aHolder.secret(secret);\n        }\n        holder = aHolder.algorithmName(algorithmName);\n    }\n    else if ([algorithm isKindOfClass:[JWTAlgorithmNone class]]) {\n        holder = [JWTAlgorithmNoneDataHolder new];\n    }\n    \n    if (theError) {\n        NSLog(@\"JWT internalError: %@\", theError);\n        return [[JWTCodingResultType alloc] initWithErrorResult:[[JWTCodingResultTypeError alloc] initWithError:theError]];\n    }\n    \n    JWTCodingBuilder *builder = [JWTDecodingBuilder decodeMessage:token].claimsSetCoordinator([JWTClaimsSetCoordinatorBase new]).addHolder(holder).options(@(skipVerification));\n    JWTCodingResultType *result = builder.result;\n    // TODO: Fix\n    // signature is not verified well even for JWT.IO example.\n    // it happens in case of base64 data corruption. (url encoded vs not url uncoded)\n    NSLog(@\"JWT ERROR: %@ -> %@\", result.errorResult, result.errorResult.error);\n    NSLog(@\"JWT RESULT: %@ -> %@\", result.successResult, result.successResult.headerAndPayloadDictionary);\n    return result;\n}\n@end\n\n@implementation JWTTokenDecoder\n- (id<JWTTokenDecoderProtocol>)theDecoder {\n    return [JWTTokenDecoder__V3 new];\n}\n- (JWTCodingResultType *)decodeToken:(NSString *)token skipSignatureVerification:(BOOL)skipVerification necessaryDataObject:(id<JWTTokenDecoderNecessaryDataObject__Protocol>)object {\n    if (!object) {\n        return nil;\n    }\n    return [self.theDecoder decodeToken:token skipSignatureVerification:skipVerification necessaryDataObject:object];\n}\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/JWTTokenTextTypeDescription.h",
    "content": "//\n//  JWTTokenTextTypeDescription.h\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 25.09.16.\n//  Copyright © 2016 JWT. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import <Cocoa/Cocoa.h>\n#import <AppKit/AppKit.h>\n#import \"NSArrayExtension.h\"\n\ntypedef NS_ENUM(NSInteger, JWTTokenTextType) {\n    JWTTokenTextTypeDefault, // dot text color\n    JWTTokenTextTypeHeader,\n    JWTTokenTextTypePayload,\n    JWTTokenTextTypeSignature,\n    JWTTokenTextTypeDot\n};\n\n@interface JWTTokenTextTypeAppearanceAttributes : NSObject\n@property (copy, nonatomic, readwrite) NSColor *color;\n@property (copy, nonatomic, readwrite) NSFont *font;\n@end\n\n@interface JWTTokenTextTypeDescription: NSObject\n- (NSColor *)colorForType:(JWTTokenTextType)type;\n- (NSFont *)font;\n- (NSDictionary *)encodedTextAttributesForType:(JWTTokenTextType)type;\n+ (NSArray <NSNumber *>*)typicalSchemeComponents;\n@end\n\n@interface JWTTokenTextTypeSerialization: NSObject\n- (NSString *)textPartFromTexts:(NSArray *)texts type:(JWTTokenTextType)type;\n@end\n\n@interface JWTTokenTextTypeAppearance: NSObject\n- (NSArray <JWTTokenTextTypeAppearanceAttributes *>*)attributesForText:(NSString *)text;\n- (NSAttributedString *)attributedStringForText:(NSString *)text;\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/JWTTokenTextTypeDescription.m",
    "content": "//\n//  JWTTokenTextTypeDescription.m\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 25.09.16.\n//  Copyright © 2016 JWT. All rights reserved.\n//\n\n#import \"JWTTokenTextTypeDescription.h\"\n\n@interface JWTTokenTextTypeAppearanceAttributes ()\n@property (copy, nonatomic, readwrite) NSString *part;\n@end\n\n@implementation JWTTokenTextTypeAppearanceAttributes\n- (instancetype)initWithColor:(NSColor *)color font:(NSFont *)font {\n    if (self = [super init]) {\n        self.color = color;\n        self.font = font;\n    }\n    return self;\n}\n@end\n\n@interface JWTTokenTextTypeDescription ()\n@property (strong, nonatomic, readwrite) NSDictionary *textColors;\n@end\n@implementation JWTTokenTextTypeDescription\n- (NSDictionary *)encodedTextAttributesForType:(JWTTokenTextType)type {\n    return @{};\n}\n\n- (NSColor *)colorForType:(JWTTokenTextType)type {\n    switch (type) {\n        case JWTTokenTextTypeDefault: return [NSColor blackColor];\n        case JWTTokenTextTypeHeader: return [NSColor redColor];\n        case JWTTokenTextTypePayload: return [NSColor magentaColor];\n        case JWTTokenTextTypeSignature: return [NSColor colorWithRed:0 green:185/255.0f blue:241/255.0f alpha:1.0f];\n        case JWTTokenTextTypeDot: return [NSColor blackColor];\n        default: return nil;\n    }\n}\n\n- (NSFont *)font {\n    return [NSFont boldSystemFontOfSize:22];\n}\n\n+ (NSArray <NSNumber *>*)typicalSchemeComponents {\n    return @[\n             @(JWTTokenTextTypeHeader),\n             @(JWTTokenTextTypeDot),\n             @(JWTTokenTextTypePayload),\n             @(JWTTokenTextTypeDot),\n             @(JWTTokenTextTypeSignature)\n             ];\n}\n@end\n\n@implementation JWTTokenTextTypeSerialization\n\n- (NSString *)textPartFromTexts:(NSArray *)texts type:(JWTTokenTextType)type {\n    NSString *result = nil;\n    switch (type) {\n        case JWTTokenTextTypeHeader: {\n            return [NSArrayExtension extendedArray:texts objectAtIndex:0];\n        }\n        case JWTTokenTextTypePayload: {\n            return [NSArrayExtension extendedArray:texts objectAtIndex:1];\n        }\n        case JWTTokenTextTypeSignature: {\n            if (texts.count > 2) {\n                return [[texts subarrayWithRange:NSMakeRange(2, texts.count - 2)] componentsJoinedByString:@\".\"];\n            }\n            return nil;\n        }            \n        case JWTTokenTextTypeDot: return @\".\";\n        \n        default: return nil;\n    }\n    return result;\n}\n@end\n\n@interface JWTTokenTextTypeAppearance ()\n@property (strong, nonatomic, readwrite) JWTTokenTextTypeSerialization *serialization;\n@property (strong, nonatomic, readwrite) JWTTokenTextTypeDescription *tokenTypeDescription;\n@end\n\n@implementation JWTTokenTextTypeAppearance\n\n- (instancetype)init {\n    if (self = [super init]) {\n        self.serialization = [JWTTokenTextTypeSerialization new];\n        self.tokenTypeDescription = [JWTTokenTextTypeDescription new];\n    }\n    return self;\n}\n\n- (NSArray<JWTTokenTextTypeAppearanceAttributes *> *)attributesForText:(NSString *)text {\n    __auto_type texts = [text componentsSeparatedByString:@\".\"];\n    \n    __auto_type result = [NSMutableArray array];\n    \n    for (NSNumber *component in JWTTokenTextTypeDescription.typicalSchemeComponents) {\n        __auto_type type = (JWTTokenTextType)component.integerValue;\n\n        __auto_type object = [self.serialization textPartFromTexts:texts type:type];\n        if (object) {\n            __auto_type color = [self.tokenTypeDescription colorForType:type];\n            __auto_type font = self.tokenTypeDescription.font;\n\n            __auto_type component = [[JWTTokenTextTypeAppearanceAttributes alloc] initWithColor:color font:font];\n            component.part = object;\n\n            [result addObject:component];\n        }\n    }\n    \n    return [result copy];\n}\n\n- (NSAttributedString *)attributedStringForText:(NSString *)text {\n    __auto_type string = [NSMutableAttributedString new];\n    __auto_type attributes = [self attributesForText:text];\n    \n    for (JWTTokenTextTypeAppearanceAttributes *attribute in attributes) {\n        __auto_type attributes = @{\n                                   NSForegroundColorAttributeName : attribute.color,\n                                   NSFontAttributeName : attribute.font\n                                   };\n\n        __auto_type component = [[NSAttributedString alloc] initWithString:attribute.part attributes:attributes];\n        [string appendAttributedString:component];\n    }\n    return [string copy];\n}\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/NSArrayExtension.h",
    "content": "//\n//  NSArrayExtension.h\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 30.10.2017.\n//  Copyright © 2017 JWT. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\n@interface NSArrayExtension : NSObject\n+ (id)extendedArray:(NSArray *)array objectAtIndex:(NSInteger)index;\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/NSArrayExtension.m",
    "content": "//\n//  NSArrayExtension.m\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 30.10.2017.\n//  Copyright © 2017 JWT. All rights reserved.\n//\n\n#import \"NSArrayExtension.h\"\n\n@implementation NSArrayExtension\n+ (id)extendedArray:(NSArray *)array objectAtIndex:(NSInteger)index {\n    if (array.count) {\n        return index >= array.count ? nil : [array objectAtIndex:index];\n    }\n    return nil;\n}\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/SignatureValidationDescription.h",
    "content": "//\n//  SignatureValidationDescription.h\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 30.10.2017.\n//  Copyright © 2017 JWT. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import <Cocoa/Cocoa.h>\n\ntypedef NS_ENUM(NSInteger, SignatureValidationType) {\n    SignatureValidationTypeUnknown,\n    SignatureValidationTypeValid,\n    SignatureValidationTypeInvalid\n};\n\n@interface SignatureValidationDescription : NSObject\n@property (assign, nonatomic, readwrite) SignatureValidationType signatureValidation;\n@property (assign, nonatomic, readonly) NSColor* currentColor;\n@property (assign, nonatomic, readonly) NSString* currentTitle;\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/SignatureValidationDescription.m",
    "content": "//\n//  SignatureValidationDescription.m\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 30.10.2017.\n//  Copyright © 2017 JWT. All rights reserved.\n//\n\n#import \"SignatureValidationDescription.h\"\n#import <Cocoa/Cocoa.h>\n\n@interface SignatureValidationDescription ()\n- (NSColor *)colorForSignatureValidation:(SignatureValidationType)signatureValidation;\n- (NSString *)titleForSignatureValidation:(SignatureValidationType)signatureValidation;\n@end\n\n@implementation SignatureValidationDescription\n- (NSColor *)colorForSignatureValidation:(SignatureValidationType)signatureValidation {\n    id result = nil;\n    switch (signatureValidation) {\n        case SignatureValidationTypeUnknown: {\n            result = [NSColor darkGrayColor];\n            break;\n        }\n        case SignatureValidationTypeInvalid: {\n            result = [NSColor redColor];\n            break;\n        }\n        case SignatureValidationTypeValid: {\n            result = [NSColor colorWithRed:0 green:185/255.0f blue:241/255.0f alpha:1.0f];\n            break;\n        }\n            \n        default:\n            break;\n    }\n    return result;\n}\n- (NSString *)titleForSignatureValidation:(SignatureValidationType)signatureValidation {\n    id result = nil;\n    switch (signatureValidation) {\n        case SignatureValidationTypeUnknown: {\n            result = @\"Signature Unknown\";\n            break;\n        }\n        case SignatureValidationTypeInvalid: {\n            result = @\"Signature Invalid\";\n            break;\n        }\n        case SignatureValidationTypeValid: {\n            result = @\"Signature Valid\";\n            break;\n        }\n        default:\n            break;\n    }\n    return result ?: @\"Signature Unknown\";\n}\n- (NSColor *)currentColor {\n    return [self colorForSignatureValidation:self.signatureValidation];\n}\n- (NSString *)currentTitle {\n    return [self titleForSignatureValidation:self.signatureValidation];\n}\n@end\n\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/ViewController+Model.h",
    "content": "//\n//  ViewController+Model.h\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 30.10.2017.\n//  Copyright © 2017 JWT. All rights reserved.\n//\n\n#import \"ViewController.h\"\n#import \"JWTTokenTextTypeDescription.h\"\n#import \"SignatureValidationDescription.h\"\n#import \"JWTTokenDecoder.h\"\n\n@interface ViewController (Model)\n\n@end\n\n@interface ViewController__Model : NSObject\n@property (strong, nonatomic, readwrite) JWTTokenTextTypeAppearance *tokenAppearance;\n@property (strong, nonatomic, readwrite) SignatureValidationDescription *signatureValidationDescription;\n@property (strong, nonatomic, readwrite) JWTTokenDecoder *decoder;\n@end\n\n@interface ViewController__Model (JWTAlgorithms)\n@property (strong, nonatomic, readonly) NSArray *availableAlgorithms;\n@property (strong, nonatomic, readonly) NSArray *availableAlgorithmsNames;\n@end\n\n@interface ViewController__DataSeed: NSObject\n@property (copy, nonatomic, readonly) NSString *algorithmName;\n@property (copy, nonatomic, readonly) NSString *secret;\n@property (copy, nonatomic, readonly) NSString *token;\n@end\n\n@interface ViewController__DataSeed (Create)\n+ (instancetype)defaultDataSeed;\n+ (instancetype)HS256;\n+ (instancetype)RS256;\n+ (instancetype)HS256__WithoutClaimsSet;\n+ (instancetype)HS256__LongSecret__32;\n+ (instancetype)RS256__Corrupted;\n+ (instancetype)RS256__Corrupted_2;\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/ViewController+Model.m",
    "content": "//\n//  ViewController+Model.m\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 30.10.2017.\n//  Copyright © 2017 JWT. All rights reserved.\n//\n\n#import \"ViewController+Model.h\"\n@import JWT;\n\n@implementation ViewController (Model)\n\n@end\n\n@implementation ViewController__Model\n- (instancetype)init {\n    if (self = [super init]) {\n        self.tokenAppearance = [JWTTokenTextTypeAppearance new];\n        self.signatureValidationDescription = [SignatureValidationDescription new];\n        self.decoder = [JWTTokenDecoder new];\n    }\n    return self;\n}\n@end\n\n@implementation ViewController__Model (JWTAlgorithms)\n- (NSArray *)availableAlgorithms {\n    return [JWTAlgorithmFactory algorithms];\n}\n- (NSArray *)availableAlgorithmsNames {\n    return [[self availableAlgorithms] valueForKey:@\"name\"];\n}\n@end\n\n@interface ViewController__DataSeed ()\n@property (copy, nonatomic, readwrite) NSString *algorithmName;\n@property (copy, nonatomic, readwrite) NSString *secret;\n@property (copy, nonatomic, readwrite) NSString *token;\n@end\n\n@implementation ViewController__DataSeed\n- (instancetype)initWithAlgorithName:(NSString *)algorithmName secret:(NSString *)secret token:(NSString *)token {\n    self = [super init];\n    if (self) {\n        self.algorithmName = algorithmName;\n        self.secret = secret;\n        self.token = token;\n    }\n    return self;\n}\n@end\n\n@implementation ViewController__DataSeed (Create)\n+ (instancetype)template {\n    NSString *token = @\"\";\n    NSString *secret = @\"\";\n    NSString *algorithmName = @\"\";\n    return [[self alloc] initWithAlgorithName:(NSString *)algorithmName secret:(NSString *)secret token:(NSString *)token];\n}\n\n+ (instancetype)defaultDataSeed {\n    return\n//    [self RS256];\n    [self RS256__Corrupted_2];\n}\n\n+ (instancetype)RS256 {\n    NSString *token = @\"eyJraWQiOiJqd3RfdWF0X2tleXMiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI1MDAxIiwiaXNzIjoiQ0xNIiwiZXhwIjoxNTA4MjQ5NTU3LCJqdGkiOiI2MjcyM2E4Yi0zOTZmLTQxYmYtOTljMi02NWRkMzk2MDNiNjQifQ.Cej8RJ6e2HEU27rh_TyHZBoMI1jErmhOfSFY4SRzRoijSP628hM82XxjDX24HsKqIsK1xeeGI1yg1bed4RPhnmDGt4jAY73nqguZ1oqZ2DTcfZ5olxCXyLLaytl2XH7-62M_mFUcGj7I2mwts1DQkHWnFky2i4uJXlksHFkUg2xZoGEjVHo0bxCxgQ5yQiOpxC5VodN5rAPM3A5yMG6EijOp-dvUThjoJ4RFTGKozw_x_Qg6RLGDusNcmLIMbHasTsyZAZle6RFkwO0Sij1k6z6_xssbOl-Q57m7CeYgVHMORdzy4Smkmh-0gzeiLsGbCL4fhgdHydpIFajW-eOXMw\";\n    NSString *secret = @\"-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoPryo3IisfK3a028bwgso/CW5kB84mk6Y7rO76FxJRTWnOAla0Uf0OpIID7go4Qck66yT4/uPpiOQIR0oW0plTekkDP75EG3d/2mtzhiCtELV4F1r9b/InCN5dYYK8USNkKXgjbeVyatdUvCtokz10/ibNZ9qikgKf58qXnn2anGvpE6ded5FOUEukOjr7KSAfD0KDNYWgZcG7HZBxn/3N7ND9D0ATu2vxlJsNGOkH6WL1EmObo/QygBXzuZm5o0N0W15EXpWVbl4Ye7xqPnvc1i2DTKxNUcyhXfDbLw1ee2d9T/WU5895Ko2bQ/O/zPwUSobM3m+fPMW8kp5914kwIDAQAB-----END PUBLIC KEY-----\";\n    NSString *algorithmName = JWTAlgorithmNameRS256;\n    return [[self alloc] initWithAlgorithName:(NSString *)algorithmName secret:(NSString *)secret token:(NSString *)token];\n}\n+ (instancetype)HS256 {\n    NSString *token = @\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ\";\n    NSString *secret = @\"secret\";\n    NSString *algorithmName = JWTAlgorithmNameHS256;\n    return [[self alloc] initWithAlgorithName:(NSString *)algorithmName secret:(NSString *)secret token:(NSString *)token];\n}\n\n+ (instancetype)HS256__WithoutClaimsSet {\n    NSString *token = @\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvaG9oIjoiMTIzNDU2Nzg5MCIsImhhaGEiOiJKb2huIERvZSIsIm9oaGhoaCI6dHJ1ZX0.5V2Jk3Nnaj1czth5x7ssXgy12K_Oe1Lew1yfgQokpqE\";\n    NSString *secret = @\"secret\";\n    NSString *algorithmName = JWTAlgorithmNameHS256;\n    return [[self alloc] initWithAlgorithName:(NSString *)algorithmName secret:(NSString *)secret token:(NSString *)token];\n}\n\n+ (instancetype)HS256__LongSecret__32 {\n    NSString *token = @\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiSm9obiBEb2UifQ.RbAcmsAGL1QWvoT1DUrAF-3Wwxvj8VvPHYFNEcUNog8\";\n    NSString *secret = @\"qwertyuiopasdfghjklzxcvbnm123456\";\n    NSString *algorithmName = JWTAlgorithmNameHS256;\n    return [[self alloc] initWithAlgorithName:(NSString *)algorithmName secret:(NSString *)secret token:(NSString *)token];\n}\n\n+ (instancetype)RS256__Corrupted {\n    NSString *token = @\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE\";\n    NSString *secret = @\"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQAB\";\n    NSString *algorithmName = JWTAlgorithmNameRS256;\n    return [[self alloc] initWithAlgorithName:(NSString *)algorithmName secret:(NSString *)secret token:(NSString *)token];\n}\n+ (instancetype)RS256__Corrupted_2 {\n    NSString *token = @\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE\";\n    NSString *secret = @\"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQAB\";\n    NSString *algorithmName = JWTAlgorithmNameRS256;\n    return [[self alloc] initWithAlgorithName:(NSString *)algorithmName secret:(NSString *)secret token:(NSString *)token];\n}\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/ViewController.h",
    "content": "//\n//  ViewController.h\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 23.05.16.\n//  Copyright © 2016 JWT. All rights reserved.\n//\n\n#import <Cocoa/Cocoa.h>\n\n@interface ViewController : NSViewController\n\n\n@end\n\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/ViewController.m",
    "content": "//\n//  ViewController.m\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 23.05.16.\n//  Copyright © 2016 JWT. All rights reserved.\n//\n\n#import \"ViewController.h\"\n@import JWT;\n#import \"JWTTokenTextTypeDescription.h\"\n#import \"SignatureValidationDescription.h\"\n#import \"JWTDecriptedViewController.h\"\n#import \"ViewController+Model.h\"\n\n@interface ViewController() <NSTextViewDelegate, NSTextFieldDelegate, NSTableViewDelegate, NSTableViewDataSource>\n@property (weak) IBOutlet NSTextField *algorithmLabel;\n@property (weak) IBOutlet NSPopUpButton *algorithmPopUpButton;\n@property (weak) IBOutlet NSTextField *secretLabel;\n@property (weak) IBOutlet NSTextField *secretTextField;\n@property (weak) IBOutlet NSButton *secretIsBase64EncodedCheckButton;\n@property (weak) IBOutlet NSTextField *signatureLabel;\n@property (weak) IBOutlet NSButton *signatureVerificationCheckButton;\n\n\n@property (unsafe_unretained) IBOutlet NSTextView *encodedTextView;\n@property (unsafe_unretained) IBOutlet NSTextView *decodedTextView;\n@property (weak) IBOutlet NSTableView *decodedTableView;\n@property (weak) IBOutlet NSView * decriptedView;\n@property (strong, nonatomic, readwrite) JWTDecriptedViewController *decriptedViewController;\n@property (weak) IBOutlet NSTextField *signatureStatusLabel;\n\n\n@property (strong, nonatomic, readwrite) ViewController__Model *model;\n@end\n\n// it catches all data from view controller\n\n@interface ViewController (JWTTokenDecoderNecessaryDataObject__Protocol) <JWTTokenDecoderNecessaryDataObject__Protocol>\n@end\n\n@implementation ViewController (JWTTokenDecoderNecessaryDataObject__Protocol)\n- (NSString *)chosenAlgorithmName {\n    return [self.algorithmPopUpButton selectedItem].title;\n}\n\n- (NSData *)chosenSecretData {\n    NSString *secret = [self chosenSecret];\n    \n    BOOL isBase64Encoded = [self isBase64EncodedSecret];\n    NSData *result = nil;\n    \n    if (isBase64Encoded) {\n        result = [[NSData alloc] initWithBase64EncodedString:secret options:0];\n        if (!result) {\n            self.secretIsBase64EncodedCheckButton.integerValue = 0;\n        }\n    }\n    \n    return result;\n}\n\n- (NSString *)chosenSecret {\n    return self.secretTextField.stringValue;\n}\n\n- (BOOL)isBase64EncodedSecret {\n    return self.secretIsBase64EncodedCheckButton.integerValue == 1;\n}\n@end\n\n\n@implementation ViewController\n\n//func encodedTextAttributes(_ enumerate: (NSRange, [NSAttributedString.Key : Any]) -> ()) {\n//    let textStorage = self.encodedTextView.textStorage!\n//    let string = textStorage.string\n//    let range = NSMakeRange(0, string.count)\n//    if let attributedString = self.model.appearance.encodedAttributedString(text: string) {\n//        attributedString.enumerateAttributes(in: range, options: []) { (attributes, range, bool) in\n//            enumerate(range, attributes)\n//        }\n//    }\n//}\n\n- (void)encodedTextAttributes:(void(^)(NSRange range, NSDictionary* dictionary))block {\n    if (!block) {\n        return;\n    }\n    __auto_type textStorage = self.encodedTextView.textStorage;\n    __auto_type string = textStorage.string;\n    __auto_type range = NSMakeRange(0, string.length);\n    __auto_type attributedString = [self.model.tokenAppearance attributedStringForText:string];\n    if (attributedString != nil) {\n        [attributedString enumerateAttributesInRange:range options:0 usingBlock:^(NSDictionary<NSAttributedStringKey,id> * _Nonnull attrs, NSRange range, BOOL * _Nonnull stop) {\n            block(range, attrs);\n        }];\n    }\n}\n\n\n#pragma mark - Refresh UI\n- (void)refreshUI {\n    \n    NSTextStorage *textStorage = self.encodedTextView.textStorage;\n    NSString *string = textStorage.string;\n    \n    [self encodedTextAttributes:^(NSRange range, NSDictionary *dictionary) {\n        [textStorage setAttributes:dictionary range:range];\n    }];\n    \n    BOOL signatureVerified = [self.model.decoder decodeToken:string skipSignatureVerification:NO necessaryDataObject:self].errorResult == nil;\n    [self signatureReactOnVerifiedToken:signatureVerified];\n    \n    __auto_type shouldSkipVerification = self.signatureVerificationCheckButton.integerValue == 1;\n    __auto_type result = [self.model.decoder decodeToken:string skipSignatureVerification:shouldSkipVerification necessaryDataObject:self];\n    \n    // will be udpated.\n    self.decriptedViewController.resultType = result;\n}\n\n#pragma mark - Signature Customization\n- (void)signatureReactOnVerifiedToken:(BOOL)verified {\n    SignatureValidationType type = verified ? SignatureValidationTypeValid : SignatureValidationTypeInvalid;\n    self.model.signatureValidationDescription.signatureValidation = type;\n    self.signatureStatusLabel.textColor = self.model.signatureValidationDescription.currentColor;\n    self.signatureStatusLabel.stringValue = self.model.signatureValidationDescription.currentTitle;\n}\n\n#pragma mark - Setup\n- (void)setupModel {\n    self.model = [ViewController__Model new];\n}\n\n- (void)setupTop {\n    // top label.\n    self.algorithmLabel.stringValue = @\"Algorithm\";\n    \n    // pop up button.\n    [self.algorithmPopUpButton removeAllItems];\n    [self.algorithmPopUpButton addItemsWithTitles:self.model.availableAlgorithmsNames];\n    [self.algorithmPopUpButton setAction:@selector(popUpButtonValueChanged:)];\n    [self.algorithmPopUpButton setTarget:self];\n    \n    // secretLabel\n    self.secretLabel.stringValue = @\"Secret\";\n    \n    // secretTextField\n    self.secretTextField.placeholderString = @\"Secret\";\n    self.secretTextField.delegate = self;\n    \n    // check button\n    self.secretIsBase64EncodedCheckButton.title = @\"is Base64Encoded Secret\";\n    self.secretIsBase64EncodedCheckButton.integerValue = NO;\n    [self.secretIsBase64EncodedCheckButton setTarget:self];\n    [self.secretIsBase64EncodedCheckButton setAction:@selector(checkBoxState:)];\n    \n    // skip signature verification\n    self.signatureLabel.stringValue = @\"Signature\";\n    \n    self.signatureVerificationCheckButton.title = @\"Skip signature verification\";\n    self.signatureVerificationCheckButton.integerValue = 0;\n    [self.signatureVerificationCheckButton setTarget:self];\n    [self.signatureVerificationCheckButton setAction:@selector(checkBoxState:)];\n}\n\n- (void)setupBottom {\n    self.signatureStatusLabel.alignment       = NSTextAlignmentCenter;\n    self.signatureStatusLabel.textColor       = [NSColor whiteColor];\n    self.signatureStatusLabel.drawsBackground = YES;\n    \n    self.model.signatureValidationDescription.signatureValidation = SignatureValidationTypeUnknown;\n    self.signatureStatusLabel.textColor = self.model.signatureValidationDescription.currentColor;\n    self.signatureStatusLabel.stringValue = self.model.signatureValidationDescription.currentTitle;\n}\n\n- (void)setupEncodingDecodingViews {\n    self.encodedTextView.delegate = self;\n//    self.decodedTextView.delegate = self;\n    self.decodedTableView.delegate = self;\n    self.decodedTableView.dataSource = self;\n    \n    //thanks!\n    //http://stackoverflow.com/questions/7545490/how-can-i-have-the-only-column-of-my-nstableview-take-all-the-width-of-the-table\n    NSTableView *tableView = self.decodedTableView;\n    [tableView  setColumnAutoresizingStyle:NSTableViewUniformColumnAutoresizingStyle];\n    [tableView.tableColumns.firstObject setResizingMask:NSTableColumnAutoresizingMask];\n    //AND\n    [tableView sizeLastColumnToFit];\n}\n\n- (void)setupDecorations {\n    [self setupTop];\n    [self setupBottom];\n}\n\n- (void)setupDecriptedViews {\n    NSView *view = self.decriptedView;\n    self.decriptedViewController = [JWTDecriptedViewController new];\n    [view addSubview:self.decriptedViewController.view];\n    // maybe add contstraints.\n}\n\n- (void)viewDidLoad {\n    [super viewDidLoad];\n    [self setupModel];\n    [self setupDecorations];\n    [self setupEncodingDecodingViews];\n    [self setupDecriptedViews];\n    [self defaultDataSetup];\n    [self refreshUI];\n    // Do any additional setup after loading the view.\n}\n- (void)defaultDataSetup {\n    ViewController__DataSeed *dataSeed = [ViewController__DataSeed defaultDataSeed];\n    [self defaultDataSetupWithToken:dataSeed.token secret:dataSeed.secret algorithmName:dataSeed.algorithmName];\n}\n\n- (void)defaultDataSetupWithToken:(NSString *)token secret:(NSString *)secret algorithmName:(NSString *)algorithmName {\n    if (token == nil || secret == nil || algorithmName == nil) {\n        NSLog(@\"%@ failed! one of them is nil: token:(%@) secret(%@) algorithmName:(%@)algorithm\", NSStringFromSelector(_cmd), token, secret, algorithmName);\n        return;\n    }\n    // token\n    [self.encodedTextView insertText:token replacementRange:NSMakeRange(0, token.length)];\n    \n    // secret\n    self.secretTextField.stringValue = secret;\n    \n    // algorithm\n    NSInteger index = [self.model.availableAlgorithmsNames indexOfObject:algorithmName];\n    [self.algorithmPopUpButton selectItemAtIndex:index];\n}\n\n- (void)viewWillAppear {\n    [super viewWillAppear];\n    NSView *view = self.decriptedView;\n    __auto_type decriptedView = self.decriptedViewController.view;\n    view.translatesAutoresizingMaskIntoConstraints = NO;\n    decriptedView.translatesAutoresizingMaskIntoConstraints = NO;\n    __auto_type constraints = @[\n                                [decriptedView.leftAnchor constraintEqualToAnchor:view.leftAnchor],\n                                [decriptedView.rightAnchor constraintEqualToAnchor:view.rightAnchor],\n                                [decriptedView.topAnchor constraintEqualToAnchor:view.topAnchor],\n                                [decriptedView.bottomAnchor constraintEqualToAnchor:view.bottomAnchor]\n                                ];\n    [NSLayoutConstraint activateConstraints:constraints];\n}\n\n#pragma mark - Actions\n- (void)popUpButtonValueChanged:(id)sender {\n    [self refreshUI];\n}\n\n-(IBAction)checkBoxState:(id)sender {\n    // Under construction\n    [self refreshUI];\n}\n\n\n#pragma marrk - Delegates / <NSTextFieldDelegate>\n\n- (void)controlTextDidChange:(NSNotification *)obj {\n    if ([obj.name isEqualToString:NSControlTextDidChangeNotification]) {\n        NSTextField *textField = (NSTextField *)obj.object;\n        if (textField == self.secretTextField) {\n            // refresh UI\n            [self refreshUI];\n        }\n    }\n}\n\n#pragma mark - EncodedTextView / <NSTextViewDelegate>\n\n- (void)textDidChange:(NSNotification *)notification {\n    [self refreshUI];\n}\n\n#pragma mark - DecodedTableView / <NSTableViewDataSource>\n\n- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {\n    return 4;\n}\n\n#pragma mark - DecodedTableView / <NSTableViewDelegate>\n- (BOOL)tableView:(NSTableView *)tableView isGroupRow:(NSInteger)row {\n    return row % 2 == 0;\n}\n- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {\n    // choose by row is section or not\n    if (row % 2) {\n        // section\n        NSView *cell = [tableView makeViewWithIdentifier:@\"Cell\" owner:self];\n        ((NSTableCellView *)cell).textField.stringValue = @\"AH\";\n        return cell;\n    }\n    else {\n        NSView *cell = [tableView makeViewWithIdentifier:@\"Cell\" owner:self];\n        ((NSTableCellView *)cell).textField.stringValue = @\"OH\";\n        //    return nil;\n        return cell;\n    }\n}\n\n- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row {\n    // calculate height of row.\n//    NSView * view = [tableView viewAtColumn:0 row:row makeIfNecessary:NO];\n    return 40;\n}\n\n@end\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop/main.m",
    "content": "//\n//  main.m\n//  JWTDesktop\n//\n//  Created by Lobanov Dmitry on 23.05.16.\n//  Copyright © 2016 JWT. All rights reserved.\n//\n\n#import <Cocoa/Cocoa.h>\n\nint main(int argc, const char * argv[]) {\n    return NSApplicationMain(argc, argv);\n}\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 52;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t04526B1A1CF3A2690090C5A3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 04526B191CF3A2690090C5A3 /* AppDelegate.m */; };\n\t\t04526B1D1CF3A2690090C5A3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 04526B1C1CF3A2690090C5A3 /* main.m */; };\n\t\t04526B201CF3A2690090C5A3 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04526B1F1CF3A2690090C5A3 /* ViewController.m */; };\n\t\t04526B221CF3A2690090C5A3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 04526B211CF3A2690090C5A3 /* Assets.xcassets */; };\n\t\t04526B251CF3A2690090C5A3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 04526B231CF3A2690090C5A3 /* Main.storyboard */; };\n\t\t04526B301CF3A2690090C5A3 /* JWTDesktopTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 04526B2F1CF3A2690090C5A3 /* JWTDesktopTests.m */; };\n\t\t04701E631D97F001007A0A86 /* JWTDecriptedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04701E611D97F001007A0A86 /* JWTDecriptedViewController.m */; };\n\t\t04701E641D97F001007A0A86 /* JWTDecriptedViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 04701E621D97F001007A0A86 /* JWTDecriptedViewController.xib */; };\n\t\t04701E681D97F0E5007A0A86 /* JWTDecriptedCollectionViewItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 04701E661D97F0E5007A0A86 /* JWTDecriptedCollectionViewItem.m */; };\n\t\t04701E691D97F0E5007A0A86 /* JWTDecriptedCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 04701E671D97F0E5007A0A86 /* JWTDecriptedCollectionViewItem.xib */; };\n\t\t04701E6C1D981F8C007A0A86 /* JWTTokenTextTypeDescription.m in Sources */ = {isa = PBXBuildFile; fileRef = 04701E6B1D981F8C007A0A86 /* JWTTokenTextTypeDescription.m */; };\n\t\t0A5BC6ED1FA77232000BDAB4 /* SignatureValidationDescription.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A5BC6EC1FA77232000BDAB4 /* SignatureValidationDescription.m */; };\n\t\t0A5BC6F01FA773A8000BDAB4 /* ViewController+Model.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A5BC6EF1FA773A8000BDAB4 /* ViewController+Model.m */; };\n\t\t0A5BC6F31FA77809000BDAB4 /* NSArrayExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A5BC6F21FA77809000BDAB4 /* NSArrayExtension.m */; };\n\t\t0A5BC6F61FA77D9D000BDAB4 /* JWTTokenDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A5BC6F51FA77D9D000BDAB4 /* JWTTokenDecoder.m */; };\n\t\t0AC0027F27865AEB002167AD /* JWT in Frameworks */ = {isa = PBXBuildFile; productRef = 0AC0027E27865AEB002167AD /* JWT */; };\n\t\tDB17256DE61643E08ADC47F5 /* libPods-JWTDesktopTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 447DF4A5AF64E7BE744EEE2F /* libPods-JWTDesktopTests.a */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t04526B2C1CF3A2690090C5A3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 04526B0D1CF3A2690090C5A3 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 04526B141CF3A2690090C5A3;\n\t\t\tremoteInfo = JWTDesktop;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t0A2D85FD22B53D4800BB4760 /* Embed Frameworks */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"\";\n\t\t\tdstSubfolderSpec = 10;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tname = \"Embed Frameworks\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t04526B151CF3A2690090C5A3 /* JWTDesktop.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JWTDesktop.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t04526B181CF3A2690090C5A3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t04526B191CF3A2690090C5A3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = \"<group>\"; };\n\t\t04526B1C1CF3A2690090C5A3 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t04526B1E1CF3A2690090C5A3 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = \"<group>\"; };\n\t\t04526B1F1CF3A2690090C5A3 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = \"<group>\"; };\n\t\t04526B211CF3A2690090C5A3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t04526B241CF3A2690090C5A3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = \"<group>\"; };\n\t\t04526B261CF3A2690090C5A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t04526B2B1CF3A2690090C5A3 /* JWTDesktopTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JWTDesktopTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t04526B2F1CF3A2690090C5A3 /* JWTDesktopTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JWTDesktopTests.m; sourceTree = \"<group>\"; };\n\t\t04526B311CF3A2690090C5A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t04701E601D97F001007A0A86 /* JWTDecriptedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JWTDecriptedViewController.h; sourceTree = \"<group>\"; };\n\t\t04701E611D97F001007A0A86 /* JWTDecriptedViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JWTDecriptedViewController.m; sourceTree = \"<group>\"; };\n\t\t04701E621D97F001007A0A86 /* JWTDecriptedViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = JWTDecriptedViewController.xib; sourceTree = \"<group>\"; };\n\t\t04701E651D97F0E5007A0A86 /* JWTDecriptedCollectionViewItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JWTDecriptedCollectionViewItem.h; sourceTree = \"<group>\"; };\n\t\t04701E661D97F0E5007A0A86 /* JWTDecriptedCollectionViewItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JWTDecriptedCollectionViewItem.m; sourceTree = \"<group>\"; };\n\t\t04701E671D97F0E5007A0A86 /* JWTDecriptedCollectionViewItem.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = JWTDecriptedCollectionViewItem.xib; sourceTree = \"<group>\"; };\n\t\t04701E6A1D981F8C007A0A86 /* JWTTokenTextTypeDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JWTTokenTextTypeDescription.h; sourceTree = \"<group>\"; };\n\t\t04701E6B1D981F8C007A0A86 /* JWTTokenTextTypeDescription.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JWTTokenTextTypeDescription.m; sourceTree = \"<group>\"; };\n\t\t0A5BC6EB1FA77232000BDAB4 /* SignatureValidationDescription.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SignatureValidationDescription.h; sourceTree = \"<group>\"; };\n\t\t0A5BC6EC1FA77232000BDAB4 /* SignatureValidationDescription.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SignatureValidationDescription.m; sourceTree = \"<group>\"; };\n\t\t0A5BC6EE1FA773A8000BDAB4 /* ViewController+Model.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"ViewController+Model.h\"; sourceTree = \"<group>\"; };\n\t\t0A5BC6EF1FA773A8000BDAB4 /* ViewController+Model.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = \"ViewController+Model.m\"; sourceTree = \"<group>\"; };\n\t\t0A5BC6F11FA77809000BDAB4 /* NSArrayExtension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSArrayExtension.h; sourceTree = \"<group>\"; };\n\t\t0A5BC6F21FA77809000BDAB4 /* NSArrayExtension.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NSArrayExtension.m; sourceTree = \"<group>\"; };\n\t\t0A5BC6F41FA77D9D000BDAB4 /* JWTTokenDecoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JWTTokenDecoder.h; sourceTree = \"<group>\"; };\n\t\t0A5BC6F51FA77D9D000BDAB4 /* JWTTokenDecoder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JWTTokenDecoder.m; sourceTree = \"<group>\"; };\n\t\t0AC0027C27865ACA002167AD /* JWT */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = JWT; path = ../..; sourceTree = \"<group>\"; };\n\t\t447DF4A5AF64E7BE744EEE2F /* libPods-JWTDesktopTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libPods-JWTDesktopTests.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tB0EC4FDC2D76F5A1074A63D2 /* libPods-JWTDesktop.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libPods-JWTDesktop.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t04526B121CF3A2690090C5A3 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0AC0027F27865AEB002167AD /* JWT in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t04526B281CF3A2690090C5A3 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tDB17256DE61643E08ADC47F5 /* libPods-JWTDesktopTests.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t04526B0C1CF3A2690090C5A3 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0AC0027C27865ACA002167AD /* JWT */,\n\t\t\t\t04526B171CF3A2690090C5A3 /* JWTDesktop */,\n\t\t\t\t04526B2E1CF3A2690090C5A3 /* JWTDesktopTests */,\n\t\t\t\t04526B161CF3A2690090C5A3 /* Products */,\n\t\t\t\t2756B542175862D629E8ADEC /* Frameworks */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t04526B161CF3A2690090C5A3 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t04526B151CF3A2690090C5A3 /* JWTDesktop.app */,\n\t\t\t\t04526B2B1CF3A2690090C5A3 /* JWTDesktopTests.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t04526B171CF3A2690090C5A3 /* JWTDesktop */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t04526B181CF3A2690090C5A3 /* AppDelegate.h */,\n\t\t\t\t04526B191CF3A2690090C5A3 /* AppDelegate.m */,\n\t\t\t\t04526B1E1CF3A2690090C5A3 /* ViewController.h */,\n\t\t\t\t04526B1F1CF3A2690090C5A3 /* ViewController.m */,\n\t\t\t\t04526B211CF3A2690090C5A3 /* Assets.xcassets */,\n\t\t\t\t04526B231CF3A2690090C5A3 /* Main.storyboard */,\n\t\t\t\t04526B261CF3A2690090C5A3 /* Info.plist */,\n\t\t\t\t04526B1B1CF3A2690090C5A3 /* Supporting Files */,\n\t\t\t\t04701E601D97F001007A0A86 /* JWTDecriptedViewController.h */,\n\t\t\t\t04701E611D97F001007A0A86 /* JWTDecriptedViewController.m */,\n\t\t\t\t04701E621D97F001007A0A86 /* JWTDecriptedViewController.xib */,\n\t\t\t\t04701E651D97F0E5007A0A86 /* JWTDecriptedCollectionViewItem.h */,\n\t\t\t\t04701E661D97F0E5007A0A86 /* JWTDecriptedCollectionViewItem.m */,\n\t\t\t\t04701E671D97F0E5007A0A86 /* JWTDecriptedCollectionViewItem.xib */,\n\t\t\t\t04701E6A1D981F8C007A0A86 /* JWTTokenTextTypeDescription.h */,\n\t\t\t\t04701E6B1D981F8C007A0A86 /* JWTTokenTextTypeDescription.m */,\n\t\t\t\t0A5BC6EB1FA77232000BDAB4 /* SignatureValidationDescription.h */,\n\t\t\t\t0A5BC6EC1FA77232000BDAB4 /* SignatureValidationDescription.m */,\n\t\t\t\t0A5BC6EE1FA773A8000BDAB4 /* ViewController+Model.h */,\n\t\t\t\t0A5BC6EF1FA773A8000BDAB4 /* ViewController+Model.m */,\n\t\t\t\t0A5BC6F11FA77809000BDAB4 /* NSArrayExtension.h */,\n\t\t\t\t0A5BC6F21FA77809000BDAB4 /* NSArrayExtension.m */,\n\t\t\t\t0A5BC6F41FA77D9D000BDAB4 /* JWTTokenDecoder.h */,\n\t\t\t\t0A5BC6F51FA77D9D000BDAB4 /* JWTTokenDecoder.m */,\n\t\t\t);\n\t\t\tpath = JWTDesktop;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t04526B1B1CF3A2690090C5A3 /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t04526B1C1CF3A2690090C5A3 /* main.m */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t04526B2E1CF3A2690090C5A3 /* JWTDesktopTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t04526B2F1CF3A2690090C5A3 /* JWTDesktopTests.m */,\n\t\t\t\t04526B311CF3A2690090C5A3 /* Info.plist */,\n\t\t\t);\n\t\t\tpath = JWTDesktopTests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t2756B542175862D629E8ADEC /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tB0EC4FDC2D76F5A1074A63D2 /* libPods-JWTDesktop.a */,\n\t\t\t\t447DF4A5AF64E7BE744EEE2F /* libPods-JWTDesktopTests.a */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t04526B141CF3A2690090C5A3 /* JWTDesktop */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 04526B341CF3A2690090C5A3 /* Build configuration list for PBXNativeTarget \"JWTDesktop\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t04526B111CF3A2690090C5A3 /* Sources */,\n\t\t\t\t04526B121CF3A2690090C5A3 /* Frameworks */,\n\t\t\t\t04526B131CF3A2690090C5A3 /* Resources */,\n\t\t\t\t0A2D85FD22B53D4800BB4760 /* Embed Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = JWTDesktop;\n\t\t\tpackageProductDependencies = (\n\t\t\t\t0AC0027E27865AEB002167AD /* JWT */,\n\t\t\t);\n\t\t\tproductName = JWTDesktop;\n\t\t\tproductReference = 04526B151CF3A2690090C5A3 /* JWTDesktop.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t04526B2A1CF3A2690090C5A3 /* JWTDesktopTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 04526B371CF3A2690090C5A3 /* Build configuration list for PBXNativeTarget \"JWTDesktopTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tE3FC1258955CF36F4AD3F07E /* [CP] Check Pods Manifest.lock */,\n\t\t\t\t04526B271CF3A2690090C5A3 /* Sources */,\n\t\t\t\t04526B281CF3A2690090C5A3 /* Frameworks */,\n\t\t\t\t04526B291CF3A2690090C5A3 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t04526B2D1CF3A2690090C5A3 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = JWTDesktopTests;\n\t\t\tproductName = JWTDesktopTests;\n\t\t\tproductReference = 04526B2B1CF3A2690090C5A3 /* JWTDesktopTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t04526B0D1CF3A2690090C5A3 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 1250;\n\t\t\t\tORGANIZATIONNAME = JWT;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t04526B141CF3A2690090C5A3 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 7.3.1;\n\t\t\t\t\t};\n\t\t\t\t\t04526B2A1CF3A2690090C5A3 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 7.3.1;\n\t\t\t\t\t\tTestTargetID = 04526B141CF3A2690090C5A3;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 04526B101CF3A2690090C5A3 /* Build configuration list for PBXProject \"JWTDesktop\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 04526B0C1CF3A2690090C5A3;\n\t\t\tproductRefGroup = 04526B161CF3A2690090C5A3 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t04526B141CF3A2690090C5A3 /* JWTDesktop */,\n\t\t\t\t04526B2A1CF3A2690090C5A3 /* JWTDesktopTests */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t04526B131CF3A2690090C5A3 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t04526B221CF3A2690090C5A3 /* Assets.xcassets in Resources */,\n\t\t\t\t04701E641D97F001007A0A86 /* JWTDecriptedViewController.xib in Resources */,\n\t\t\t\t04701E691D97F0E5007A0A86 /* JWTDecriptedCollectionViewItem.xib in Resources */,\n\t\t\t\t04526B251CF3A2690090C5A3 /* Main.storyboard in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t04526B291CF3A2690090C5A3 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\tE3FC1258955CF36F4AD3F07E /* [CP] Check Pods Manifest.lock */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t\t\"${PODS_PODFILE_DIR_PATH}/Podfile.lock\",\n\t\t\t\t\"${PODS_ROOT}/Manifest.lock\",\n\t\t\t);\n\t\t\tname = \"[CP] Check Pods Manifest.lock\";\n\t\t\toutputPaths = (\n\t\t\t\t\"$(DERIVED_FILE_DIR)/Pods-JWTDesktopTests-checkManifestLockResult.txt\",\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"diff \\\"${PODS_PODFILE_DIR_PATH}/Podfile.lock\\\" \\\"${PODS_ROOT}/Manifest.lock\\\" > /dev/null\\nif [ $? != 0 ] ; then\\n    # print error to STDERR\\n    echo \\\"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\\\" >&2\\n    exit 1\\nfi\\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\\necho \\\"SUCCESS\\\" > \\\"${SCRIPT_OUTPUT_FILE_0}\\\"\\n\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t04526B111CF3A2690090C5A3 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t04526B201CF3A2690090C5A3 /* ViewController.m in Sources */,\n\t\t\t\t0A5BC6ED1FA77232000BDAB4 /* SignatureValidationDescription.m in Sources */,\n\t\t\t\t0A5BC6F61FA77D9D000BDAB4 /* JWTTokenDecoder.m in Sources */,\n\t\t\t\t04526B1D1CF3A2690090C5A3 /* main.m in Sources */,\n\t\t\t\t0A5BC6F31FA77809000BDAB4 /* NSArrayExtension.m in Sources */,\n\t\t\t\t04526B1A1CF3A2690090C5A3 /* AppDelegate.m in Sources */,\n\t\t\t\t0A5BC6F01FA773A8000BDAB4 /* ViewController+Model.m in Sources */,\n\t\t\t\t04701E6C1D981F8C007A0A86 /* JWTTokenTextTypeDescription.m in Sources */,\n\t\t\t\t04701E631D97F001007A0A86 /* JWTDecriptedViewController.m in Sources */,\n\t\t\t\t04701E681D97F0E5007A0A86 /* JWTDecriptedCollectionViewItem.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t04526B271CF3A2690090C5A3 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t04526B301CF3A2690090C5A3 /* JWTDesktopTests.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t04526B2D1CF3A2690090C5A3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 04526B141CF3A2690090C5A3 /* JWTDesktop */;\n\t\t\ttargetProxy = 04526B2C1CF3A2690090C5A3 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin PBXVariantGroup section */\n\t\t04526B231CF3A2690090C5A3 /* Main.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t04526B241CF3A2690090C5A3 /* Base */,\n\t\t\t);\n\t\t\tname = Main.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t04526B321CF3A2690090C5A3 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"-\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.12;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t04526B331CF3A2690090C5A3 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"-\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.12;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t04526B351CF3A2690090C5A3 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCODE_SIGN_IDENTITY = \"-\";\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tINFOPLIST_FILE = JWTDesktop/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/../Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.io.jwt.JWTDesktop;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t04526B361CF3A2690090C5A3 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCODE_SIGN_IDENTITY = \"-\";\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tINFOPLIST_FILE = JWTDesktop/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/../Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.io.jwt.JWTDesktop;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t04526B381CF3A2690090C5A3 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tINFOPLIST_FILE = JWTDesktopTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/../Frameworks\",\n\t\t\t\t\t\"@loader_path/../Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.io.jwt.JWTDesktopTests;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/JWTDesktop.app/Contents/MacOS/JWTDesktop\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t04526B391CF3A2690090C5A3 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tBUNDLE_LOADER = \"$(TEST_HOST)\";\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tINFOPLIST_FILE = JWTDesktopTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/../Frameworks\",\n\t\t\t\t\t\"@loader_path/../Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.io.jwt.JWTDesktopTests;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTEST_HOST = \"$(BUILT_PRODUCTS_DIR)/JWTDesktop.app/Contents/MacOS/JWTDesktop\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t04526B101CF3A2690090C5A3 /* Build configuration list for PBXProject \"JWTDesktop\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t04526B321CF3A2690090C5A3 /* Debug */,\n\t\t\t\t04526B331CF3A2690090C5A3 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t04526B341CF3A2690090C5A3 /* Build configuration list for PBXNativeTarget \"JWTDesktop\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t04526B351CF3A2690090C5A3 /* Debug */,\n\t\t\t\t04526B361CF3A2690090C5A3 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t04526B371CF3A2690090C5A3 /* Build configuration list for PBXNativeTarget \"JWTDesktopTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t04526B381CF3A2690090C5A3 /* Debug */,\n\t\t\t\t04526B391CF3A2690090C5A3 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\n/* Begin XCSwiftPackageProductDependency section */\n\t\t0AC0027E27865AEB002167AD /* JWT */ = {\n\t\t\tisa = XCSwiftPackageProductDependency;\n\t\t\tproductName = JWT;\n\t\t};\n/* End XCSwiftPackageProductDependency section */\n\t};\n\trootObject = 04526B0D1CF3A2690090C5A3 /* Project object */;\n}\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktop.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IDEDidComputeMac32BitWarning</key>\n\t<true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktopTests/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Example/JWTDesktop/JWTDesktopTests/JWTDesktopTests.m",
    "content": "//\n//  JWTDesktopTests.m\n//  JWTDesktopTests\n//\n//  Created by Lobanov Dmitry on 23.05.16.\n//  Copyright © 2016 JWT. All rights reserved.\n//\n\n#import <XCTest/XCTest.h>\n\n@interface JWTDesktopTests : XCTestCase\n\n@end\n\n@implementation JWTDesktopTests\n\n- (void)setUp {\n    [super setUp];\n    // Put setup code here. This method is called before the invocation of each test method in the class.\n}\n\n- (void)tearDown {\n    // Put teardown code here. This method is called after the invocation of each test method in the class.\n    [super tearDown];\n}\n\n- (void)testExample {\n    // This is an example of a functional test case.\n    // Use XCTAssert and related functions to verify your tests produce the correct results.\n}\n\n- (void)testPerformanceExample {\n    // This is an example of a performance test case.\n    [self measureBlock:^{\n        // Put the code you want to measure the time of here.\n    }];\n}\n\n@end\n"
  },
  {
    "path": "Example/JWTDesktopSwift/JWTDesktopSwift/AppDelegate.swift",
    "content": "//\n//  AppDelegate.swift\n//  JWTDesktopSwift\n//\n//  Created by Lobanov Dmitry on 01.10.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\nimport Cocoa\n\n@NSApplicationMain\nclass AppDelegate: NSObject, NSApplicationDelegate {\n\n\n\n    func applicationDidFinishLaunching(_ aNotification: Notification) {\n        // Insert code here to initialize your application\n    }\n\n    func applicationWillTerminate(_ aNotification: Notification) {\n        // Insert code here to tear down your application\n    }\n}\n\n"
  },
  {
    "path": "Example/JWTDesktopSwift/JWTDesktopSwift/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"size\" : \"16x16\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"swift_jwt_icon_16x16.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"16x16\",\n      \"filename\" : \"swift_jwt_icon_32x32.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"32x32\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"swift_jwt_icon_32x32.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"32x32\",\n      \"filename\" : \"swift_jwt_icon_64x64.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"128x128\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"swift_jwt_icon_128x128.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"size\" : \"128x128\",\n      \"filename\" : \"swift_jwt_icon_256x256.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"256x256\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"swift_jwt_icon_256x256.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"256x256\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"swift_jwt_icon_512x512.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"512x512\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"swift_jwt_icon_512x512.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"512x512\",\n      \"idiom\" : \"mac\",\n      \"filename\" : \"swift_jwt_icon_1024x1024.png\",\n      \"scale\" : \"2x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "Example/JWTDesktopSwift/JWTDesktopSwift/Base.lproj/Main.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"14490.70\" targetRuntime=\"MacOSX.Cocoa\" propertyAccessControl=\"none\" useAutolayout=\"YES\" initialViewController=\"B8D-0N-5wS\">\n    <dependencies>\n        <deployment identifier=\"macosx\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.CocoaPlugin\" version=\"14490.70\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <scenes>\n        <!--Application-->\n        <scene sceneID=\"JPo-4y-FX3\">\n            <objects>\n                <application id=\"hnw-xV-0zn\" sceneMemberID=\"viewController\">\n                    <menu key=\"mainMenu\" title=\"Main Menu\" systemMenu=\"main\" id=\"AYu-sK-qS6\">\n                        <items>\n                            <menuItem title=\"JWTDesktop\" id=\"1Xt-HY-uBw\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <menu key=\"submenu\" title=\"JWTDesktop\" systemMenu=\"apple\" id=\"uQy-DD-JDr\">\n                                    <items>\n                                        <menuItem title=\"About JWTDesktop\" id=\"5kV-Vb-QxS\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <connections>\n                                                <action selector=\"orderFrontStandardAboutPanel:\" target=\"Ady-hI-5gd\" id=\"Exp-CZ-Vem\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"VOq-y0-SEH\"/>\n                                        <menuItem title=\"Preferences…\" keyEquivalent=\",\" id=\"BOF-NM-1cW\"/>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"wFC-TO-SCJ\"/>\n                                        <menuItem title=\"Services\" id=\"NMo-om-nkz\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Services\" systemMenu=\"services\" id=\"hz9-B4-Xy5\"/>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"4je-JR-u6R\"/>\n                                        <menuItem title=\"Hide JWTDesktop\" keyEquivalent=\"h\" id=\"Olw-nP-bQN\">\n                                            <connections>\n                                                <action selector=\"hide:\" target=\"Ady-hI-5gd\" id=\"PnN-Uc-m68\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Hide Others\" keyEquivalent=\"h\" id=\"Vdr-fp-XzO\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\" option=\"YES\" command=\"YES\"/>\n                                            <connections>\n                                                <action selector=\"hideOtherApplications:\" target=\"Ady-hI-5gd\" id=\"VT4-aY-XCT\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Show All\" id=\"Kd2-mp-pUS\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <connections>\n                                                <action selector=\"unhideAllApplications:\" target=\"Ady-hI-5gd\" id=\"Dhg-Le-xox\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"kCx-OE-vgT\"/>\n                                        <menuItem title=\"Quit JWTDesktop\" keyEquivalent=\"q\" id=\"4sb-4s-VLi\">\n                                            <connections>\n                                                <action selector=\"terminate:\" target=\"Ady-hI-5gd\" id=\"Te7-pn-YzF\"/>\n                                            </connections>\n                                        </menuItem>\n                                    </items>\n                                </menu>\n                            </menuItem>\n                            <menuItem title=\"File\" id=\"dMs-cI-mzQ\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <menu key=\"submenu\" title=\"File\" id=\"bib-Uj-vzu\">\n                                    <items>\n                                        <menuItem title=\"New\" keyEquivalent=\"n\" id=\"Was-JA-tGl\">\n                                            <connections>\n                                                <action selector=\"newDocument:\" target=\"Ady-hI-5gd\" id=\"4Si-XN-c54\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Open…\" keyEquivalent=\"o\" id=\"IAo-SY-fd9\">\n                                            <connections>\n                                                <action selector=\"openDocument:\" target=\"Ady-hI-5gd\" id=\"bVn-NM-KNZ\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Open Recent\" id=\"tXI-mr-wws\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Open Recent\" systemMenu=\"recentDocuments\" id=\"oas-Oc-fiZ\">\n                                                <items>\n                                                    <menuItem title=\"Clear Menu\" id=\"vNY-rz-j42\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"clearRecentDocuments:\" target=\"Ady-hI-5gd\" id=\"Daa-9d-B3U\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"m54-Is-iLE\"/>\n                                        <menuItem title=\"Close\" keyEquivalent=\"w\" id=\"DVo-aG-piG\">\n                                            <connections>\n                                                <action selector=\"performClose:\" target=\"Ady-hI-5gd\" id=\"HmO-Ls-i7Q\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Save…\" keyEquivalent=\"s\" id=\"pxx-59-PXV\">\n                                            <connections>\n                                                <action selector=\"saveDocument:\" target=\"Ady-hI-5gd\" id=\"teZ-XB-qJY\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Save As…\" keyEquivalent=\"S\" id=\"Bw7-FT-i3A\">\n                                            <connections>\n                                                <action selector=\"saveDocumentAs:\" target=\"Ady-hI-5gd\" id=\"mDf-zr-I0C\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Revert to Saved\" id=\"KaW-ft-85H\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <connections>\n                                                <action selector=\"revertDocumentToSaved:\" target=\"Ady-hI-5gd\" id=\"iJ3-Pv-kwq\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"aJh-i4-bef\"/>\n                                        <menuItem title=\"Page Setup…\" keyEquivalent=\"P\" id=\"qIS-W8-SiK\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\" shift=\"YES\" command=\"YES\"/>\n                                            <connections>\n                                                <action selector=\"runPageLayout:\" target=\"Ady-hI-5gd\" id=\"Din-rz-gC5\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Print…\" keyEquivalent=\"p\" id=\"aTl-1u-JFS\">\n                                            <connections>\n                                                <action selector=\"print:\" target=\"Ady-hI-5gd\" id=\"qaZ-4w-aoO\"/>\n                                            </connections>\n                                        </menuItem>\n                                    </items>\n                                </menu>\n                            </menuItem>\n                            <menuItem title=\"Edit\" id=\"5QF-Oa-p0T\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <menu key=\"submenu\" title=\"Edit\" id=\"W48-6f-4Dl\">\n                                    <items>\n                                        <menuItem title=\"Undo\" keyEquivalent=\"z\" id=\"dRJ-4n-Yzg\">\n                                            <connections>\n                                                <action selector=\"undo:\" target=\"Ady-hI-5gd\" id=\"M6e-cu-g7V\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Redo\" keyEquivalent=\"Z\" id=\"6dh-zS-Vam\">\n                                            <connections>\n                                                <action selector=\"redo:\" target=\"Ady-hI-5gd\" id=\"oIA-Rs-6OD\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"WRV-NI-Exz\"/>\n                                        <menuItem title=\"Cut\" keyEquivalent=\"x\" id=\"uRl-iY-unG\">\n                                            <connections>\n                                                <action selector=\"cut:\" target=\"Ady-hI-5gd\" id=\"YJe-68-I9s\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Copy\" keyEquivalent=\"c\" id=\"x3v-GG-iWU\">\n                                            <connections>\n                                                <action selector=\"copy:\" target=\"Ady-hI-5gd\" id=\"G1f-GL-Joy\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Paste\" keyEquivalent=\"v\" id=\"gVA-U4-sdL\">\n                                            <connections>\n                                                <action selector=\"paste:\" target=\"Ady-hI-5gd\" id=\"UvS-8e-Qdg\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Paste and Match Style\" keyEquivalent=\"V\" id=\"WeT-3V-zwk\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\" option=\"YES\" command=\"YES\"/>\n                                            <connections>\n                                                <action selector=\"pasteAsPlainText:\" target=\"Ady-hI-5gd\" id=\"cEh-KX-wJQ\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Delete\" id=\"pa3-QI-u2k\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <connections>\n                                                <action selector=\"delete:\" target=\"Ady-hI-5gd\" id=\"0Mk-Ml-PaM\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Select All\" keyEquivalent=\"a\" id=\"Ruw-6m-B2m\">\n                                            <connections>\n                                                <action selector=\"selectAll:\" target=\"Ady-hI-5gd\" id=\"VNm-Mi-diN\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"uyl-h8-XO2\"/>\n                                        <menuItem title=\"Find\" id=\"4EN-yA-p0u\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Find\" id=\"1b7-l0-nxx\">\n                                                <items>\n                                                    <menuItem title=\"Find…\" tag=\"1\" keyEquivalent=\"f\" id=\"Xz5-n4-O0W\">\n                                                        <connections>\n                                                            <action selector=\"performFindPanelAction:\" target=\"Ady-hI-5gd\" id=\"cD7-Qs-BN4\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Find and Replace…\" tag=\"12\" keyEquivalent=\"f\" id=\"YEy-JH-Tfz\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\" option=\"YES\" command=\"YES\"/>\n                                                        <connections>\n                                                            <action selector=\"performFindPanelAction:\" target=\"Ady-hI-5gd\" id=\"WD3-Gg-5AJ\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Find Next\" tag=\"2\" keyEquivalent=\"g\" id=\"q09-fT-Sye\">\n                                                        <connections>\n                                                            <action selector=\"performFindPanelAction:\" target=\"Ady-hI-5gd\" id=\"NDo-RZ-v9R\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Find Previous\" tag=\"3\" keyEquivalent=\"G\" id=\"OwM-mh-QMV\">\n                                                        <connections>\n                                                            <action selector=\"performFindPanelAction:\" target=\"Ady-hI-5gd\" id=\"HOh-sY-3ay\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Use Selection for Find\" tag=\"7\" keyEquivalent=\"e\" id=\"buJ-ug-pKt\">\n                                                        <connections>\n                                                            <action selector=\"performFindPanelAction:\" target=\"Ady-hI-5gd\" id=\"U76-nv-p5D\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Jump to Selection\" keyEquivalent=\"j\" id=\"S0p-oC-mLd\">\n                                                        <connections>\n                                                            <action selector=\"centerSelectionInVisibleArea:\" target=\"Ady-hI-5gd\" id=\"IOG-6D-g5B\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                        <menuItem title=\"Spelling and Grammar\" id=\"Dv1-io-Yv7\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Spelling\" id=\"3IN-sU-3Bg\">\n                                                <items>\n                                                    <menuItem title=\"Show Spelling and Grammar\" keyEquivalent=\":\" id=\"HFo-cy-zxI\">\n                                                        <connections>\n                                                            <action selector=\"showGuessPanel:\" target=\"Ady-hI-5gd\" id=\"vFj-Ks-hy3\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Check Document Now\" keyEquivalent=\";\" id=\"hz2-CU-CR7\">\n                                                        <connections>\n                                                            <action selector=\"checkSpelling:\" target=\"Ady-hI-5gd\" id=\"fz7-VC-reM\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"bNw-od-mp5\"/>\n                                                    <menuItem title=\"Check Spelling While Typing\" id=\"rbD-Rh-wIN\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleContinuousSpellChecking:\" target=\"Ady-hI-5gd\" id=\"7w6-Qz-0kB\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Check Grammar With Spelling\" id=\"mK6-2p-4JG\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleGrammarChecking:\" target=\"Ady-hI-5gd\" id=\"muD-Qn-j4w\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Correct Spelling Automatically\" id=\"78Y-hA-62v\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleAutomaticSpellingCorrection:\" target=\"Ady-hI-5gd\" id=\"2lM-Qi-WAP\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                        <menuItem title=\"Substitutions\" id=\"9ic-FL-obx\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Substitutions\" id=\"FeM-D8-WVr\">\n                                                <items>\n                                                    <menuItem title=\"Show Substitutions\" id=\"z6F-FW-3nz\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"orderFrontSubstitutionsPanel:\" target=\"Ady-hI-5gd\" id=\"oku-mr-iSq\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"gPx-C9-uUO\"/>\n                                                    <menuItem title=\"Smart Copy/Paste\" id=\"9yt-4B-nSM\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleSmartInsertDelete:\" target=\"Ady-hI-5gd\" id=\"3IJ-Se-DZD\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Smart Quotes\" id=\"hQb-2v-fYv\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleAutomaticQuoteSubstitution:\" target=\"Ady-hI-5gd\" id=\"ptq-xd-QOA\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Smart Dashes\" id=\"rgM-f4-ycn\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleAutomaticDashSubstitution:\" target=\"Ady-hI-5gd\" id=\"oCt-pO-9gS\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Smart Links\" id=\"cwL-P1-jid\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleAutomaticLinkDetection:\" target=\"Ady-hI-5gd\" id=\"Gip-E3-Fov\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Data Detectors\" id=\"tRr-pd-1PS\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleAutomaticDataDetection:\" target=\"Ady-hI-5gd\" id=\"R1I-Nq-Kbl\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Text Replacement\" id=\"HFQ-gK-NFA\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleAutomaticTextReplacement:\" target=\"Ady-hI-5gd\" id=\"DvP-Fe-Py6\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                        <menuItem title=\"Transformations\" id=\"2oI-Rn-ZJC\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Transformations\" id=\"c8a-y6-VQd\">\n                                                <items>\n                                                    <menuItem title=\"Make Upper Case\" id=\"vmV-6d-7jI\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"uppercaseWord:\" target=\"Ady-hI-5gd\" id=\"sPh-Tk-edu\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Make Lower Case\" id=\"d9M-CD-aMd\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"lowercaseWord:\" target=\"Ady-hI-5gd\" id=\"iUZ-b5-hil\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Capitalize\" id=\"UEZ-Bs-lqG\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"capitalizeWord:\" target=\"Ady-hI-5gd\" id=\"26H-TL-nsh\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                        <menuItem title=\"Speech\" id=\"xrE-MZ-jX0\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Speech\" id=\"3rS-ZA-NoH\">\n                                                <items>\n                                                    <menuItem title=\"Start Speaking\" id=\"Ynk-f8-cLZ\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"startSpeaking:\" target=\"Ady-hI-5gd\" id=\"654-Ng-kyl\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Stop Speaking\" id=\"Oyz-dy-DGm\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"stopSpeaking:\" target=\"Ady-hI-5gd\" id=\"dX8-6p-jy9\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                    </items>\n                                </menu>\n                            </menuItem>\n                            <menuItem title=\"Format\" id=\"jxT-CU-nIS\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <menu key=\"submenu\" title=\"Format\" id=\"GEO-Iw-cKr\">\n                                    <items>\n                                        <menuItem title=\"Font\" id=\"Gi5-1S-RQB\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Font\" systemMenu=\"font\" id=\"aXa-aM-Jaq\">\n                                                <items>\n                                                    <menuItem title=\"Show Fonts\" keyEquivalent=\"t\" id=\"Q5e-8K-NDq\"/>\n                                                    <menuItem title=\"Bold\" tag=\"2\" keyEquivalent=\"b\" id=\"GB9-OM-e27\"/>\n                                                    <menuItem title=\"Italic\" tag=\"1\" keyEquivalent=\"i\" id=\"Vjx-xi-njq\"/>\n                                                    <menuItem title=\"Underline\" keyEquivalent=\"u\" id=\"WRG-CD-K1S\">\n                                                        <connections>\n                                                            <action selector=\"underline:\" target=\"Ady-hI-5gd\" id=\"FYS-2b-JAY\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"5gT-KC-WSO\"/>\n                                                    <menuItem title=\"Bigger\" tag=\"3\" keyEquivalent=\"+\" id=\"Ptp-SP-VEL\"/>\n                                                    <menuItem title=\"Smaller\" tag=\"4\" keyEquivalent=\"-\" id=\"i1d-Er-qST\"/>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"kx3-Dk-x3B\"/>\n                                                    <menuItem title=\"Kern\" id=\"jBQ-r6-VK2\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <menu key=\"submenu\" title=\"Kern\" id=\"tlD-Oa-oAM\">\n                                                            <items>\n                                                                <menuItem title=\"Use Default\" id=\"GUa-eO-cwY\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"useStandardKerning:\" target=\"Ady-hI-5gd\" id=\"6dk-9l-Ckg\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Use None\" id=\"cDB-IK-hbR\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"turnOffKerning:\" target=\"Ady-hI-5gd\" id=\"U8a-gz-Maa\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Tighten\" id=\"46P-cB-AYj\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"tightenKerning:\" target=\"Ady-hI-5gd\" id=\"hr7-Nz-8ro\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Loosen\" id=\"ogc-rX-tC1\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"loosenKerning:\" target=\"Ady-hI-5gd\" id=\"8i4-f9-FKE\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                            </items>\n                                                        </menu>\n                                                    </menuItem>\n                                                    <menuItem title=\"Ligatures\" id=\"o6e-r0-MWq\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <menu key=\"submenu\" title=\"Ligatures\" id=\"w0m-vy-SC9\">\n                                                            <items>\n                                                                <menuItem title=\"Use Default\" id=\"agt-UL-0e3\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"useStandardLigatures:\" target=\"Ady-hI-5gd\" id=\"7uR-wd-Dx6\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Use None\" id=\"J7y-lM-qPV\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"turnOffLigatures:\" target=\"Ady-hI-5gd\" id=\"iX2-gA-Ilz\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Use All\" id=\"xQD-1f-W4t\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"useAllLigatures:\" target=\"Ady-hI-5gd\" id=\"KcB-kA-TuK\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                            </items>\n                                                        </menu>\n                                                    </menuItem>\n                                                    <menuItem title=\"Baseline\" id=\"OaQ-X3-Vso\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <menu key=\"submenu\" title=\"Baseline\" id=\"ijk-EB-dga\">\n                                                            <items>\n                                                                <menuItem title=\"Use Default\" id=\"3Om-Ey-2VK\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"unscript:\" target=\"Ady-hI-5gd\" id=\"0vZ-95-Ywn\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Superscript\" id=\"Rqc-34-cIF\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"superscript:\" target=\"Ady-hI-5gd\" id=\"3qV-fo-wpU\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Subscript\" id=\"I0S-gh-46l\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"subscript:\" target=\"Ady-hI-5gd\" id=\"Q6W-4W-IGz\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Raise\" id=\"2h7-ER-AoG\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"raiseBaseline:\" target=\"Ady-hI-5gd\" id=\"4sk-31-7Q9\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem title=\"Lower\" id=\"1tx-W0-xDw\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"lowerBaseline:\" target=\"Ady-hI-5gd\" id=\"OF1-bc-KW4\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                            </items>\n                                                        </menu>\n                                                    </menuItem>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"Ndw-q3-faq\"/>\n                                                    <menuItem title=\"Show Colors\" keyEquivalent=\"C\" id=\"bgn-CT-cEk\">\n                                                        <connections>\n                                                            <action selector=\"orderFrontColorPanel:\" target=\"Ady-hI-5gd\" id=\"mSX-Xz-DV3\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"iMs-zA-UFJ\"/>\n                                                    <menuItem title=\"Copy Style\" keyEquivalent=\"c\" id=\"5Vv-lz-BsD\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\" option=\"YES\" command=\"YES\"/>\n                                                        <connections>\n                                                            <action selector=\"copyFont:\" target=\"Ady-hI-5gd\" id=\"GJO-xA-L4q\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Paste Style\" keyEquivalent=\"v\" id=\"vKC-jM-MkH\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\" option=\"YES\" command=\"YES\"/>\n                                                        <connections>\n                                                            <action selector=\"pasteFont:\" target=\"Ady-hI-5gd\" id=\"JfD-CL-leO\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                        <menuItem title=\"Text\" id=\"Fal-I4-PZk\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <menu key=\"submenu\" title=\"Text\" id=\"d9c-me-L2H\">\n                                                <items>\n                                                    <menuItem title=\"Align Left\" keyEquivalent=\"{\" id=\"ZM1-6Q-yy1\">\n                                                        <connections>\n                                                            <action selector=\"alignLeft:\" target=\"Ady-hI-5gd\" id=\"zUv-R1-uAa\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Center\" keyEquivalent=\"|\" id=\"VIY-Ag-zcb\">\n                                                        <connections>\n                                                            <action selector=\"alignCenter:\" target=\"Ady-hI-5gd\" id=\"spX-mk-kcS\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Justify\" id=\"J5U-5w-g23\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"alignJustified:\" target=\"Ady-hI-5gd\" id=\"ljL-7U-jND\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Align Right\" keyEquivalent=\"}\" id=\"wb2-vD-lq4\">\n                                                        <connections>\n                                                            <action selector=\"alignRight:\" target=\"Ady-hI-5gd\" id=\"r48-bG-YeY\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"4s2-GY-VfK\"/>\n                                                    <menuItem title=\"Writing Direction\" id=\"H1b-Si-o9J\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <menu key=\"submenu\" title=\"Writing Direction\" id=\"8mr-sm-Yjd\">\n                                                            <items>\n                                                                <menuItem title=\"Paragraph\" enabled=\"NO\" id=\"ZvO-Gk-QUH\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                </menuItem>\n                                                                <menuItem id=\"YGs-j5-SAR\">\n                                                                    <string key=\"title\">\tDefault</string>\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"makeBaseWritingDirectionNatural:\" target=\"Ady-hI-5gd\" id=\"qtV-5e-UBP\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem id=\"Lbh-J2-qVU\">\n                                                                    <string key=\"title\">\tLeft to Right</string>\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"makeBaseWritingDirectionLeftToRight:\" target=\"Ady-hI-5gd\" id=\"S0X-9S-QSf\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem id=\"jFq-tB-4Kx\">\n                                                                    <string key=\"title\">\tRight to Left</string>\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"makeBaseWritingDirectionRightToLeft:\" target=\"Ady-hI-5gd\" id=\"5fk-qB-AqJ\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem isSeparatorItem=\"YES\" id=\"swp-gr-a21\"/>\n                                                                <menuItem title=\"Selection\" enabled=\"NO\" id=\"cqv-fj-IhA\">\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                </menuItem>\n                                                                <menuItem id=\"Nop-cj-93Q\">\n                                                                    <string key=\"title\">\tDefault</string>\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"makeTextWritingDirectionNatural:\" target=\"Ady-hI-5gd\" id=\"lPI-Se-ZHp\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem id=\"BgM-ve-c93\">\n                                                                    <string key=\"title\">\tLeft to Right</string>\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"makeTextWritingDirectionLeftToRight:\" target=\"Ady-hI-5gd\" id=\"caW-Bv-w94\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                                <menuItem id=\"RB4-Sm-HuC\">\n                                                                    <string key=\"title\">\tRight to Left</string>\n                                                                    <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                                    <connections>\n                                                                        <action selector=\"makeTextWritingDirectionRightToLeft:\" target=\"Ady-hI-5gd\" id=\"EXD-6r-ZUu\"/>\n                                                                    </connections>\n                                                                </menuItem>\n                                                            </items>\n                                                        </menu>\n                                                    </menuItem>\n                                                    <menuItem isSeparatorItem=\"YES\" id=\"fKy-g9-1gm\"/>\n                                                    <menuItem title=\"Show Ruler\" id=\"vLm-3I-IUL\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                                        <connections>\n                                                            <action selector=\"toggleRuler:\" target=\"Ady-hI-5gd\" id=\"FOx-HJ-KwY\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Copy Ruler\" keyEquivalent=\"c\" id=\"MkV-Pr-PK5\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\" control=\"YES\" command=\"YES\"/>\n                                                        <connections>\n                                                            <action selector=\"copyRuler:\" target=\"Ady-hI-5gd\" id=\"71i-fW-3W2\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                    <menuItem title=\"Paste Ruler\" keyEquivalent=\"v\" id=\"LVM-kO-fVI\">\n                                                        <modifierMask key=\"keyEquivalentModifierMask\" control=\"YES\" command=\"YES\"/>\n                                                        <connections>\n                                                            <action selector=\"pasteRuler:\" target=\"Ady-hI-5gd\" id=\"cSh-wd-qM2\"/>\n                                                        </connections>\n                                                    </menuItem>\n                                                </items>\n                                            </menu>\n                                        </menuItem>\n                                    </items>\n                                </menu>\n                            </menuItem>\n                            <menuItem title=\"View\" id=\"H8h-7b-M4v\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <menu key=\"submenu\" title=\"View\" id=\"HyV-fh-RgO\">\n                                    <items>\n                                        <menuItem title=\"Show Toolbar\" keyEquivalent=\"t\" id=\"snW-S8-Cw5\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\" option=\"YES\" command=\"YES\"/>\n                                            <connections>\n                                                <action selector=\"toggleToolbarShown:\" target=\"Ady-hI-5gd\" id=\"BXY-wc-z0C\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Customize Toolbar…\" id=\"1UK-8n-QPP\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <connections>\n                                                <action selector=\"runToolbarCustomizationPalette:\" target=\"Ady-hI-5gd\" id=\"pQI-g3-MTW\"/>\n                                            </connections>\n                                        </menuItem>\n                                    </items>\n                                </menu>\n                            </menuItem>\n                            <menuItem title=\"Window\" id=\"aUF-d1-5bR\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <menu key=\"submenu\" title=\"Window\" systemMenu=\"window\" id=\"Td7-aD-5lo\">\n                                    <items>\n                                        <menuItem title=\"Minimize\" keyEquivalent=\"m\" id=\"OY7-WF-poV\">\n                                            <connections>\n                                                <action selector=\"performMiniaturize:\" target=\"Ady-hI-5gd\" id=\"VwT-WD-YPe\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem title=\"Zoom\" id=\"R4o-n2-Eq4\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <connections>\n                                                <action selector=\"performZoom:\" target=\"Ady-hI-5gd\" id=\"DIl-cC-cCs\"/>\n                                            </connections>\n                                        </menuItem>\n                                        <menuItem isSeparatorItem=\"YES\" id=\"eu3-7i-yIM\"/>\n                                        <menuItem title=\"Bring All to Front\" id=\"LE2-aR-0XJ\">\n                                            <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                            <connections>\n                                                <action selector=\"arrangeInFront:\" target=\"Ady-hI-5gd\" id=\"DRN-fu-gQh\"/>\n                                            </connections>\n                                        </menuItem>\n                                    </items>\n                                </menu>\n                            </menuItem>\n                            <menuItem title=\"Help\" id=\"wpr-3q-Mcd\">\n                                <modifierMask key=\"keyEquivalentModifierMask\"/>\n                                <menu key=\"submenu\" title=\"Help\" systemMenu=\"help\" id=\"F2S-fz-NVQ\">\n                                    <items>\n                                        <menuItem title=\"JWTDesktop Help\" keyEquivalent=\"?\" id=\"FKE-Sm-Kum\">\n                                            <connections>\n                                                <action selector=\"showHelp:\" target=\"Ady-hI-5gd\" id=\"y7X-2Q-9no\"/>\n                                            </connections>\n                                        </menuItem>\n                                    </items>\n                                </menu>\n                            </menuItem>\n                        </items>\n                    </menu>\n                    <connections>\n                        <outlet property=\"delegate\" destination=\"Voe-Tx-rLC\" id=\"PrD-fu-P6m\"/>\n                    </connections>\n                </application>\n                <customObject id=\"Voe-Tx-rLC\" customClass=\"AppDelegate\" customModule=\"JWTDesktopSwift\" customModuleProvider=\"target\"/>\n                <customObject id=\"Ady-hI-5gd\" userLabel=\"First Responder\" customClass=\"NSResponder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"75\" y=\"0.0\"/>\n        </scene>\n        <!--Window Controller-->\n        <scene sceneID=\"R2V-B0-nI4\">\n            <objects>\n                <windowController id=\"B8D-0N-5wS\" sceneMemberID=\"viewController\">\n                    <window key=\"window\" title=\"Window\" allowsToolTipsWhenApplicationIsInactive=\"NO\" autorecalculatesKeyViewLoop=\"NO\" releasedWhenClosed=\"NO\" visibleAtLaunch=\"NO\" animationBehavior=\"default\" id=\"IQv-IB-iLA\">\n                        <windowStyleMask key=\"styleMask\" titled=\"YES\" closable=\"YES\" miniaturizable=\"YES\" resizable=\"YES\"/>\n                        <windowPositionMask key=\"initialPositionMask\" leftStrut=\"YES\" rightStrut=\"YES\" topStrut=\"YES\" bottomStrut=\"YES\"/>\n                        <rect key=\"contentRect\" x=\"196\" y=\"240\" width=\"480\" height=\"270\"/>\n                        <rect key=\"screenRect\" x=\"0.0\" y=\"0.0\" width=\"1680\" height=\"1027\"/>\n                        <connections>\n                            <outlet property=\"delegate\" destination=\"B8D-0N-5wS\" id=\"byT-N1-ogF\"/>\n                        </connections>\n                    </window>\n                    <connections>\n                        <segue destination=\"XfG-lQ-9wD\" kind=\"relationship\" relationship=\"window.shadowedContentViewController\" id=\"cq2-FE-JQM\"/>\n                    </connections>\n                </windowController>\n                <customObject id=\"Oky-zY-oP4\" userLabel=\"First Responder\" customClass=\"NSResponder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"75\" y=\"250\"/>\n        </scene>\n        <!--View Controller-->\n        <scene sceneID=\"hIz-AP-VOD\">\n            <objects>\n                <viewController id=\"XfG-lQ-9wD\" customClass=\"ViewController\" customModule=\"JWTDesktopSwift\" customModuleProvider=\"target\" sceneMemberID=\"viewController\">\n                    <view key=\"view\" id=\"m2S-Jp-Qdl\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"419\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                        <subviews>\n                            <textField horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"750\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"D7O-XY-wd0\" userLabel=\"AlgorithmLabel\">\n                                <rect key=\"frame\" x=\"200\" y=\"372\" width=\"42\" height=\"17\"/>\n                                <constraints>\n                                    <constraint firstAttribute=\"height\" constant=\"17\" id=\"ogT-iD-x9z\"/>\n                                </constraints>\n                                <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" sendsActionOnEndEditing=\"YES\" title=\"Label\" id=\"Mqt-PB-Gyr\">\n                                    <font key=\"font\" metaFont=\"system\" size=\"15\"/>\n                                    <color key=\"textColor\" name=\"labelColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                </textFieldCell>\n                            </textField>\n                            <popUpButton verticalHuggingPriority=\"750\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"yLZ-Ur-huV\" userLabel=\"AlgorithmPopUpButton\">\n                                <rect key=\"frame\" x=\"246\" y=\"367\" width=\"77\" height=\"25\"/>\n                                <popUpButtonCell key=\"cell\" type=\"push\" title=\"Item 1\" bezelStyle=\"rounded\" alignment=\"left\" lineBreakMode=\"truncatingTail\" state=\"on\" borderStyle=\"borderAndBezel\" imageScaling=\"proportionallyDown\" inset=\"2\" selectedItem=\"ZCZ-l0-XGK\" id=\"MuX-3E-XCZ\">\n                                    <behavior key=\"behavior\" lightByBackground=\"YES\" lightByGray=\"YES\"/>\n                                    <font key=\"font\" metaFont=\"menu\"/>\n                                    <menu key=\"menu\" id=\"tac-Di-AVm\">\n                                        <items>\n                                            <menuItem title=\"Item 1\" state=\"on\" id=\"ZCZ-l0-XGK\"/>\n                                            <menuItem title=\"Item 2\" id=\"vFH-Hr-A7D\"/>\n                                            <menuItem title=\"Item 3\" id=\"Lh6-h4-7w2\"/>\n                                        </items>\n                                    </menu>\n                                </popUpButtonCell>\n                            </popUpButton>\n                            <scrollView horizontalLineScroll=\"10\" horizontalPageScroll=\"10\" verticalLineScroll=\"10\" verticalPageScroll=\"10\" hasHorizontalScroller=\"NO\" usesPredominantAxisScrolling=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"vXl-0B-yeH\" userLabel=\"EncodedTextView\">\n                                <rect key=\"frame\" x=\"0.0\" y=\"60\" width=\"240\" height=\"214\"/>\n                                <clipView key=\"contentView\" drawsBackground=\"NO\" id=\"R7p-T4-mLk\">\n                                    <rect key=\"frame\" x=\"1\" y=\"1\" width=\"223\" height=\"212\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                    <subviews>\n                                        <textView importsGraphics=\"NO\" verticallyResizable=\"YES\" usesFontPanel=\"YES\" findStyle=\"panel\" continuousSpellChecking=\"YES\" allowsUndo=\"YES\" usesRuler=\"YES\" allowsNonContiguousLayout=\"YES\" quoteSubstitution=\"YES\" dashSubstitution=\"YES\" spellingCorrection=\"YES\" smartInsertDelete=\"YES\" id=\"RyK-m8-XF3\">\n                                            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"223\" height=\"212\"/>\n                                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                            <color key=\"textColor\" name=\"textColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                            <color key=\"backgroundColor\" name=\"textBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                            <size key=\"minSize\" width=\"223\" height=\"212\"/>\n                                            <size key=\"maxSize\" width=\"463\" height=\"10000000\"/>\n                                            <color key=\"insertionPointColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                        </textView>\n                                    </subviews>\n                                </clipView>\n                                <scroller key=\"horizontalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" doubleValue=\"1\" horizontal=\"YES\" id=\"SoX-cs-HKu\">\n                                    <rect key=\"frame\" x=\"-100\" y=\"-100\" width=\"87\" height=\"18\"/>\n                                    <autoresizingMask key=\"autoresizingMask\"/>\n                                </scroller>\n                                <scroller key=\"verticalScroller\" verticalHuggingPriority=\"750\" horizontal=\"NO\" id=\"zi3-uo-nJE\">\n                                    <rect key=\"frame\" x=\"224\" y=\"1\" width=\"15\" height=\"212\"/>\n                                    <autoresizingMask key=\"autoresizingMask\"/>\n                                </scroller>\n                            </scrollView>\n                            <textField horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"750\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"z9r-5V-pdS\" userLabel=\"SignatureStatusLabel\">\n                                <rect key=\"frame\" x=\"-2\" y=\"0.0\" width=\"484\" height=\"42\"/>\n                                <constraints>\n                                    <constraint firstAttribute=\"height\" constant=\"42\" id=\"6dl-ZT-MyL\"/>\n                                </constraints>\n                                <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" sendsActionOnEndEditing=\"YES\" title=\"Label\" id=\"VyQ-In-KTB\">\n                                    <font key=\"font\" metaFont=\"system\" size=\"20\"/>\n                                    <color key=\"textColor\" name=\"labelColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                </textFieldCell>\n                            </textField>\n                            <customView translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"onc-Qp-bvF\" userLabel=\"DecriptedView\">\n                                <rect key=\"frame\" x=\"240\" y=\"60\" width=\"240\" height=\"214\"/>\n                            </customView>\n                            <scrollView hidden=\"YES\" autohidesScrollers=\"YES\" horizontalLineScroll=\"19\" horizontalPageScroll=\"10\" verticalLineScroll=\"19\" verticalPageScroll=\"10\" usesPredominantAxisScrolling=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"YfF-j3-Hxy\">\n                                <rect key=\"frame\" x=\"240\" y=\"60\" width=\"240\" height=\"214\"/>\n                                <clipView key=\"contentView\" id=\"EN9-WY-TeV\">\n                                    <rect key=\"frame\" x=\"1\" y=\"0.0\" width=\"238\" height=\"213\"/>\n                                    <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                    <subviews>\n                                        <tableView verticalHuggingPriority=\"750\" allowsExpansionToolTips=\"YES\" columnAutoresizingStyle=\"lastColumnOnly\" columnSelection=\"YES\" multipleSelection=\"NO\" autosaveColumns=\"NO\" rowSizeStyle=\"automatic\" headerView=\"XGD-yA-t3I\" viewBased=\"YES\" id=\"k0L-7X-cJD\">\n                                            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"238\" height=\"190\"/>\n                                            <autoresizingMask key=\"autoresizingMask\"/>\n                                            <size key=\"intercellSpacing\" width=\"3\" height=\"2\"/>\n                                            <color key=\"backgroundColor\" name=\"controlBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                            <color key=\"gridColor\" name=\"gridColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                            <tableColumns>\n                                                <tableColumn width=\"116\" minWidth=\"40\" maxWidth=\"1000\" id=\"LUu-TS-BnO\">\n                                                    <tableHeaderCell key=\"headerCell\" lineBreakMode=\"truncatingTail\" borderStyle=\"border\">\n                                                        <font key=\"font\" metaFont=\"smallSystem\"/>\n                                                        <color key=\"textColor\" name=\"headerTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        <color key=\"backgroundColor\" name=\"headerColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                    </tableHeaderCell>\n                                                    <textFieldCell key=\"dataCell\" lineBreakMode=\"truncatingTail\" selectable=\"YES\" editable=\"YES\" title=\"Text Cell\" id=\"zVw-sn-xsB\">\n                                                        <font key=\"font\" metaFont=\"system\"/>\n                                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        <color key=\"backgroundColor\" name=\"controlBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                    </textFieldCell>\n                                                    <tableColumnResizingMask key=\"resizingMask\" resizeWithTable=\"YES\" userResizable=\"YES\"/>\n                                                    <prototypeCellViews>\n                                                        <tableCellView id=\"Ndj-Sw-gih\">\n                                                            <rect key=\"frame\" x=\"1\" y=\"1\" width=\"116\" height=\"17\"/>\n                                                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                                            <subviews>\n                                                                <textField verticalHuggingPriority=\"750\" horizontalCompressionResistancePriority=\"250\" fixedFrame=\"YES\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"ECA-No-Hn9\">\n                                                                    <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"100\" height=\"17\"/>\n                                                                    <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                                                    <textFieldCell key=\"cell\" lineBreakMode=\"truncatingTail\" sendsActionOnEndEditing=\"YES\" title=\"Table View Cell\" id=\"ZpF-cY-Xm5\">\n                                                                        <font key=\"font\" metaFont=\"system\"/>\n                                                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                                    </textFieldCell>\n                                                                </textField>\n                                                            </subviews>\n                                                            <connections>\n                                                                <outlet property=\"textField\" destination=\"ECA-No-Hn9\" id=\"osv-Pt-m98\"/>\n                                                            </connections>\n                                                        </tableCellView>\n                                                    </prototypeCellViews>\n                                                </tableColumn>\n                                                <tableColumn width=\"116\" minWidth=\"40\" maxWidth=\"1000\" id=\"57l-wv-6gg\">\n                                                    <tableHeaderCell key=\"headerCell\" lineBreakMode=\"truncatingTail\" borderStyle=\"border\">\n                                                        <font key=\"font\" metaFont=\"smallSystem\"/>\n                                                        <color key=\"textColor\" name=\"headerTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        <color key=\"backgroundColor\" name=\"headerColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                    </tableHeaderCell>\n                                                    <textFieldCell key=\"dataCell\" lineBreakMode=\"truncatingTail\" selectable=\"YES\" editable=\"YES\" title=\"Text Cell\" id=\"pzs-PF-w82\">\n                                                        <font key=\"font\" metaFont=\"system\"/>\n                                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                        <color key=\"backgroundColor\" name=\"controlBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                    </textFieldCell>\n                                                    <tableColumnResizingMask key=\"resizingMask\" resizeWithTable=\"YES\" userResizable=\"YES\"/>\n                                                    <prototypeCellViews>\n                                                        <tableCellView id=\"VaR-Ux-pdL\">\n                                                            <rect key=\"frame\" x=\"120\" y=\"1\" width=\"116\" height=\"17\"/>\n                                                            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                                            <subviews>\n                                                                <textField verticalHuggingPriority=\"750\" horizontalCompressionResistancePriority=\"250\" fixedFrame=\"YES\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"M6U-vg-KMX\">\n                                                                    <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"100\" height=\"17\"/>\n                                                                    <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n                                                                    <textFieldCell key=\"cell\" lineBreakMode=\"truncatingTail\" sendsActionOnEndEditing=\"YES\" title=\"Table View Cell\" id=\"Thw-Ot-bJy\">\n                                                                        <font key=\"font\" metaFont=\"system\"/>\n                                                                        <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                                                    </textFieldCell>\n                                                                </textField>\n                                                            </subviews>\n                                                            <connections>\n                                                                <outlet property=\"textField\" destination=\"M6U-vg-KMX\" id=\"RwW-7Y-Ysb\"/>\n                                                            </connections>\n                                                        </tableCellView>\n                                                    </prototypeCellViews>\n                                                </tableColumn>\n                                            </tableColumns>\n                                        </tableView>\n                                    </subviews>\n                                </clipView>\n                                <scroller key=\"horizontalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" horizontal=\"YES\" id=\"ZeW-jA-PoF\">\n                                    <rect key=\"frame\" x=\"1\" y=\"403\" width=\"0.0\" height=\"15\"/>\n                                    <autoresizingMask key=\"autoresizingMask\"/>\n                                </scroller>\n                                <scroller key=\"verticalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" horizontal=\"NO\" id=\"HyQ-Zd-Vdq\">\n                                    <rect key=\"frame\" x=\"224\" y=\"17\" width=\"15\" height=\"102\"/>\n                                    <autoresizingMask key=\"autoresizingMask\"/>\n                                </scroller>\n                                <tableHeaderView key=\"headerView\" id=\"XGD-yA-t3I\">\n                                    <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"238\" height=\"23\"/>\n                                    <autoresizingMask key=\"autoresizingMask\"/>\n                                </tableHeaderView>\n                            </scrollView>\n                            <textField horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"750\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"r3U-FI-Ege\" userLabel=\"SecretLabel\">\n                                <rect key=\"frame\" x=\"200\" y=\"333\" width=\"42\" height=\"19\"/>\n                                <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" sendsActionOnEndEditing=\"YES\" title=\"Label\" id=\"fQG-yn-1WT\">\n                                    <font key=\"font\" metaFont=\"system\" size=\"15\"/>\n                                    <color key=\"textColor\" name=\"labelColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                </textFieldCell>\n                            </textField>\n                            <textField verticalHuggingPriority=\"750\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"BTt-D8-1HI\" userLabel=\"SecretTextField\">\n                                <rect key=\"frame\" x=\"248\" y=\"332\" width=\"96\" height=\"22\"/>\n                                <constraints>\n                                    <constraint firstAttribute=\"width\" constant=\"96\" id=\"s60-lV-Tu8\"/>\n                                </constraints>\n                                <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" selectable=\"YES\" editable=\"YES\" sendsActionOnEndEditing=\"YES\" state=\"on\" borderStyle=\"bezel\" drawsBackground=\"YES\" id=\"Bvo-u9-SsL\">\n                                    <font key=\"font\" metaFont=\"system\"/>\n                                    <color key=\"textColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    <color key=\"backgroundColor\" name=\"textBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                </textFieldCell>\n                            </textField>\n                            <button translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"Keu-Ro-sxF\" userLabel=\"SecretBase64EncodedCheckButton\">\n                                <rect key=\"frame\" x=\"350\" y=\"334\" width=\"61\" height=\"18\"/>\n                                <buttonCell key=\"cell\" type=\"check\" title=\"Check\" bezelStyle=\"regularSquare\" imagePosition=\"left\" state=\"on\" inset=\"2\" id=\"Gz5-wv-UKC\">\n                                    <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                    <font key=\"font\" metaFont=\"system\"/>\n                                </buttonCell>\n                            </button>\n                            <textField horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"750\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"PqZ-lL-ZBX\" userLabel=\"SignatureLabel\">\n                                <rect key=\"frame\" x=\"200\" y=\"294\" width=\"42\" height=\"19\"/>\n                                <textFieldCell key=\"cell\" scrollable=\"YES\" lineBreakMode=\"clipping\" sendsActionOnEndEditing=\"YES\" title=\"Label\" id=\"rJm-RR-O3u\">\n                                    <font key=\"font\" metaFont=\"system\" size=\"15\"/>\n                                    <color key=\"textColor\" name=\"labelColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                    <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                                </textFieldCell>\n                            </textField>\n                            <button translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"Gg7-4R-abT\" userLabel=\"SignatureVerificationCheckButton\">\n                                <rect key=\"frame\" x=\"246\" y=\"295\" width=\"61\" height=\"18\"/>\n                                <buttonCell key=\"cell\" type=\"check\" title=\"Check\" bezelStyle=\"regularSquare\" imagePosition=\"left\" state=\"on\" inset=\"2\" id=\"UgR-ie-7I7\">\n                                    <behavior key=\"behavior\" changeContents=\"YES\" doesNotDimImage=\"YES\" lightByContents=\"YES\"/>\n                                    <font key=\"font\" metaFont=\"system\"/>\n                                </buttonCell>\n                            </button>\n                        </subviews>\n                        <constraints>\n                            <constraint firstItem=\"onc-Qp-bvF\" firstAttribute=\"bottom\" secondItem=\"vXl-0B-yeH\" secondAttribute=\"bottom\" id=\"0HY-I0-wEK\"/>\n                            <constraint firstItem=\"r3U-FI-Ege\" firstAttribute=\"top\" secondItem=\"D7O-XY-wd0\" secondAttribute=\"bottom\" constant=\"20\" id=\"1Qf-Ce-W8e\"/>\n                            <constraint firstItem=\"PqZ-lL-ZBX\" firstAttribute=\"trailing\" secondItem=\"r3U-FI-Ege\" secondAttribute=\"trailing\" id=\"2Lz-RM-i40\"/>\n                            <constraint firstItem=\"Gg7-4R-abT\" firstAttribute=\"leading\" secondItem=\"PqZ-lL-ZBX\" secondAttribute=\"trailing\" constant=\"8\" id=\"2kK-HJ-pnA\"/>\n                            <constraint firstItem=\"vXl-0B-yeH\" firstAttribute=\"width\" secondItem=\"m2S-Jp-Qdl\" secondAttribute=\"width\" multiplier=\"0.5\" id=\"3Dn-kb-PNS\"/>\n                            <constraint firstItem=\"z9r-5V-pdS\" firstAttribute=\"leading\" secondItem=\"m2S-Jp-Qdl\" secondAttribute=\"leading\" id=\"494-o1-g5h\"/>\n                            <constraint firstItem=\"r3U-FI-Ege\" firstAttribute=\"trailing\" secondItem=\"D7O-XY-wd0\" secondAttribute=\"trailing\" id=\"EIi-q3-9Wt\"/>\n                            <constraint firstAttribute=\"trailing\" secondItem=\"z9r-5V-pdS\" secondAttribute=\"trailing\" id=\"JXb-Wb-ogn\"/>\n                            <constraint firstItem=\"vXl-0B-yeH\" firstAttribute=\"top\" secondItem=\"PqZ-lL-ZBX\" secondAttribute=\"bottom\" constant=\"20\" id=\"LF5-Gz-keO\"/>\n                            <constraint firstItem=\"YfF-j3-Hxy\" firstAttribute=\"width\" secondItem=\"m2S-Jp-Qdl\" secondAttribute=\"width\" multiplier=\"0.5\" id=\"LZE-Uu-4nJ\"/>\n                            <constraint firstItem=\"yLZ-Ur-huV\" firstAttribute=\"leading\" secondItem=\"D7O-XY-wd0\" secondAttribute=\"trailing\" constant=\"8\" id=\"Vkp-E6-cas\"/>\n                            <constraint firstItem=\"vXl-0B-yeH\" firstAttribute=\"leading\" secondItem=\"m2S-Jp-Qdl\" secondAttribute=\"leading\" id=\"WNg-2P-bo9\"/>\n                            <constraint firstAttribute=\"bottom\" secondItem=\"z9r-5V-pdS\" secondAttribute=\"bottom\" id=\"Xhx-2U-thk\"/>\n                            <constraint firstItem=\"onc-Qp-bvF\" firstAttribute=\"top\" secondItem=\"vXl-0B-yeH\" secondAttribute=\"top\" id=\"Ziw-za-CvC\"/>\n                            <constraint firstItem=\"Gg7-4R-abT\" firstAttribute=\"centerY\" secondItem=\"PqZ-lL-ZBX\" secondAttribute=\"centerY\" id=\"cIv-MD-zvf\"/>\n                            <constraint firstItem=\"PqZ-lL-ZBX\" firstAttribute=\"top\" secondItem=\"r3U-FI-Ege\" secondAttribute=\"bottom\" constant=\"20\" id=\"eaL-D7-ZXq\"/>\n                            <constraint firstItem=\"BTt-D8-1HI\" firstAttribute=\"centerY\" secondItem=\"r3U-FI-Ege\" secondAttribute=\"centerY\" id=\"fjf-QS-OxH\"/>\n                            <constraint firstItem=\"YfF-j3-Hxy\" firstAttribute=\"top\" secondItem=\"vXl-0B-yeH\" secondAttribute=\"top\" id=\"g8n-YR-4sW\"/>\n                            <constraint firstItem=\"yLZ-Ur-huV\" firstAttribute=\"centerY\" secondItem=\"D7O-XY-wd0\" secondAttribute=\"centerY\" id=\"lAI-mA-w2k\"/>\n                            <constraint firstItem=\"BTt-D8-1HI\" firstAttribute=\"leading\" secondItem=\"r3U-FI-Ege\" secondAttribute=\"trailing\" constant=\"8\" id=\"lG2-WC-bz8\"/>\n                            <constraint firstItem=\"YfF-j3-Hxy\" firstAttribute=\"bottom\" secondItem=\"vXl-0B-yeH\" secondAttribute=\"bottom\" id=\"mIQ-YL-mwL\"/>\n                            <constraint firstItem=\"z9r-5V-pdS\" firstAttribute=\"top\" secondItem=\"vXl-0B-yeH\" secondAttribute=\"bottom\" constant=\"18\" id=\"oca-GD-oG2\"/>\n                            <constraint firstItem=\"Keu-Ro-sxF\" firstAttribute=\"leading\" secondItem=\"BTt-D8-1HI\" secondAttribute=\"trailing\" constant=\"8\" id=\"pXk-7F-X4I\"/>\n                            <constraint firstItem=\"Keu-Ro-sxF\" firstAttribute=\"centerY\" secondItem=\"BTt-D8-1HI\" secondAttribute=\"centerY\" id=\"qbF-2d-lJ7\"/>\n                            <constraint firstItem=\"D7O-XY-wd0\" firstAttribute=\"trailing\" secondItem=\"vXl-0B-yeH\" secondAttribute=\"trailing\" id=\"rjF-97-w5U\"/>\n                            <constraint firstItem=\"onc-Qp-bvF\" firstAttribute=\"width\" secondItem=\"m2S-Jp-Qdl\" secondAttribute=\"width\" multiplier=\"0.5\" id=\"tPn-hi-t4X\"/>\n                            <constraint firstItem=\"D7O-XY-wd0\" firstAttribute=\"top\" secondItem=\"m2S-Jp-Qdl\" secondAttribute=\"top\" constant=\"30\" id=\"uuY-0O-dAg\"/>\n                            <constraint firstAttribute=\"trailing\" secondItem=\"YfF-j3-Hxy\" secondAttribute=\"trailing\" id=\"wyt-Tf-7aH\"/>\n                            <constraint firstAttribute=\"trailing\" secondItem=\"onc-Qp-bvF\" secondAttribute=\"trailing\" id=\"zLM-Zt-oqT\"/>\n                        </constraints>\n                    </view>\n                    <connections>\n                        <outlet property=\"algorithmLabel\" destination=\"D7O-XY-wd0\" id=\"kd8-S8-axY\"/>\n                        <outlet property=\"algorithmPopUpButton\" destination=\"yLZ-Ur-huV\" id=\"jGD-Tt-x1L\"/>\n                        <outlet property=\"decriptedView\" destination=\"onc-Qp-bvF\" id=\"7tL-g2-JwQ\"/>\n                        <outlet property=\"encodedTextView\" destination=\"RyK-m8-XF3\" id=\"nLX-Yg-Zxa\"/>\n                        <outlet property=\"secretIsBase64EncodedCheckButton\" destination=\"Keu-Ro-sxF\" id=\"pMU-b7-PkB\"/>\n                        <outlet property=\"secretLabel\" destination=\"r3U-FI-Ege\" id=\"C55-1g-RcU\"/>\n                        <outlet property=\"secretTextField\" destination=\"BTt-D8-1HI\" id=\"Mrx-PK-tGq\"/>\n                        <outlet property=\"signatureLabel\" destination=\"PqZ-lL-ZBX\" id=\"9fw-ao-4AI\"/>\n                        <outlet property=\"signatureStatusLabel\" destination=\"z9r-5V-pdS\" id=\"uNp-LH-jFx\"/>\n                        <outlet property=\"signatureVerificationCheckButton\" destination=\"Gg7-4R-abT\" id=\"CyZ-pz-E8S\"/>\n                    </connections>\n                </viewController>\n                <customObject id=\"rPt-NT-nkU\" userLabel=\"First Responder\" customClass=\"NSResponder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"75\" y=\"729.5\"/>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "Example/JWTDesktopSwift/JWTDesktopSwift/DecriptedCollectionViewItem.swift",
    "content": "//\n//  DecriptedCollectionViewItem.swift\n//  JWTDesktopSwift\n//\n//  Created by Lobanov Dmitry on 01.10.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\nimport Cocoa\n\nclass DecriptedCollectionViewItem: NSCollectionViewItem {\n\n    @IBOutlet var textView: NSTextView!\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n        // Do view setup here.\n    }\n    \n    func update(text: String) {\n        self.textView.string = text\n    }\n    \n    func update(textColor: NSColor) {\n        self.textView.textColor = textColor\n    }\n}\n"
  },
  {
    "path": "Example/JWTDesktopSwift/JWTDesktopSwift/DecriptedCollectionViewItem.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.Cocoa.XIB\" version=\"3.0\" toolsVersion=\"11201\" systemVersion=\"16A323\" targetRuntime=\"MacOSX.Cocoa\" propertyAccessControl=\"none\" useAutolayout=\"YES\" customObjectInstantitationMethod=\"direct\">\n    <dependencies>\n        <deployment identifier=\"macosx\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.CocoaPlugin\" version=\"11201\"/>\n    </dependencies>\n    <objects>\n        <customObject id=\"-2\" userLabel=\"File's Owner\" customClass=\"DecriptedCollectionViewItem\" customModule=\"JWTDesktopSwift\" customModuleProvider=\"target\">\n            <connections>\n                <outlet property=\"textView\" destination=\"i9Y-Iw-i8t\" id=\"Xbz-aR-yGK\"/>\n                <outlet property=\"view\" destination=\"Hz6-mo-xeY\" id=\"0bl-1N-x8E\"/>\n            </connections>\n        </customObject>\n        <customObject id=\"-1\" userLabel=\"First Responder\" customClass=\"FirstResponder\"/>\n        <customObject id=\"-3\" userLabel=\"Application\" customClass=\"NSObject\"/>\n        <customView id=\"Hz6-mo-xeY\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"272\"/>\n            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n            <subviews>\n                <scrollView horizontalLineScroll=\"10\" horizontalPageScroll=\"10\" verticalLineScroll=\"10\" verticalPageScroll=\"10\" hasHorizontalScroller=\"NO\" usesPredominantAxisScrolling=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"dM4-Vi-CAL\">\n                    <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"272\"/>\n                    <clipView key=\"contentView\" id=\"lrE-qz-q1N\">\n                        <rect key=\"frame\" x=\"1\" y=\"1\" width=\"463\" height=\"270\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <subviews>\n                            <textView importsGraphics=\"NO\" usesFontPanel=\"YES\" findStyle=\"panel\" continuousSpellChecking=\"YES\" allowsUndo=\"YES\" usesRuler=\"YES\" allowsNonContiguousLayout=\"YES\" quoteSubstitution=\"YES\" dashSubstitution=\"YES\" spellingCorrection=\"YES\" smartInsertDelete=\"YES\" id=\"i9Y-Iw-i8t\">\n                                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"463\" height=\"270\"/>\n                                <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                                <size key=\"minSize\" width=\"463\" height=\"270\"/>\n                                <size key=\"maxSize\" width=\"480\" height=\"10000000\"/>\n                                <color key=\"insertionPointColor\" name=\"controlTextColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                            </textView>\n                        </subviews>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    </clipView>\n                    <scroller key=\"horizontalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" doubleValue=\"1\" horizontal=\"YES\" id=\"Pmr-2V-7m1\">\n                        <rect key=\"frame\" x=\"-100\" y=\"-100\" width=\"87\" height=\"18\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                    </scroller>\n                    <scroller key=\"verticalScroller\" verticalHuggingPriority=\"750\" doubleValue=\"1\" horizontal=\"NO\" id=\"zk4-hr-bjg\">\n                        <rect key=\"frame\" x=\"464\" y=\"1\" width=\"15\" height=\"270\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                    </scroller>\n                </scrollView>\n            </subviews>\n            <constraints>\n                <constraint firstItem=\"dM4-Vi-CAL\" firstAttribute=\"leading\" secondItem=\"Hz6-mo-xeY\" secondAttribute=\"leading\" id=\"7wm-ca-hSR\"/>\n                <constraint firstAttribute=\"trailing\" secondItem=\"dM4-Vi-CAL\" secondAttribute=\"trailing\" id=\"gmh-Ft-0ot\"/>\n                <constraint firstAttribute=\"bottom\" secondItem=\"dM4-Vi-CAL\" secondAttribute=\"bottom\" id=\"kJd-T3-rsJ\"/>\n                <constraint firstItem=\"dM4-Vi-CAL\" firstAttribute=\"top\" secondItem=\"Hz6-mo-xeY\" secondAttribute=\"top\" id=\"xkw-5U-Pg1\"/>\n            </constraints>\n        </customView>\n    </objects>\n</document>\n"
  },
  {
    "path": "Example/JWTDesktopSwift/JWTDesktopSwift/DecriptedViewController.swift",
    "content": "//\n//  DecriptedViewController.swift\n//  JWTDesktopSwift\n//\n//  Created by Lobanov Dmitry on 01.10.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\nimport Cocoa\nimport JWT\nimport JWTDesktopSwiftToolkit\n//import JW\n\nclass DecriptedViewController: NSViewController {\n    // MARK: - Outlets\n    @IBOutlet weak var collectionView: NSCollectionView!\n\n    // MARK: - CollectionView Convenients\n    let collectionViewItemIdentifier = NSUserInterfaceItemIdentifier(NSStringFromClass(DecriptedCollectionViewItem.self))\n\n    // MARK: - Builder\n    var builder : JWTBuilder? {\n        didSet {\n            self.reloadData()\n            self.reloadCollectionView()\n        }\n    }\n    \n    // MARK: - ResultType\n    var resultType: JWTCodingResultType? {\n        didSet {\n            self.reloadData()\n            self.reloadCollectionView()\n        }\n    }\n    \n    // MARK: - Cached vars\n    var cachedResultArray : [[String: Any]]?\n    var cachedErrorDictionary : [String: String]?\n\n    // MARK: - Texts vars\n    var errorText: String { return String.json(cachedErrorDictionary) }\n    var headerText: String { return String.json(cachedResultArray?[0]) }\n    var payloadText: String { return String.json(cachedResultArray?[1]) }\n    \n    // MARK: - Setup\n    func setupUIElements() {\n        self.collectionView.delegate = self\n        self.collectionView.dataSource = self\n        self.collectionView.minItemSize = NSZeroSize\n        self.collectionView.maxItemSize = NSZeroSize\n        self.collectionView.register(DecriptedCollectionViewItem.self, forItemWithIdentifier: self.collectionViewItemIdentifier)\n    }\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n        self.setupUIElements()\n        NotificationCenter.default.addObserver(self, selector: #selector(DecriptedViewController.reload), name: NSWindow.didResizeNotification, object: nil)\n    }\n    \n    // MARK: - Reload\n    @objc func reload() {\n        reloadCollectionView()\n    }\n    func reloadCollectionView() {\n        self.collectionView.reloadData()\n    }\n    func reloadData() {\n        self.cachedResultArray = nil\n        self.cachedErrorDictionary = nil\n        if let resultType = self.resultType {\n            if let successResult = resultType.successResult, let dictionary = successResult.headerAndPayloadDictionary {\n                let serializer = JWTClaimsSetSerializerBase.init()\n                serializer.skipClaimsProviderLookupCheck = true\n                let value = successResult.claimsSetStorage.flatMap(serializer.dictionary)\n                self.cachedResultArray = [\n                    [\"header\" : dictionary[JWTCodingResultComponents.headers!] ?? \"\"],\n                    [\"payload\": dictionary[JWTCodingResultComponents.payload!] ?? \"\"],\n                    [\"claims\": value ?? \"\"]\n                ]\n            }\n            else {\n                let errorDescription = resultType.errorResult?.error?.localizedDescription ?? \"UnknownError! Report about it!\"\n                self.cachedErrorDictionary = [\n                    \"error\" : errorDescription\n                ]\n            }\n        }\n        else {\n            let result = self.builder?.decode\n            if let error = self.builder?.jwtError {\n                self.cachedErrorDictionary = [\n                    \"Error\" : error.localizedDescription\n                ]\n            }\n            else if let dictionary = result {\n                self.cachedResultArray = [\n                    [\"header\" : dictionary[\"header\"] ?? \"\"],\n                    [\"payload\" : dictionary[\"payload\"] ?? \"\"]\n                ]\n            }\n        }\n    }\n    \n    // MARK: - Collection Helpers.\n    func textForItem(indexPath: IndexPath) -> String {\n        var text : String = \"\"\n        \n        if self.cachedErrorDictionary != nil {\n            text = self.errorText\n        }\n        else if self.cachedResultArray != nil {\n            text = String.json(cachedResultArray?[indexPath.item])\n        }\n        \n        return text\n    }\n    \n    func color(indexPath: IndexPath) -> NSColor {\n        var color = NSColor.black\n        if self.cachedErrorDictionary != nil {\n            color = TokenTextType.header.color\n        }\n        else if (self.cachedResultArray != nil) {\n            color = (indexPath.item == 0 ? TokenTextType.header : TokenTextType.payload).color\n        }\n        return color\n    }\n}\n\nextension DecriptedViewController {\n    func countOfItems() -> Int {\n        if self.cachedErrorDictionary != nil {\n            return 1\n        }\n        else if let array = self.cachedResultArray {\n            return array.count\n        }\n        else {\n            return 0\n        }\n    }\n}\n\nextension DecriptedViewController : NSCollectionViewDelegateFlowLayout {\n    func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> NSSize {\n        \n        let stringToDisplay = self.textForItem(indexPath: indexPath)\n        let width = collectionView.frame.size.width\n        let estimatedSize = (stringToDisplay as NSString).boundingRect(with: CGSize(width:width, height: 10000), options: [NSString.DrawingOptions.usesLineFragmentOrigin, NSString.DrawingOptions.usesFontLeading], attributes: nil)\n        let height = estimatedSize.size.height\n        let size = CGSize(width:width, height:height)\n        return size\n    }\n}\n\nextension DecriptedViewController : NSCollectionViewDataSource {\n    func numberOfSections(in collectionView: NSCollectionView) -> Int {\n        return 1\n    }\n    func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int {\n        return self.countOfItems()\n    }\n    func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {\n        let item = collectionView.makeItem(withIdentifier: self.collectionViewItemIdentifier, for: indexPath)\n        \n        let decriptedItem = item as! DecriptedCollectionViewItem;\n\n        decriptedItem.update(text: self.textForItem(indexPath: indexPath))\n        decriptedItem.update(textColor: self.color(indexPath: indexPath))\n        \n        return item;\n    }\n}\n"
  },
  {
    "path": "Example/JWTDesktopSwift/JWTDesktopSwift/DecriptedViewController.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.Cocoa.XIB\" version=\"3.0\" toolsVersion=\"11201\" systemVersion=\"16A323\" targetRuntime=\"MacOSX.Cocoa\" propertyAccessControl=\"none\" useAutolayout=\"YES\" customObjectInstantitationMethod=\"direct\">\n    <dependencies>\n        <deployment identifier=\"macosx\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.CocoaPlugin\" version=\"11201\"/>\n    </dependencies>\n    <objects>\n        <customObject id=\"-2\" userLabel=\"File's Owner\" customClass=\"DecriptedViewController\" customModule=\"JWTDesktopSwift\" customModuleProvider=\"target\">\n            <connections>\n                <outlet property=\"collectionView\" destination=\"mXP-VW-npz\" id=\"lqs-sk-p8G\"/>\n                <outlet property=\"view\" destination=\"Hz6-mo-xeY\" id=\"0bl-1N-x8E\"/>\n            </connections>\n        </customObject>\n        <customObject id=\"-1\" userLabel=\"First Responder\" customClass=\"FirstResponder\"/>\n        <customObject id=\"-3\" userLabel=\"Application\" customClass=\"NSObject\"/>\n        <customView id=\"Hz6-mo-xeY\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"272\"/>\n            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMinY=\"YES\"/>\n            <subviews>\n                <scrollView autohidesScrollers=\"YES\" horizontalLineScroll=\"10\" horizontalPageScroll=\"10\" verticalLineScroll=\"10\" verticalPageScroll=\"10\" usesPredominantAxisScrolling=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"Ova-Fc-W4C\">\n                    <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"480\" height=\"272\"/>\n                    <clipView key=\"contentView\" drawsBackground=\"NO\" id=\"xMO-YT-V6e\">\n                        <rect key=\"frame\" x=\"1\" y=\"1\" width=\"478\" height=\"270\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <subviews>\n                            <collectionView id=\"mXP-VW-npz\">\n                                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"478\" height=\"270\"/>\n                                <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                                <collectionViewFlowLayout key=\"collectionViewLayout\" minimumInteritemSpacing=\"10\" minimumLineSpacing=\"10\" id=\"KcQ-Vu-xXO\">\n                                    <size key=\"itemSize\" width=\"50\" height=\"50\"/>\n                                </collectionViewFlowLayout>\n                                <color key=\"primaryBackgroundColor\" name=\"controlBackgroundColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                            </collectionView>\n                        </subviews>\n                        <color key=\"backgroundColor\" name=\"controlColor\" catalog=\"System\" colorSpace=\"catalog\"/>\n                    </clipView>\n                    <scroller key=\"horizontalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" horizontal=\"YES\" id=\"dAS-nP-5HK\">\n                        <rect key=\"frame\" x=\"1\" y=\"144\" width=\"233\" height=\"15\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                    </scroller>\n                    <scroller key=\"verticalScroller\" hidden=\"YES\" verticalHuggingPriority=\"750\" doubleValue=\"1\" horizontal=\"NO\" id=\"GVr-s4-nLA\">\n                        <rect key=\"frame\" x=\"234\" y=\"1\" width=\"15\" height=\"143\"/>\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                    </scroller>\n                </scrollView>\n            </subviews>\n            <constraints>\n                <constraint firstAttribute=\"bottom\" secondItem=\"Ova-Fc-W4C\" secondAttribute=\"bottom\" id=\"LWr-cT-dGa\"/>\n                <constraint firstItem=\"Ova-Fc-W4C\" firstAttribute=\"top\" secondItem=\"Hz6-mo-xeY\" secondAttribute=\"top\" id=\"hjX-ov-aWZ\"/>\n                <constraint firstItem=\"Ova-Fc-W4C\" firstAttribute=\"leading\" secondItem=\"Hz6-mo-xeY\" secondAttribute=\"leading\" id=\"kHB-Er-WN1\"/>\n                <constraint firstAttribute=\"trailing\" secondItem=\"Ova-Fc-W4C\" secondAttribute=\"trailing\" id=\"qTj-ZS-hGY\"/>\n            </constraints>\n        </customView>\n    </objects>\n</document>\n"
  },
  {
    "path": "Example/JWTDesktopSwift/JWTDesktopSwift/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIconFile</key>\n\t<string></string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSMinimumSystemVersion</key>\n\t<string>$(MACOSX_DEPLOYMENT_TARGET)</string>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>Copyright © 2016 JWTIO. All rights reserved.</string>\n\t<key>NSMainStoryboardFile</key>\n\t<string>Main</string>\n\t<key>NSPrincipalClass</key>\n\t<string>NSApplication</string>\n\t<key>DEPLOYMENT_RUNTIME_SWIFT</key>\n\t<string>$(DEPLOYMENT_RUNTIME_SWIFT)</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Example/JWTDesktopSwift/JWTDesktopSwift/ViewController+Model.swift",
    "content": "//\n//  ViewController+Model.swift\n//  JWTDesktopSwift\n//\n//  Created by Lobanov Dmitry on 30.10.2017.\n//  Copyright © 2017 JWTIO. All rights reserved.\n//\n\nimport Foundation\nimport JWT\nimport JWTDesktopSwiftToolkit\n\nextension ViewController {\n    class Model {\n        var appearance: TokenTextAppearance = .init()\n        var decoder: TokenDecoder = .init()\n        var signatureValidation: SignatureValidationType = .unknown\n    }\n    \n    enum DataSeedType {\n        case hs256\n        case rs256\n        struct DataSeed {\n            var algorithmName: String\n            var secret: String\n            var token: String\n        }\n        var dataSeed: DataSeed {\n            switch self {\n            case .hs256:\n                let algorithmName = JWTAlgorithmNameHS256\n                let secret = \"secret\"\n                let token = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ\"\n                return .init(algorithmName: algorithmName, secret: secret, token: token)\n            case .rs256:\n                let algorithmName = JWTAlgorithmNameRS256\n                let secret = \"-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoPryo3IisfK3a028bwgso/CW5kB84mk6Y7rO76FxJRTWnOAla0Uf0OpIID7go4Qck66yT4/uPpiOQIR0oW0plTekkDP75EG3d/2mtzhiCtELV4F1r9b/InCN5dYYK8USNkKXgjbeVyatdUvCtokz10/ibNZ9qikgKf58qXnn2anGvpE6ded5FOUEukOjr7KSAfD0KDNYWgZcG7HZBxn/3N7ND9D0ATu2vxlJsNGOkH6WL1EmObo/QygBXzuZm5o0N0W15EXpWVbl4Ye7xqPnvc1i2DTKxNUcyhXfDbLw1ee2d9T/WU5895Ko2bQ/O/zPwUSobM3m+fPMW8kp5914kwIDAQAB-----END PUBLIC KEY-----\"\n                let token = \"eyJraWQiOiJqd3RfdWF0X2tleXMiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI1MDAxIiwiaXNzIjoiQ0xNIiwiZXhwIjoxNTA4MjQ5NTU3LCJqdGkiOiI2MjcyM2E4Yi0zOTZmLTQxYmYtOTljMi02NWRkMzk2MDNiNjQifQ.Cej8RJ6e2HEU27rh_TyHZBoMI1jErmhOfSFY4SRzRoijSP628hM82XxjDX24HsKqIsK1xeeGI1yg1bed4RPhnmDGt4jAY73nqguZ1oqZ2DTcfZ5olxCXyLLaytl2XH7-62M_mFUcGj7I2mwts1DQkHWnFky2i4uJXlksHFkUg2xZoGEjVHo0bxCxgQ5yQiOpxC5VodN5rAPM3A5yMG6EijOp-dvUThjoJ4RFTGKozw_x_Qg6RLGDusNcmLIMbHasTsyZAZle6RFkwO0Sij1k6z6_xssbOl-Q57m7CeYgVHMORdzy4Smkmh-0gzeiLsGbCL4fhgdHydpIFajW-eOXMw\"\n                return .init(algorithmName: algorithmName, secret: secret, token: token)\n            }\n        }\n    }\n}\n\n// JWT\nextension ViewController.Model {\n    var availableAlgorithms: [JWTAlgorithm] {\n        JWTAlgorithmFactory.algorithms\n    }\n    var availableAlgorithmsNames: [String] {\n        self.availableAlgorithms.map(\\.name)\n    }\n}\n\n\n"
  },
  {
    "path": "Example/JWTDesktopSwift/JWTDesktopSwift/ViewController.swift",
    "content": "//\n//  ViewController.swift\n//  JWTDesktopSwift\n//\n//  Created by Lobanov Dmitry on 01.10.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\nimport Cocoa\nimport JWT\nimport JWTDesktopSwiftToolkit\n\n\n// MARK: - Supply JWT Methods\nextension ViewController {\n    func tokenDataTransferObject() -> TokenDecoder.DataTransferObject {\n        let algorithmName = self.algorithmPopUpButton.selectedItem?.title ?? \"\"\n        let secret = self.secretTextField.stringValue\n        let secretData: Data? = self.getSecretData\n        let isBase64EncodedSecret = self.secretIsBase64EncodedCheckButton.integerValue == 1\n        let shouldSkipSignatureVerification = self.signatureVerificationCheckButton.integerValue == 1\n        return .init(algorithmName: algorithmName, secret: secret, secretData: secretData, isBase64EncodedSecret: isBase64EncodedSecret, shouldSkipSignatureVerification: shouldSkipSignatureVerification)\n    }\n    \n    func tokenDataTransferObjectShouldCheckSignature() -> TokenDecoder.DataTransferObject {\n        var result = self.tokenDataTransferObject()\n        result.shouldSkipSignatureVerification = false\n        return result\n    }\n    \n    var getSecretData: Data? {\n        let secret = self.secretTextField.stringValue\n        \n        let isBase64Encoded = self.secretIsBase64EncodedCheckButton.integerValue == 1\n        guard let result = Data(base64Encoded: secret), isBase64Encoded else {\n            self.secretIsBase64EncodedCheckButton.integerValue = 0\n            return nil\n        }\n        \n        return result\n    }\n}\n\n// Refresh UI\nextension ViewController {\n    // MARK: - Encoded Text View\n    func encodedTextAttributes(_ enumerate: (NSRange, [NSAttributedString.Key : Any]) -> ()) {\n        let textStorage = self.encodedTextView.textStorage!\n        let string = textStorage.string\n        let range = NSMakeRange(0, string.count)\n        if let attributedString = self.model.appearance.encodedAttributedString(text: string) {\n            attributedString.enumerateAttributes(in: range, options: []) { (attributes, range, bool) in\n                enumerate(range, attributes)\n            }\n        }\n    }\n    \n    // MARK: - Refresh UI\n    func refreshUI() {\n        \n        let textStorage = self.encodedTextView.textStorage!;\n        let string = textStorage.string\n        self.encodedTextAttributes { (range, attributes) in\n            textStorage.setAttributes(attributes, range: range)\n        }\n        \n        // We should add an option to skip verification in decoding section.\n        // invalid signature doesn't mean that you can't decode JWT.\n        \n        if let jwtVerified = self.model.decoder.decode(token: string, object: self.tokenDataTransferObjectShouldCheckSignature()) {\n            let notVerified = jwtVerified.successResult?.headerAndPayloadDictionary?.isEmpty == true\n            self.signatureReactOnVerifiedToken(verified: !notVerified)\n        }\n        else {\n            self.signatureReactOnVerifiedToken(verified: false)\n        }\n        \n        let result = self.model.decoder.decode(token: string, object: self.tokenDataTransferObject())\n        \n        self.decriptedViewController.resultType = result\n    }\n    \n    func refreshSignature() {\n        self.signatureStatusLabel.backgroundColor = self.model.signatureValidation.color\n        self.signatureStatusLabel.stringValue = self.model.signatureValidation.title\n    }\n}\n\n// MARK: - Actions\nextension ViewController {\n    @objc func popUpButtonValueChanged(sender : AnyClass) {\n        self.refreshUI()\n    }\n    \n    @objc func checkBoxState(sender : AnyClass) {\n        self.refreshUI()\n    }\n    func signatureReactOnVerifiedToken(verified: Bool) {\n        self.model.signatureValidation = verified ? .valid : .invalid\n        self.refreshSignature()\n    }\n}\n\nextension ViewController: NSTextFieldDelegate {\n    func controlTextDidChange(_ obj: Notification) {\n        if (obj.name == NSControl.textDidChangeNotification) {\n            let textField = obj.object as! NSTextField\n            if textField == self.secretTextField {\n                self.refreshUI()\n            }\n        }\n    }\n}\n\nextension ViewController: NSTextViewDelegate {\n    func textDidChange(_ notification: Notification) {\n        self.refreshUI()\n    }\n//    func textViewDidChangeTypingAttributes(_ notification: Notification) {\n//        self.updateEncodedTextAttributes()\n//    }\n//    func textView(_ textView: NSTextView, shouldChangeTypingAttributes oldTypingAttributes: [String : Any] = [:], toAttributes newTypingAttributes: [NSAttributedString.Key : Any] = [:]) -> [NSAttributedString.Key : Any] {\n//        return newTypingAttributes\n//    }\n    \n//    func textView(_ textView: NSTextView, shouldChangeTextIn affectedCharRange: NSRange, replacementString: String?) -> Bool {\n//        if (textView == self.encodedTextView) {\n////            if let textStore = textView.textStorage {\n////                textView.undoManager?.beginUndoGrouping()\n////                textStore.replaceCharacters(in: affectedCharRange, with: replacementString!)\n////                self.encodedTextAttributes { (range, attributes) in\n////                    textStore.setAttributes(attributes, range: range)\n////                }\n////                textView.undoManager?.endUndoGrouping()\n////            }\n////            self.refreshUI()\n//            return true\n//        }\n//        return false\n//    }\n}\n\n// MARK: - EncodingTextViewDelegate\n//extension ViewController : NSTextViewDelegate {\n//    func textView(_ textView: NSTextView, shouldChangeTextIn affectedCharRange: NSRange, replacementString: String?) -> Bool {\n//        if (textView == self.encodedTextView) {\n//            if let textStore = textView.textStorage {\n//                textStore.replaceCharacters(in: affectedCharRange, with: replacementString!)\n//            }\n//            self.refreshUI()\n//            return false\n//        }\n//        return false\n//    }\n//}\n\nclass ViewController: NSViewController {\n    override init(nibName nibNameOrNil: NSNib.Name?, bundle nibBundleOrNil: Bundle?) {\n        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)\n    }\n    \n    required init?(coder: NSCoder) {\n        super.init(coder: coder)\n    }\n    \n    // MARK: - Properties - Outlets\n    @IBOutlet weak var algorithmLabel : NSTextField!\n    @IBOutlet weak var algorithmPopUpButton : NSPopUpButton!\n    \n    @IBOutlet weak var secretLabel : NSTextField!\n    @IBOutlet weak var secretTextField : NSTextField!\n    @IBOutlet weak var secretIsBase64EncodedCheckButton : NSButton!\n    \n    @IBOutlet weak var signatureLabel : NSTextField!\n    @IBOutlet weak var signatureVerificationCheckButton : NSButton!\n    \n    \n    @IBOutlet weak var encodedTextView : NSTextView!\n    @IBOutlet weak var decriptedView : NSView!\n    var decriptedViewController : DecriptedViewController!\n    \n    @IBOutlet weak var signatureStatusLabel : NSTextField!\n    \n    // MARK: - Model\n    var model: Model!\n    \n    // MARK: - Setup\n    func setupModel() {\n        self.model = Model()\n    }\n    \n    func setupTop() {\n        // top label.\n        self.algorithmLabel.stringValue = \"Algorithm\";\n        // pop up button.\n        \n        self.algorithmPopUpButton.removeAllItems()\n        self.algorithmPopUpButton.addItems(withTitles: self.model.availableAlgorithmsNames)\n        self.algorithmPopUpButton.target = self\n        self.algorithmPopUpButton.action = #selector(ViewController.popUpButtonValueChanged(sender:))\n        \n        // secretLabel\n        self.secretLabel.stringValue = \"Secret\"\n        \n        // secretTextField\n        self.secretTextField.placeholderString = \"Secret\"\n        self.secretTextField.delegate = self\n\n        // check button\n        self.secretIsBase64EncodedCheckButton.title = \"is Base64Encoded Secret\"\n        self.secretIsBase64EncodedCheckButton.integerValue = 0\n        self.secretIsBase64EncodedCheckButton.target = self\n        self.secretIsBase64EncodedCheckButton.action = #selector(ViewController.checkBoxState(sender:))\n        \n        // signatureLabel\n        self.signatureLabel.stringValue = \"Signature\"\n        \n        // signatureVerificationCheckButton\n        self.signatureVerificationCheckButton.title = \"Skip signature verification\"\n        self.signatureVerificationCheckButton.integerValue = 0\n        self.signatureVerificationCheckButton.target = self\n        self.signatureVerificationCheckButton.action = #selector(ViewController.checkBoxState(sender:))\n    }\n    \n    func setupBottom() {\n        self.signatureStatusLabel.alignment       = .center\n        self.signatureStatusLabel.textColor       = NSColor.white\n        self.signatureStatusLabel.drawsBackground = true\n        self.refreshSignature()\n    }\n\n    func setupEncodingDecodingViews() {\n        self.encodedTextView.delegate = self;\n    }\n    \n    func setupDecorations() {\n        self.setupTop()\n        self.setupBottom()\n    }\n    \n    func setupDecriptedViews() {\n        let view = self.decriptedView\n        self.decriptedViewController = DecriptedViewController()\n        view?.addSubview(self.decriptedViewController.view)\n    }\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n        self.setupModel()\n        \n        self.setupDecorations()\n        self.setupEncodingDecodingViews()\n        self.setupDecriptedViews()\n        \n        self.defaultDataSetup()\n    }\n    \n    func defaultDataSetup(algorithmName: String, secret: String, token: String) {\n        // algorithm HS256\n        if let index = self.model.availableAlgorithmsNames.firstIndex(where: {\n            $0 == algorithmName\n        }) {\n            self.algorithmPopUpButton.selectItem(at: index)\n        }\n\n        // secret\n        self.secretTextField.stringValue = secret\n        \n        // token\n        var range = NSRange()\n        range.location = 0\n        range.length = token.count\n        self.encodedTextView.insertText(token, replacementRange: range)\n\n    }\n    \n    func defaultDataSetup() {\n        let seed: DataSeedType = .hs256\n        let seedValue = seed.dataSeed\n        self.defaultDataSetup(algorithmName: seedValue.algorithmName, secret: seedValue.secret, token: seedValue.token)\n    }\n    \n    override func viewWillAppear() {\n        super.viewWillAppear()\n        guard let view = self.decriptedView else { return }\n        \n        let subview = self.decriptedViewController.view\n\n        view.translatesAutoresizingMaskIntoConstraints = false\n        subview.translatesAutoresizingMaskIntoConstraints = false\n        \n        let constraints = [\n            subview.leftAnchor.constraint(equalTo: view.leftAnchor),\n            subview.rightAnchor.constraint(equalTo: view.rightAnchor),\n            subview.topAnchor.constraint(equalTo: view.topAnchor),\n            subview.bottomAnchor.constraint(equalTo: view.bottomAnchor)\n        ]\n        \n        NSLayoutConstraint.activate(constraints)\n    }\n}\n\n"
  },
  {
    "path": "Example/JWTDesktopSwift/JWTDesktopSwift.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 52;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t044CFDC31DA1735B005B1D7A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 044CFDC21DA1735B005B1D7A /* Assets.xcassets */; };\n\t\t04A74B711DA00D840030DDE6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A74B701DA00D830030DDE6 /* AppDelegate.swift */; };\n\t\t04A74B731DA00D840030DDE6 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A74B721DA00D840030DDE6 /* ViewController.swift */; };\n\t\t04A74B781DA00D840030DDE6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 04A74B761DA00D840030DDE6 /* Main.storyboard */; };\n\t\t04A74B801DA00F340030DDE6 /* DecriptedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A74B7F1DA00F340030DDE6 /* DecriptedViewController.swift */; };\n\t\t04A74B831DA00F4F0030DDE6 /* DecriptedCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 04A74B811DA00F4F0030DDE6 /* DecriptedCollectionViewItem.xib */; };\n\t\t04A74B841DA00F4F0030DDE6 /* DecriptedViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 04A74B821DA00F4F0030DDE6 /* DecriptedViewController.xib */; };\n\t\t04A74B881DA0195B0030DDE6 /* DecriptedCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A74B871DA0195B0030DDE6 /* DecriptedCollectionViewItem.swift */; };\n\t\t0A5BC6FE1FA7B214000BDAB4 /* ViewController+Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A5BC6FD1FA7B214000BDAB4 /* ViewController+Model.swift */; };\n\t\t0AC0027A27865A64002167AD /* JWTDesktopSwiftToolkit in Frameworks */ = {isa = PBXBuildFile; productRef = 0AC0027927865A64002167AD /* JWTDesktopSwiftToolkit */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t044CFDC21DA1735B005B1D7A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t04A74B6D1DA00D830030DDE6 /* JWTDesktopSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JWTDesktopSwift.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t04A74B701DA00D830030DDE6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = \"<group>\"; };\n\t\t04A74B721DA00D840030DDE6 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = \"<group>\"; };\n\t\t04A74B771DA00D840030DDE6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = \"<group>\"; };\n\t\t04A74B791DA00D840030DDE6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t04A74B7F1DA00F340030DDE6 /* DecriptedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DecriptedViewController.swift; sourceTree = \"<group>\"; };\n\t\t04A74B811DA00F4F0030DDE6 /* DecriptedCollectionViewItem.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DecriptedCollectionViewItem.xib; sourceTree = \"<group>\"; };\n\t\t04A74B821DA00F4F0030DDE6 /* DecriptedViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DecriptedViewController.xib; sourceTree = \"<group>\"; };\n\t\t04A74B871DA0195B0030DDE6 /* DecriptedCollectionViewItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DecriptedCollectionViewItem.swift; sourceTree = \"<group>\"; };\n\t\t0A5BC6FD1FA7B214000BDAB4 /* ViewController+Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"ViewController+Model.swift\"; sourceTree = \"<group>\"; };\n\t\t0ABC6F15266A79DF00089885 /* JWT.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = JWT.framework; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t0AC0027827865A49002167AD /* JWTDesktopSwiftToolkit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = JWTDesktopSwiftToolkit; path = ../JWTDesktopSwiftToolkit; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t04A74B6A1DA00D830030DDE6 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0AC0027A27865A64002167AD /* JWTDesktopSwiftToolkit in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t04A74B641DA00D830030DDE6 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0AC0027827865A49002167AD /* JWTDesktopSwiftToolkit */,\n\t\t\t\t04A74B6F1DA00D830030DDE6 /* JWTDesktopSwift */,\n\t\t\t\t04A74B6E1DA00D830030DDE6 /* Products */,\n\t\t\t\t0A2D860C22B53E5C00BB4760 /* Frameworks */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t04A74B6E1DA00D830030DDE6 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t04A74B6D1DA00D830030DDE6 /* JWTDesktopSwift.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t04A74B6F1DA00D830030DDE6 /* JWTDesktopSwift */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t044CFDC21DA1735B005B1D7A /* Assets.xcassets */,\n\t\t\t\t04A74B811DA00F4F0030DDE6 /* DecriptedCollectionViewItem.xib */,\n\t\t\t\t04A74B821DA00F4F0030DDE6 /* DecriptedViewController.xib */,\n\t\t\t\t04A74B761DA00D840030DDE6 /* Main.storyboard */,\n\t\t\t\t04A74B791DA00D840030DDE6 /* Info.plist */,\n\t\t\t\t04A74B701DA00D830030DDE6 /* AppDelegate.swift */,\n\t\t\t\t04A74B721DA00D840030DDE6 /* ViewController.swift */,\n\t\t\t\t04A74B7F1DA00F340030DDE6 /* DecriptedViewController.swift */,\n\t\t\t\t04A74B871DA0195B0030DDE6 /* DecriptedCollectionViewItem.swift */,\n\t\t\t\t0A5BC6FD1FA7B214000BDAB4 /* ViewController+Model.swift */,\n\t\t\t);\n\t\t\tpath = JWTDesktopSwift;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0A2D860C22B53E5C00BB4760 /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0ABC6F15266A79DF00089885 /* JWT.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t04A74B6C1DA00D830030DDE6 /* JWTDesktopSwift */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 04A74B7C1DA00D840030DDE6 /* Build configuration list for PBXNativeTarget \"JWTDesktopSwift\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t04A74B691DA00D830030DDE6 /* Sources */,\n\t\t\t\t04A74B6A1DA00D830030DDE6 /* Frameworks */,\n\t\t\t\t04A74B6B1DA00D830030DDE6 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = JWTDesktopSwift;\n\t\t\tpackageProductDependencies = (\n\t\t\t\t0AC0027927865A64002167AD /* JWTDesktopSwiftToolkit */,\n\t\t\t);\n\t\t\tproductName = JWTDesktopSwift;\n\t\t\tproductReference = 04A74B6D1DA00D830030DDE6 /* JWTDesktopSwift.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t04A74B651DA00D830030DDE6 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastSwiftUpdateCheck = 1020;\n\t\t\t\tLastUpgradeCheck = 1250;\n\t\t\t\tORGANIZATIONNAME = JWTIO;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t04A74B6C1DA00D830030DDE6 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tLastSwiftMigration = 0920;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 04A74B681DA00D830030DDE6 /* Build configuration list for PBXProject \"JWTDesktopSwift\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 04A74B641DA00D830030DDE6;\n\t\t\tproductRefGroup = 04A74B6E1DA00D830030DDE6 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t04A74B6C1DA00D830030DDE6 /* JWTDesktopSwift */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t04A74B6B1DA00D830030DDE6 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t04A74B781DA00D840030DDE6 /* Main.storyboard in Resources */,\n\t\t\t\t04A74B831DA00F4F0030DDE6 /* DecriptedCollectionViewItem.xib in Resources */,\n\t\t\t\t044CFDC31DA1735B005B1D7A /* Assets.xcassets in Resources */,\n\t\t\t\t04A74B841DA00F4F0030DDE6 /* DecriptedViewController.xib in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t04A74B691DA00D830030DDE6 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0A5BC6FE1FA7B214000BDAB4 /* ViewController+Model.swift in Sources */,\n\t\t\t\t04A74B731DA00D840030DDE6 /* ViewController.swift in Sources */,\n\t\t\t\t04A74B881DA0195B0030DDE6 /* DecriptedCollectionViewItem.swift in Sources */,\n\t\t\t\t04A74B711DA00D840030DDE6 /* AppDelegate.swift in Sources */,\n\t\t\t\t04A74B801DA00F340030DDE6 /* DecriptedViewController.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXVariantGroup section */\n\t\t04A74B761DA00D840030DDE6 /* Main.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t04A74B771DA00D840030DDE6 /* Base */,\n\t\t\t);\n\t\t\tname = Main.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t04A74B7A1DA00D840030DDE6 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"-\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.12;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t04A74B7B1DA00D840030DDE6 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"-\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.12;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSWIFT_COMPILATION_MODE = wholemodule;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-O\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t04A74B7D1DA00D840030DDE6 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCODE_SIGN_IDENTITY = \"-\";\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tINFOPLIST_FILE = JWTDesktopSwift/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/../Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.jwtio.JWTDesktopSwift;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t04A74B7E1DA00D840030DDE6 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCODE_SIGN_IDENTITY = \"-\";\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tINFOPLIST_FILE = JWTDesktopSwift/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/../Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.jwtio.JWTDesktopSwift;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t04A74B681DA00D830030DDE6 /* Build configuration list for PBXProject \"JWTDesktopSwift\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t04A74B7A1DA00D840030DDE6 /* Debug */,\n\t\t\t\t04A74B7B1DA00D840030DDE6 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t04A74B7C1DA00D840030DDE6 /* Build configuration list for PBXNativeTarget \"JWTDesktopSwift\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t04A74B7D1DA00D840030DDE6 /* Debug */,\n\t\t\t\t04A74B7E1DA00D840030DDE6 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\n/* Begin XCSwiftPackageProductDependency section */\n\t\t0AC0027927865A64002167AD /* JWTDesktopSwiftToolkit */ = {\n\t\t\tisa = XCSwiftPackageProductDependency;\n\t\t\tproductName = JWTDesktopSwiftToolkit;\n\t\t};\n/* End XCSwiftPackageProductDependency section */\n\t};\n\trootObject = 04A74B651DA00D830030DDE6 /* Project object */;\n}\n"
  },
  {
    "path": "Example/JWTDesktopSwift/JWTDesktopSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "Example/JWTDesktopSwift/JWTDesktopSwift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IDEDidComputeMac32BitWarning</key>\n\t<true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "Example/JWTDesktopSwiftToolkit/.gitignore",
    "content": ".DS_Store\n/.build\n/Packages\n/*.xcodeproj\nxcuserdata/\nDerivedData/\n.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata\n"
  },
  {
    "path": "Example/JWTDesktopSwiftToolkit/Package.swift",
    "content": "// swift-tools-version:5.5\n// The swift-tools-version declares the minimum version of Swift required to build this package.\n\nimport PackageDescription\n\nlet package = Package(\n    name: \"JWTDesktopSwiftToolkit\",\n    products: [\n        // Products define the executables and libraries a package produces, and make them visible to other packages.\n        .library(\n            name: \"JWTDesktopSwiftToolkit\",\n            targets: [\"JWTDesktopSwiftToolkit\"]),\n    ],\n    dependencies: [\n        // Dependencies declare other packages that this package depends on.\n        // .package(url: /* package url */, from: \"1.0.0\"),\n        .package(name: \"JWT\", path: \"../../\")\n    ],\n    targets: [\n        // Targets are the basic building blocks of a package. A target can define a module or a test suite.\n        // Targets can depend on other targets in this package, and on products in packages this package depends on.\n        .target(\n            name: \"JWTDesktopSwiftToolkit\",\n            dependencies: [\n                .product(name: \"JWT\", package: \"JWT\")\n            ]\n        ),\n        .testTarget(\n            name: \"JWTDesktopSwiftToolkitTests\",\n            dependencies: [\"JWTDesktopSwiftToolkit\"]),\n    ]\n)\n"
  },
  {
    "path": "Example/JWTDesktopSwiftToolkit/README.md",
    "content": "# JWTDesktopSwiftToolkit\n\nA description of this package.\n"
  },
  {
    "path": "Example/JWTDesktopSwiftToolkit/Sources/JWTDesktopSwiftToolkit/Array+Extension.swift",
    "content": "//\n//  Array+Extension.swift\n//  JWTDesktopSwift\n//\n//  Created by Lobanov Dmitry on 30.10.2017.\n//  Copyright © 2017 JWTIO. All rights reserved.\n//\n\nimport Foundation\npublic extension Array {\n    func safeObject(index: Array.Index) -> Element? {\n        self.indices.contains(index) ? self[index] : nil\n    }\n}\n"
  },
  {
    "path": "Example/JWTDesktopSwiftToolkit/Sources/JWTDesktopSwiftToolkit/ColorBridge+Platforms.swift",
    "content": "//\n//  ColorBridge+Platforms.swift\n//  JWTDesktopSwiftToolkit\n//\n//  Created by Dmitry Lobanov on 04.06.2021.\n//\n\nimport Foundation\n\n#if canImport(UIKit)\nimport UIKit\npublic typealias ColorBridge = UIColor\n#elseif canImport(AppKit)\nimport AppKit\npublic typealias ColorBridge = NSColor\n#endif\n\npublic extension SignatureValidationType {\n    var color: ColorBridge {\n        switch self {\n        case .unknown: return .darkGray\n        case .valid: return .init(red: 0, green: 185/255.0, blue: 241/255.0, alpha: 1.0)\n        case .invalid: return .red\n        }\n    }\n}\n\npublic extension TokenTextType {\n    var color: ColorBridge {\n        switch self {\n        case .unknown: return .black\n        case .header: return .red\n        case .payload: return .magenta\n        case .signature: return .init(red: 0, green: 185/255.0, blue: 241/255.0, alpha: 1.0)\n        case .dot: return .blue\n        }\n    }\n}\n"
  },
  {
    "path": "Example/JWTDesktopSwiftToolkit/Sources/JWTDesktopSwiftToolkit/FontBridge+Platforms.swift",
    "content": "//\n//  FontBridge+Platforms.swift\n//  JWTDesktopSwiftToolkit\n//\n//  Created by Dmitry Lobanov on 04.06.2021.\n//\n\nimport Foundation\n\n#if canImport(UIKit)\nimport UIKit\npublic typealias FontBridge = UIFont\n#elseif canImport(AppKit)\nimport AppKit\npublic typealias FontBridge = NSFont\n#endif\n\npublic extension TokenTextType {\n    func defaultEncodedTextAttributes() -> [NSAttributedString.Key: Any] {\n        [.font: FontBridge.boldSystemFont(ofSize: 22)]\n    }\n    var font: FontBridge {\n        .boldSystemFont(ofSize: 22)\n    }\n}\n\npublic extension TokenTextAppearance {\n    struct Attributes {\n        public let color: ColorBridge\n        public let font: FontBridge\n    }\n}\n"
  },
  {
    "path": "Example/JWTDesktopSwiftToolkit/Sources/JWTDesktopSwiftToolkit/SignatureValidationType.swift",
    "content": "//\n//  SignatureValidationType.swift\n//  JWTDesktopSwift\n//\n//  Created by Lobanov Dmitry on 30.10.2017.\n//  Copyright © 2017 JWTIO. All rights reserved.\n//\n\npublic enum SignatureValidationType: Int {\n    case unknown\n    case valid\n    case invalid\n    public var title: String {\n        switch self {\n        case .unknown: return \"Signature unknown\"\n        case .valid: return \"Signature valid\"\n        case .invalid: return \"Signature invalid\"\n        }\n    }\n}\n"
  },
  {
    "path": "Example/JWTDesktopSwiftToolkit/Sources/JWTDesktopSwiftToolkit/String+Extension.swift",
    "content": "//\n//  String+Extension.swift\n//  JWTDesktopSwift\n//\n//  Created by Lobanov Dmitry on 30.10.2017.\n//  Copyright © 2017 JWTIO. All rights reserved.\n//\n\nimport Foundation\npublic extension String {\n    static func json(_ object: Any?) -> String {\n        guard let jsonObject = object else {\n            return \"\"\n        }\n        \n        if !JSONSerialization.isValidJSONObject(jsonObject) {\n            print(\"object is not valid JSONObject: \\(jsonObject)\")\n            return \"\"\n        }\n        \n        guard let data = try? JSONSerialization.data(withJSONObject: jsonObject, options: .prettyPrinted) else {\n            return \"\"\n        }\n\n        guard let string = String(data: data, encoding: .utf8) else {\n            return \"\"\n        }\n        return string\n    }\n}\n"
  },
  {
    "path": "Example/JWTDesktopSwiftToolkit/Sources/JWTDesktopSwiftToolkit/TokenDecoder.swift",
    "content": "//\n//  JWTTokenDecoder.swift\n//  JWTDesktopSwift\n//\n//  Created by Lobanov Dmitry on 30.10.2017.\n//  Copyright © 2017 JWTIO. All rights reserved.\n//\n\nimport Foundation\nimport JWT\n\npublic protocol TokenDecoderDataTransferObjectProtocol {\n    var algorithmName: String {get}\n    var secret: String? {get}\n    var secretData: Data? {get}\n    var isBase64EncodedSecret: Bool {get}\n    var shouldSkipSignatureVerification: Bool {get}\n}\n\nprivate protocol TokenDecoderProtocol {\n    func decode(token: String?, object: TokenDecoderDataTransferObjectProtocol) -> JWTCodingResultType?\n}\n\npublic struct TokenDecoder: TokenDecoderProtocol {\n    private let theDecoder: TokenDecoderProtocol = JWTTokenDecoder__V3()\n    \n    public func decode(token: String?, object: TokenDecoderDataTransferObjectProtocol?) -> JWTCodingResultType?  {\n        guard let object = object else { return nil }\n        return self.theDecoder.decode(token: token, object: object)\n    }\n    \n    func decode(token: String?, object: TokenDecoderDataTransferObjectProtocol) -> JWTCodingResultType? {\n        self.theDecoder.decode(token: token, object: object)\n    }\n    public init() {}\n}\n\npublic extension TokenDecoder {\n    struct DataTransferObject: TokenDecoderDataTransferObjectProtocol {\n        public init(algorithmName: String, secret: String? = nil, secretData: Data? = nil, isBase64EncodedSecret: Bool, shouldSkipSignatureVerification: Bool) {\n            self.algorithmName = algorithmName\n            self.secret = secret\n            self.secretData = secretData\n            self.isBase64EncodedSecret = isBase64EncodedSecret\n            self.shouldSkipSignatureVerification = shouldSkipSignatureVerification\n        }\n        \n        public var algorithmName: String\n        public var secret: String?\n        public var secretData: Data?\n        public var isBase64EncodedSecret: Bool\n        public var shouldSkipSignatureVerification: Bool\n        \n    }\n}\n\nprivate struct JWTTokenDecoder__V2: TokenDecoderProtocol {\n    func decode(token: String?, object: TokenDecoderDataTransferObjectProtocol) -> JWTCodingResultType? {\n        // do work here.\n        print(\"JWT ENCODED TOKEN \\(String(describing: token))\")\n        let algorithmName = object.algorithmName\n        let skipVerification = object.shouldSkipSignatureVerification\n        print(\"JWT Algorithm NAME \\(algorithmName)\")\n        let builder = JWTBuilder.decodeMessage(token).algorithmName(algorithmName)?.options(skipVerification as NSNumber)\n        if (algorithmName != JWTAlgorithmNameNone) {\n            if let secretData = object.secretData, object.isBase64EncodedSecret {\n                _ = builder?.secretData(secretData)\n            }\n            else {\n                _ = builder?.secret(object.secret)\n            }\n        }\n        \n        guard let decoded = builder?.decode else {\n            print(\"JWT ERROR \\(String(describing: builder?.jwtError))\")\n            if let error = builder?.jwtError {\n                return .init(errorResult: .init(error: error))\n            }\n            else {\n                return nil\n            }\n        }\n\n        print(\"JWT DICTIONARY \\(decoded)\")\n        return .init(successResult: .init(headersAndPayload: decoded))\n    }\n}\n\nprivate struct JWTTokenDecoder__V3: TokenDecoderProtocol {\n    func decode(token: String?, object: TokenDecoderDataTransferObjectProtocol) -> JWTCodingResultType? {\n        print(\"JWT ENCODED TOKEN \\(String(describing: token))\")\n        let algorithmName = object.algorithmName\n        let skipVerification = object.shouldSkipSignatureVerification\n        print(\"JWT Algorithm NAME \\(algorithmName)\")\n        let secretData = object.secretData\n        let secret = object.secret\n        let isBase64EncodedSecret = object.isBase64EncodedSecret\n        \n        guard let algorithm = JWTAlgorithmFactory.algorithm(byName: algorithmName) else {\n            return nil\n        }\n        \n        var holder: JWTAlgorithmDataHolderProtocol? = nil\n        switch algorithm {\n        case is JWTAlgorithmRSBase, is JWTAlgorithmAsymmetricBase:\n            var key: JWTCryptoKeyProtocol?\n            do {\n                key = try JWTCryptoKeyPublic(pemEncoded: secret, parameters: nil)\n            }\n            catch let error {\n                // throw if needed\n                print(\"JWT internalError: \\(error.localizedDescription)\")\n                return .init(errorResult: .init(error: error))\n            }\n            \n            // TODO: remove dependency.\n            // Aware of last part.\n            // DataHolder MUST have a secretData ( empty data is perfect, if you use verifyKey )\n            holder = JWTAlgorithmRSFamilyDataHolder().verifyKey(key).algorithmName(algorithmName)\n        case is JWTAlgorithmHSBase:\n            let aHolder = JWTAlgorithmHSFamilyDataHolder()\n            if let theSecretData = secretData, isBase64EncodedSecret {\n                _ = aHolder.secretData(theSecretData)\n            }\n            else {\n                _ = aHolder.secret(secret)\n            }\n            holder = aHolder.algorithmName(algorithmName)\n        case is JWTAlgorithmNone:\n            holder = JWTAlgorithmNoneDataHolder()\n        default: break\n        }\n        \n        let builder = JWTDecodingBuilder.decodeMessage(token).claimsSetCoordinator(JWTClaimsSetCoordinatorBase.init()).addHolder(holder)?.options(skipVerification as NSNumber)\n        guard let result = builder?.result else {\n            return nil\n        }\n        \n        if let success = result.successResult {\n            print(\"JWT RESULT: \\(String(describing: success.debugDescription)) -> \\(String(describing: success.headerAndPayloadDictionary?.debugDescription))\")\n            return result\n        }\n        else if let error = result.errorResult {\n            print(\"JWT ERROR: \\(String(describing: error.debugDescription)) -> \\(String(describing: error.error?.localizedDescription))\")\n            return result\n        }\n        else {\n            return nil\n        }\n    }\n}\n"
  },
  {
    "path": "Example/JWTDesktopSwiftToolkit/Sources/JWTDesktopSwiftToolkit/TokenTextTypeDescription.swift",
    "content": "//\n//  TokenTextTypeDescription.swift\n//  JWTDesktopSwift\n//\n//  Created by Lobanov Dmitry on 01.10.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\nimport SwiftUI\n\n// MARK: Token text type.\npublic enum TokenTextType: Int {\n    case unknown = 0\n    case header\n    case payload\n    case signature\n    case dot\n    \n    static var typicalSchemeComponents: [Self] {\n        [.header, .dot, .payload, .dot, .signature]\n    }\n}\n\n// MARK: NSAttributes.\nextension TokenTextType {\n    fileprivate var encodedTextAttributes: [NSAttributedString.Key: Any] {\n        encodedTextAttributes(type: self)\n    }\n    \n    fileprivate func encodedTextAttributes(type: TokenTextType) -> [NSAttributedString.Key: Any] {\n        var attributes = self.defaultEncodedTextAttributes()\n        attributes[NSAttributedString.Key.foregroundColor] = type.color\n        return attributes\n    }    \n}\n\n// MARK: Serialization\nfileprivate class TokenTextSerialization {\n    fileprivate func textPart(parts: [String], type: TokenTextType) -> String? {\n        switch type {\n        case .unknown: return nil\n        case .header: return parts.first\n        case .payload where parts.count > 1: return parts[1]\n        case .signature where parts.count > 2: return parts[2..<parts.count].joined(separator: \".\")\n        case .dot: return \".\"\n        default: return nil\n        }\n    }\n    public init() {}\n}\n\n// MARK: Appearance.\npublic class TokenTextAppearance {\n    private let serialization: TokenTextSerialization = .init()\n    fileprivate func encodedAttributes(text: String, tokenSerialization: TokenTextSerialization) -> [(String, Attributes)] {\n        let parts = text.components(separatedBy: \".\")\n        \n        return TokenTextType.typicalSchemeComponents.flatMap { (type) -> [(String, Attributes)] in\n            if let part = tokenSerialization.textPart(parts: parts, type: type) {\n                let color = type.color\n                let font = type.font\n                return [(part, Attributes(color: color, font: font))]\n            }\n            return []\n        }\n    }\n    public init() {}\n}\n\n\n// MARK: Appearance.Public.\npublic extension TokenTextAppearance {\n    func encodedAttributes(text: String) -> [(string: String, attributes: Attributes)] {\n        self.encodedAttributes(text: text, tokenSerialization: self.serialization)\n    }\n    \n    func encodedAttributedString(text: String) -> NSAttributedString? {\n        self.encodedAttributes(text: text, tokenSerialization: self.serialization).reduce(NSMutableAttributedString()) { (result, pair) in\n            let (part, attributes) = pair\n            let string = NSAttributedString(string: part, attributes: [\n                .foregroundColor: attributes.color,\n                .font: attributes.font\n                ])\n            result.append(string)\n            return result\n        }\n    }\n}\n"
  },
  {
    "path": "Example/JWTDesktopSwiftToolkit/Tests/JWTDesktopSwiftToolkitTests/JWTDesktopSwiftToolkitTests.swift",
    "content": "import XCTest\n@testable import JWTDesktopSwiftToolkit\n\nfinal class JWTDesktopSwiftToolkitTests: XCTestCase {\n    func testExample() throws {\n        // This is an example of a functional test case.\n        // Use XCTAssert and related functions to verify your tests produce the correct\n        // results.\n    }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/JWTSwiftUI/AppDelegate.swift",
    "content": "//\n//  AppDelegate.swift\n//  JWTSwiftUI\n//\n//  Created by Dmitry Lobanov on 08/06/2019.\n//  Copyright © 2019 Dmitry Lobanov. All rights reserved.\n//\n\nimport UIKit\n\n@UIApplicationMain\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n    \n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {\n        // Override point for customization after application launch.\n        \n        return true\n    }\n\n    func applicationWillTerminate(_ application: UIApplication) {\n        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.\n    }\n\n    // MARK: UISceneSession Lifecycle\n\n    func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {\n        // Called when a new scene session is being created.\n        // Use this method to select a configuration to create the new scene with.\n        return UISceneConfiguration(name: \"Default Configuration\", sessionRole: connectingSceneSession.role)\n    }\n\n    func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {\n        // Called when the user discards a scene session.\n        // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.\n        // Use this method to release any resources that were specific to the discarded scenes, as they will not return.\n    }\n\n\n}\n\n"
  },
  {
    "path": "Example/JWTSwiftUI/JWTSwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"20x20\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"20x20\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"20x20\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"20x20\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"76x76\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"76x76\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"83.5x83.5\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"ios-marketing\",\n      \"size\" : \"1024x1024\",\n      \"scale\" : \"1x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "Example/JWTSwiftUI/JWTSwiftUI/Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "Example/JWTSwiftUI/JWTSwiftUI/Base.lproj/LaunchScreen.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"13122.16\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" useSafeAreas=\"YES\" colorMatched=\"YES\" initialViewController=\"01J-lp-oVM\">\n    <dependencies>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"13104.12\"/>\n        <capability name=\"Safe area layout guides\" minToolsVersion=\"9.0\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"EHf-IW-A2E\">\n            <objects>\n                <viewController id=\"01J-lp-oVM\" sceneMemberID=\"viewController\">\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"Ze5-6b-2t3\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <color key=\"backgroundColor\" xcode11CocoaTouchSystemColor=\"systemBackgroundColor\" cocoaTouchSystemColor=\"whiteColor\"/>\n                        <viewLayoutGuide key=\"safeArea\" id=\"6Tk-OE-BBY\"/>\n                    </view>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"iYj-Kq-Ea1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"53\" y=\"375\"/>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "Example/JWTSwiftUI/JWTSwiftUI/BottomView.swift",
    "content": "//\n//  BottomView.swift\n//  JWTSwiftUI\n//\n//  Created by Dmitry Lobanov on 08/06/2019.\n//  Copyright © 2019 Dmitry Lobanov. All rights reserved.\n//\n\nimport SwiftUI\nimport JWTDesktopSwiftToolkit\n\nextension BottomView {\n    struct EncryptedView: View {\n        @Binding var textValue: String\n        var appearance: TokenTextAppearance = .init()\n        var body1: some View {\n            TextField(\"Input secret\", text: $textValue).lineLimit(10).multilineTextAlignment(.center)\n        }\n        var body2: some View {\n            Text(textValue).lineLimit(10).padding()\n        }\n                \n        var body3: some View {\n            Text(\"Abc\")\n//            List {\n//                ForEach(self.appearance.encodedAttributes(text: textValue)) { value in\n//                    Text(part)\n//                }\n//            }\n        }\n        \n        var currentBody: some View {\n            TextEditor(text: self.$textValue).redacted(reason: .placeholder)\n        }\n        \n        var body: some View {\n            self.currentBody\n        }\n    }\n}\n\nextension BottomView {\n    struct DecodedView: View {\n        var decodedInformation: JWTModel.Storage.DecodedData.DecodedInfoType\n        var currentBody: some View {\n            Form {\n                ForEach(self.decodedInformation, id: \\.0) { value in\n                    Section(header: Text(value.0.rawValue)) {\n                        Text(String(describing: value.1)).bold().foregroundColor(value.0.color)\n                    }\n                }\n            }\n        }\n        var oldBody: some View {\n            VStack {\n                ForEach(self.decodedInformation, id: \\.0) { value in\n                    Text(\"\\(value.0.rawValue): \\(String(describing: value.1))\").lineLimit(10).multilineTextAlignment(.center)\n                }\n            }\n        }\n        var body: some View {\n            self.currentBody\n        }\n    }\n}\n\nextension BottomView {\n    struct SignatureView: View {\n        var validation: SignatureValidationType\n        var body: some View {\n            Text(validation.title).bold().foregroundColor(.white).padding(8)\n                .background(Color.init(validation.color)).cornerRadius(20)\n        }\n    }\n}\n\nstruct QqView: View {\n//    @State var width: Length = 1\n    static var bigText = \"This is a test of the emergency broadcast system. This is only a test. If this were a real emergency, then you'd be up the creek without a paddle. But it's not so you're safe for the time being.\"\n    @State var text: String = QqView.bigText\n    var body: some View {\n        GeometryReader {\n            geometry in\n//            ScrollView(isScrollEnabled: true, alwaysBounceHorizontal: false, alwaysBounceVertical: true, showsHorizontalIndicator: false, showsVerticalIndicator: true) {\n                VStack {\n                    TextField(\"\", text: self.$text).background(Color.red)\n                        .lineLimit(nil)\n                        .frame(\n                            minWidth: geometry.size.width,\n                            idealWidth: geometry.size.width,\n                            maxWidth: geometry.size.width,\n                            minHeight: geometry.size.height,\n                            idealHeight: geometry.size.height,\n                            maxHeight: .infinity,\n                            alignment: .topLeading)\n                }\n                \n//            }\n        }\n    }\n}\n\nstruct BottomView: View {\n    @Binding var encodedData: JWTModel.Storage.EncodedData\n    var decodedData: JWTModel.Storage.DecodedData\n    var body: some View {\n        VStack {\n            EncryptedView(textValue: $encodedData.token)\n            DecodedView(decodedInformation: decodedData.decodedInformation)\n            SignatureView(validation: decodedData.verified)\n        }\n    }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/JWTSwiftUI/ContentView.swift",
    "content": "//\n//  ContentView.swift\n//  JWTSwiftUI\n//\n//  Created by Dmitry Lobanov on 08/06/2019.\n//  Copyright © 2019 Dmitry Lobanov. All rights reserved.\n//\n\nimport SwiftUI\n\nstruct ContentView: View {\n    @ObservedObject var model: JWTModel\n    func getBottomView() -> some View {\n        BottomView(encodedData: self.$model.data.encodedData, decodedData: model.decodedData)\n    }\n    func getHeaderView() -> some View {\n        HeaderView(settings: self.$model.data.settings, encodedData: self.$model.data.encodedData, storage: self.model.data)\n    }\n    var headerBody: some View {\n        TabView {\n            self.getHeaderView().tabItem {\n                Text(\"Settings\")\n            }\n            self.getHeaderView().tabItem {\n                Text(\"Settings\")\n            }\n        }\n    }\n    var bottomBody: some View {\n        self.getBottomView().tabItem {\n            Text(\"Decoding\")\n        }\n    }\n    \n    var body1: some View {\n        TabView {\n            getBottomView().tabItem {\n                Text(\"Decoding\")\n            }\n            getHeaderView().tabItem {\n                Text(\"Settings\")\n            }\n        }\n    }\n    var body2: some View {\n        VStack {\n            getHeaderView()\n            getBottomView()\n        }\n    }\n    var body3: some View {\n        NavigationView {\n            getBottomView()\n            getHeaderView()\n        }\n    }\n    var body4: some View {\n        NavigationView {\n            VStack {\n                getBottomView()\n                getHeaderView()\n            }\n        }\n    }\n    var body5: some View {\n        #if os(macOS)\n        HSplitView {\n            getBottomView()\n            getHeaderView()\n        }\n        #else\n        body4\n        #endif\n    }\n    var body: some View {\n        body5\n    }\n}\n\n"
  },
  {
    "path": "Example/JWTSwiftUI/JWTSwiftUI/HeaderView.swift",
    "content": "//\n//  HeaderView.swift\n//  JWTSwiftUI\n//\n//  Created by Dmitry Lobanov on 08/06/2019.\n//  Copyright © 2019 Dmitry Lobanov. All rights reserved.\n//\n\nimport Foundation\nimport SwiftUI\n\nextension HeaderView {\n    struct AlgorithmView: View {\n        @Binding var chosenAlgorithm: String\n        var values: [String] = []\n        var currentBody: some View {\n            Picker(selection: $chosenAlgorithm, label: Text(\"Choose algorithm\")) {\n                ForEach(self.values, id: \\.self) { value in\n                    Text(value).tag(value)\n                }\n            }\n        }\n        var body: some View {\n            HStack {\n                self.currentBody\n            }\n        }\n    }\n}\n\nextension HeaderView {\n    struct SecretView: View {\n        @Binding var textValue: String\n        @Binding var isToogled: Bool\n        var settings: JWTModel.Storage\n        var body: some View {\n            VStack {\n//                Text(\"Secret\")\n                TextField(\"secret\", text: $textValue)\n                Toggle(isOn: $isToogled, label: {\n                    Text(\"Secret is base64\")\n                })//.disabled(!settings.isBase64Available)\n            }\n        }\n    }\n}\n\nextension HeaderView {\n    struct SignatureView: View {\n        @Binding var isToogled: Bool\n        var body: some View {\n            HStack {\n//                Text(\"Signature\")\n                Toggle(isOn: $isToogled, label: {\n                    Text(\"Skip signature verification\")\n                })\n            }\n        }\n    }\n}\n\nstruct HeaderView: View {\n    @Binding var settings: JWTModel.Storage.Settings\n    @Binding var encodedData: JWTModel.Storage.EncodedData\n    var storage: JWTModel.Storage\n    var body: some View {\n        Form {\n            Section(header: Text(\"Algorithm\")) {\n                AlgorithmView(chosenAlgorithm: $encodedData.algorithmName, values: $encodedData.wrappedValue.availableAlgorithmsNames)\n            }\n            Section(header: Text(\"Input secret\")) {\n                SecretView(textValue: $encodedData.secret, isToogled: $settings.isBase64, settings: storage)\n            }\n            Section(header: Text(\"Signature\")) {\n                SignatureView(isToogled: $settings.skipSignatureVerification)\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/JWTSwiftUI/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>$(DEVELOPMENT_LANGUAGE)</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UIApplicationSceneManifest</key>\n\t<dict>\n\t\t<key>UIApplicationSupportsMultipleScenes</key>\n\t\t<false/>\n\t\t<key>UISceneConfigurations</key>\n\t\t<dict>\n\t\t\t<key>UIWindowSceneSessionRoleApplication</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>UILaunchStoryboardName</key>\n\t\t\t\t\t<string>LaunchScreen</string>\n\t\t\t\t\t<key>UISceneConfigurationName</key>\n\t\t\t\t\t<string>Default Configuration</string>\n\t\t\t\t\t<key>UISceneDelegateClassName</key>\n\t\t\t\t\t<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t</dict>\n\t</dict>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations~ipad</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "Example/JWTSwiftUI/JWTSwiftUI/JWTModel.swift",
    "content": "//\n//  JWTData.swift\n//  JWTSwiftUI\n//\n//  Created by Dmitry Lobanov on 11/06/2019.\n//  Copyright © 2019 Dmitry Lobanov. All rights reserved.\n//\n\nimport SwiftUI\nimport Combine\nimport JWT\nimport JWTDesktopSwiftToolkit\n\nclass JWTModel: ObservableObject {\n    @Published var data: Storage {\n        didSet {\n            self.computeDecoding()\n        }\n    }\n\n    @Published var decodedData: Storage.DecodedData = .init()\n\n    var decoder: TokenDecoder = .init()\n    var appearance: TokenTextAppearance = .init()\n    public init(data: Storage) {\n        self.data = data\n        // update data right after init or in stored property setter?\n\n        // we need somehow look after values of storage.\n        self.computeDecoding()\n    }\n\n    func getObject() -> TokenDecoder.DataTransferObject {\n        let settings = self.data.settings\n        let encodedData = self.data.encodedData\n        let algorithmName = encodedData.algorithmName\n        let secret = encodedData.secret\n        let secretData: Data? = self.data.getSecretData()\n        let isBase64EncodedSecret = settings.isBase64\n        let shouldSkipSignatureVerification = settings.skipSignatureVerification\n\n        return .init(algorithmName: algorithmName, secret: secret, secretData: secretData, isBase64EncodedSecret: isBase64EncodedSecret, shouldSkipSignatureVerification: shouldSkipSignatureVerification)\n    }\n\n    func computeEncoding() {\n        // let object = self.getObject()\n    }\n\n    func computeDecoding() {\n        let object = self.getObject()\n        let token = self.data.encodedData.token\n        // and we should also populate data after decoding.\n        // check it in another JWT project.\n        // where you should update data.\n        var forSignatureObject = object\n        forSignatureObject.shouldSkipSignatureVerification = false\n\n        self.decodedData.verified = (self.decoder.decode(token: token, object: forSignatureObject)?.errorResult != nil) ? .invalid : .valid\n\n        if let decoded = self.decoder.decode(token: token, object: object) {\n            if let successResult = decoded.successResult {\n                self.decodedData.result = .success(successResult.headerAndPayloadDictionary as! [String: Any])\n            }\n            else if let errorResult = decoded.errorResult {\n                self.decodedData.result = .failure(errorResult.error)\n            }\n        }\n    }\n}\n\n// MARK: Data.\nextension JWTModel {\n    struct Storage {\n        var settings: Settings = .init()\n        var encodedData: EncodedData = .init()\n        var isBase64Available: Bool {\n            self.settings.isBase64 && self.getSecretData() != nil\n        }\n        fileprivate func getSecretData() -> Data? {\n            let secret = encodedData.secret\n            let isBase64Encoded = settings.isBase64\n            guard let result = Data(base64Encoded: secret), isBase64Encoded else {\n                return nil\n            }\n            return result\n        }\n    }\n}\n\n// MARK: Settings structure.\nextension JWTModel.Storage {\n    struct Settings {\n        var isBase64 = false // HeaderView.SecretView\n        var skipSignatureVerification = false // HeaderView.SignatureView\n    }\n}\n\n// MARK: EncodedData structure.\nextension JWTModel.Storage {\n    struct EncodedData {\n        var algorithmName = \"\" // HeaderView.AlgorithmView\n        var secret = \"\" // HeaderView.SecretView\n        var token = \"\" // BottomView.EncryptedTextView\n    }\n}\n\n// MARK: DecodedData structure.\nextension JWTModel.Storage {\n    struct DecodedData {\n        var result: Result<[String: Any], Error> = .success([:])\n        var verified: SignatureValidationType = .unknown\n        var decoded: [String: Any] {\n            guard case let .success(value) = self.result else {\n                return [:]\n            }\n            return value\n        }\n        var error: Error? {\n            guard case let .failure(value) = self.result else {\n                return nil\n            }\n            return value\n        }\n    }\n}\n\n// MARK: decodedInformation\nextension JWTModel.Storage.DecodedData {\n    typealias DecodedInfoType = [(DecodedInformation, String)]\n    private func decodedInfo() -> DecodedInfoType {\n        if let error = self.error {\n            return [\n                (.error, String.json([\"error\": error.localizedDescription]))\n            ]\n        }\n        else if let headers = decoded[JWTCodingResultComponents.headers!] as? [String: Any], let payload = decoded[JWTCodingResultComponents.payload!] as? [String: Any] {\n            return [\n                (.header, String.json(headers)),\n                (.payload, String.json(payload))\n            ]\n        }\n        else {\n            return [\n                (.unknown, String.json([\"unknown\": \"unknown\"]))\n            ]\n        }\n    }\n    var decodedInformation: DecodedInfoType {\n        self.decodedInfo()\n    }\n}\n\n// MARK: Algorithms.\nextension JWTModel.Storage.EncodedData {\n    var availableAlgorithms: [JWTAlgorithm] {\n        JWTAlgorithmFactory.algorithms\n    }\n    var availableAlgorithmsNames: [String] {\n        self.availableAlgorithms.map(\\.name)\n    }\n}\n\n// MARK: DecodedInformation\nextension JWTModel.Storage.DecodedData {\n    enum DecodedInformation: String {\n        case error\n        case header\n        case payload\n        case unknown\n        var uiColor: ColorBridge {\n            switch self {\n            case .error: return SignatureValidationType.invalid.color\n            case .header: return TokenTextType.header.color\n            case .payload: return TokenTextType.payload.color\n            case .unknown: return TokenTextType.unknown.color\n            }\n        }\n        var color: Color {\n            .init(self.uiColor)\n        }\n    }\n}\n\n//MARK: Data Seed\nextension JWTModel.Storage {\n    static func create(algorithmName: String, secret: String, token: String) -> Self {\n        let encodedData: EncodedData = .init(algorithmName: algorithmName, secret: secret, token: token)\n        let settings: Settings = .init(isBase64: true, skipSignatureVerification: false)\n        return .init(settings: settings, encodedData: encodedData)\n    }\n    static func HS256() -> Self {\n        let algorithmName = JWTAlgorithmNameHS256\n        let secret = \"c2VjcmV0\"\n        let token = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ\"\n        return self.create(algorithmName: algorithmName, secret: secret, token: token)\n    }\n\n    static func RS256() -> Self {\n        let algorithmName = JWTAlgorithmNameRS256\n        let secret = \"-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoPryo3IisfK3a028bwgso/CW5kB84mk6Y7rO76FxJRTWnOAla0Uf0OpIID7go4Qck66yT4/uPpiOQIR0oW0plTekkDP75EG3d/2mtzhiCtELV4F1r9b/InCN5dYYK8USNkKXgjbeVyatdUvCtokz10/ibNZ9qikgKf58qXnn2anGvpE6ded5FOUEukOjr7KSAfD0KDNYWgZcG7HZBxn/3N7ND9D0ATu2vxlJsNGOkH6WL1EmObo/QygBXzuZm5o0N0W15EXpWVbl4Ye7xqPnvc1i2DTKxNUcyhXfDbLw1ee2d9T/WU5895Ko2bQ/O/zPwUSobM3m+fPMW8kp5914kwIDAQAB-----END PUBLIC KEY-----\"\n        let token = \"eyJraWQiOiJqd3RfdWF0X2tleXMiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI1MDAxIiwiaXNzIjoiQ0xNIiwiZXhwIjoxNTA4MjQ5NTU3LCJqdGkiOiI2MjcyM2E4Yi0zOTZmLTQxYmYtOTljMi02NWRkMzk2MDNiNjQifQ.Cej8RJ6e2HEU27rh_TyHZBoMI1jErmhOfSFY4SRzRoijSP628hM82XxjDX24HsKqIsK1xeeGI1yg1bed4RPhnmDGt4jAY73nqguZ1oqZ2DTcfZ5olxCXyLLaytl2XH7-62M_mFUcGj7I2mwts1DQkHWnFky2i4uJXlksHFkUg2xZoGEjVHo0bxCxgQ5yQiOpxC5VodN5rAPM3A5yMG6EijOp-dvUThjoJ4RFTGKozw_x_Qg6RLGDusNcmLIMbHasTsyZAZle6RFkwO0Sij1k6z6_xssbOl-Q57m7CeYgVHMORdzy4Smkmh-0gzeiLsGbCL4fhgdHydpIFajW-eOXMw\"\n        return self.create(algorithmName: algorithmName, secret: secret, token: token)\n    }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/JWTSwiftUI/Preview Content/Preview Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "Example/JWTSwiftUI/JWTSwiftUI/SceneDelegate.swift",
    "content": "//\n//  SceneDelegate.swift\n//  JWTSwiftUI\n//\n//  Created by Dmitry Lobanov on 08/06/2019.\n//  Copyright © 2019 Dmitry Lobanov. All rights reserved.\n//\n\nimport UIKit\nimport SwiftUI\n\nclass SceneDelegate: UIResponder, UIWindowSceneDelegate {\n\n    var window: UIWindow?\n\n    var model: JWTModel = .init(data: JWTModel.Storage.HS256())\n    \n    func createController() -> UIViewController {\n        UIHostingController(rootView: ContentView(model: self.model))\n    }\n\n    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {\n        // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.\n        // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.\n        // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).\n\n        // Use a UIHostingController as window root view controller\n        if let windowScene = scene as? UIWindowScene {\n            let window = UIWindow(windowScene: windowScene)\n            window.rootViewController = self.createController()\n            self.window = window\n            window.makeKeyAndVisible()\n        }\n    }\n\n    func sceneDidDisconnect(_ scene: UIScene) {\n        // Called as the scene is being released by the system.\n        // This occurs shortly after the scene enters the background, or when its session is discarded.\n        // Release any resources associated with this scene that can be re-created the next time the scene connects.\n        // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).\n    }\n\n    func sceneDidBecomeActive(_ scene: UIScene) {\n        // Called when the scene has moved from an inactive state to an active state.\n        // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.\n    }\n\n    func sceneWillResignActive(_ scene: UIScene) {\n        // Called when the scene will move from an active state to an inactive state.\n        // This may occur due to temporary interruptions (ex. an incoming phone call).\n    }\n\n    func sceneWillEnterForeground(_ scene: UIScene) {\n        // Called as the scene transitions from the background to the foreground.\n        // Use this method to undo the changes made on entering the background.\n    }\n\n    func sceneDidEnterBackground(_ scene: UIScene) {\n        // Called as the scene transitions from the foreground to the background.\n        // Use this method to save data, release shared resources, and store enough scene-specific state information\n        // to restore the scene back to its current state.\n    }\n\n\n}\n\n"
  },
  {
    "path": "Example/JWTSwiftUI/JWTSwiftUI.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 52;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t0A60395422B22BA700256661 /* JWTModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A60395322B22BA700256661 /* JWTModel.swift */; };\n\t\t0A76C87022ABD2AF00B8A43A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A76C86F22ABD2AF00B8A43A /* AppDelegate.swift */; };\n\t\t0A76C87222ABD2AF00B8A43A /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A76C87122ABD2AF00B8A43A /* SceneDelegate.swift */; };\n\t\t0A76C87422ABD2AF00B8A43A /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A76C87322ABD2AF00B8A43A /* ContentView.swift */; };\n\t\t0A76C87622ABD2B100B8A43A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0A76C87522ABD2B100B8A43A /* Assets.xcassets */; };\n\t\t0A76C87922ABD2B100B8A43A /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0A76C87822ABD2B100B8A43A /* Preview Assets.xcassets */; };\n\t\t0A76C87C22ABD2B100B8A43A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0A76C87A22ABD2B100B8A43A /* LaunchScreen.storyboard */; };\n\t\t0A76C88422ABD2F200B8A43A /* HeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A76C88322ABD2F200B8A43A /* HeaderView.swift */; };\n\t\t0A76C88822ABE51800B8A43A /* BottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A76C88722ABE51800B8A43A /* BottomView.swift */; };\n\t\t0A883AB8266E166600DAF016 /* iOSJWTSwiftUIApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A883AB7266E166600DAF016 /* iOSJWTSwiftUIApp.swift */; };\n\t\t0A883ABC266E166900DAF016 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0A883ABB266E166900DAF016 /* Assets.xcassets */; };\n\t\t0A883ABF266E166900DAF016 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0A883ABE266E166900DAF016 /* Preview Assets.xcassets */; };\n\t\t0A883AC4266E169900DAF016 /* BottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A76C88722ABE51800B8A43A /* BottomView.swift */; };\n\t\t0A883AC5266E169900DAF016 /* JWTModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A60395322B22BA700256661 /* JWTModel.swift */; };\n\t\t0A883AC6266E169900DAF016 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A76C87322ABD2AF00B8A43A /* ContentView.swift */; };\n\t\t0A883AC7266E169900DAF016 /* HeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A76C88322ABD2F200B8A43A /* HeaderView.swift */; };\n\t\t0A883ACF266E191700DAF016 /* MacJWTSwiftUIApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A883ACE266E191700DAF016 /* MacJWTSwiftUIApp.swift */; };\n\t\t0A883AD3266E191A00DAF016 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0A883AD2266E191A00DAF016 /* Assets.xcassets */; };\n\t\t0A883AD6266E191A00DAF016 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0A883AD5266E191A00DAF016 /* Preview Assets.xcassets */; };\n\t\t0A883ADC266E192500DAF016 /* JWTModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A60395322B22BA700256661 /* JWTModel.swift */; };\n\t\t0A883ADD266E192500DAF016 /* HeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A76C88322ABD2F200B8A43A /* HeaderView.swift */; };\n\t\t0A883ADE266E192500DAF016 /* BottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A76C88722ABE51800B8A43A /* BottomView.swift */; };\n\t\t0A883ADF266E192500DAF016 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A76C87322ABD2AF00B8A43A /* ContentView.swift */; };\n\t\t0AABB95827A6A3C0006718A0 /* JWTDesktopSwiftToolkit in Frameworks */ = {isa = PBXBuildFile; productRef = 0AABB95727A6A3C0006718A0 /* JWTDesktopSwiftToolkit */; };\n\t\t0AABB95A27A6A3C4006718A0 /* JWTDesktopSwiftToolkit in Frameworks */ = {isa = PBXBuildFile; productRef = 0AABB95927A6A3C4006718A0 /* JWTDesktopSwiftToolkit */; };\n\t\t0AC002762786598E002167AD /* JWTDesktopSwiftToolkit in Frameworks */ = {isa = PBXBuildFile; productRef = 0AC002752786598E002167AD /* JWTDesktopSwiftToolkit */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t0AEEA8BB22B5400E00B67217 /* Embed Frameworks */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"\";\n\t\t\tdstSubfolderSpec = 10;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tname = \"Embed Frameworks\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t0A60395322B22BA700256661 /* JWTModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JWTModel.swift; sourceTree = \"<group>\"; };\n\t\t0A76C86C22ABD2AF00B8A43A /* JWTSwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JWTSwiftUI.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t0A76C86F22ABD2AF00B8A43A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = \"<group>\"; };\n\t\t0A76C87122ABD2AF00B8A43A /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = \"<group>\"; };\n\t\t0A76C87322ABD2AF00B8A43A /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = \"<group>\"; };\n\t\t0A76C87522ABD2B100B8A43A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t0A76C87822ABD2B100B8A43A /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = \"Preview Assets.xcassets\"; sourceTree = \"<group>\"; };\n\t\t0A76C87B22ABD2B100B8A43A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = \"<group>\"; };\n\t\t0A76C87D22ABD2B100B8A43A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t0A76C88322ABD2F200B8A43A /* HeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderView.swift; sourceTree = \"<group>\"; };\n\t\t0A76C88722ABE51800B8A43A /* BottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomView.swift; sourceTree = \"<group>\"; };\n\t\t0A883AB5266E166600DAF016 /* iOSJWTSwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOSJWTSwiftUI.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t0A883AB7266E166600DAF016 /* iOSJWTSwiftUIApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSJWTSwiftUIApp.swift; sourceTree = \"<group>\"; };\n\t\t0A883AB9266E166600DAF016 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = \"<group>\"; };\n\t\t0A883ABB266E166900DAF016 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t0A883ABE266E166900DAF016 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = \"Preview Assets.xcassets\"; sourceTree = \"<group>\"; };\n\t\t0A883AC0266E166900DAF016 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t0A883ACC266E191700DAF016 /* MacJWTSwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MacJWTSwiftUI.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t0A883ACE266E191700DAF016 /* MacJWTSwiftUIApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacJWTSwiftUIApp.swift; sourceTree = \"<group>\"; };\n\t\t0A883AD0266E191700DAF016 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = \"<group>\"; };\n\t\t0A883AD2266E191A00DAF016 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t0A883AD5266E191A00DAF016 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = \"Preview Assets.xcassets\"; sourceTree = \"<group>\"; };\n\t\t0A883AD7266E191A00DAF016 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t0A883AD8266E191A00DAF016 /* MacJWTSwiftUI.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MacJWTSwiftUI.entitlements; sourceTree = \"<group>\"; };\n\t\t0ABC6F5A266A908000089885 /* JWT.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = JWT.framework; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t0ABC6F62266A918000089885 /* JWT.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = JWT.framework; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t0AC00271278658F8002167AD /* JWTDesktopSwiftToolkit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = JWTDesktopSwiftToolkit; path = ../JWTDesktopSwiftToolkit; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t0A76C86922ABD2AF00B8A43A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0AC002762786598E002167AD /* JWTDesktopSwiftToolkit in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t0A883AB2266E166600DAF016 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0AABB95A27A6A3C4006718A0 /* JWTDesktopSwiftToolkit in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t0A883AC9266E191700DAF016 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0AABB95827A6A3C0006718A0 /* JWTDesktopSwiftToolkit in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t0A76C86322ABD2AF00B8A43A = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0AC00271278658F8002167AD /* JWTDesktopSwiftToolkit */,\n\t\t\t\t0A76C86E22ABD2AF00B8A43A /* JWTSwiftUI */,\n\t\t\t\t0A883AB6266E166600DAF016 /* iOSJWTSwiftUI */,\n\t\t\t\t0A883ACD266E191700DAF016 /* MacJWTSwiftUI */,\n\t\t\t\t0A76C86D22ABD2AF00B8A43A /* Products */,\n\t\t\t\t0ABC6F59266A908000089885 /* Frameworks */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0A76C86D22ABD2AF00B8A43A /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0A76C86C22ABD2AF00B8A43A /* JWTSwiftUI.app */,\n\t\t\t\t0A883AB5266E166600DAF016 /* iOSJWTSwiftUI.app */,\n\t\t\t\t0A883ACC266E191700DAF016 /* MacJWTSwiftUI.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0A76C86E22ABD2AF00B8A43A /* JWTSwiftUI */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0A60395322B22BA700256661 /* JWTModel.swift */,\n\t\t\t\t0A76C86F22ABD2AF00B8A43A /* AppDelegate.swift */,\n\t\t\t\t0A76C87122ABD2AF00B8A43A /* SceneDelegate.swift */,\n\t\t\t\t0A76C87322ABD2AF00B8A43A /* ContentView.swift */,\n\t\t\t\t0A76C88322ABD2F200B8A43A /* HeaderView.swift */,\n\t\t\t\t0A76C88722ABE51800B8A43A /* BottomView.swift */,\n\t\t\t\t0A76C87522ABD2B100B8A43A /* Assets.xcassets */,\n\t\t\t\t0A76C87A22ABD2B100B8A43A /* LaunchScreen.storyboard */,\n\t\t\t\t0A76C87D22ABD2B100B8A43A /* Info.plist */,\n\t\t\t\t0A76C87722ABD2B100B8A43A /* Preview Content */,\n\t\t\t);\n\t\t\tpath = JWTSwiftUI;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0A76C87722ABD2B100B8A43A /* Preview Content */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0A76C87822ABD2B100B8A43A /* Preview Assets.xcassets */,\n\t\t\t);\n\t\t\tpath = \"Preview Content\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0A883AB6266E166600DAF016 /* iOSJWTSwiftUI */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0A883AB7266E166600DAF016 /* iOSJWTSwiftUIApp.swift */,\n\t\t\t\t0A883AB9266E166600DAF016 /* ContentView.swift */,\n\t\t\t\t0A883ABB266E166900DAF016 /* Assets.xcassets */,\n\t\t\t\t0A883AC0266E166900DAF016 /* Info.plist */,\n\t\t\t\t0A883ABD266E166900DAF016 /* Preview Content */,\n\t\t\t);\n\t\t\tpath = iOSJWTSwiftUI;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0A883ABD266E166900DAF016 /* Preview Content */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0A883ABE266E166900DAF016 /* Preview Assets.xcassets */,\n\t\t\t);\n\t\t\tpath = \"Preview Content\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0A883ACD266E191700DAF016 /* MacJWTSwiftUI */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0A883ACE266E191700DAF016 /* MacJWTSwiftUIApp.swift */,\n\t\t\t\t0A883AD0266E191700DAF016 /* ContentView.swift */,\n\t\t\t\t0A883AD2266E191A00DAF016 /* Assets.xcassets */,\n\t\t\t\t0A883AD7266E191A00DAF016 /* Info.plist */,\n\t\t\t\t0A883AD8266E191A00DAF016 /* MacJWTSwiftUI.entitlements */,\n\t\t\t\t0A883AD4266E191A00DAF016 /* Preview Content */,\n\t\t\t);\n\t\t\tpath = MacJWTSwiftUI;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0A883AD4266E191A00DAF016 /* Preview Content */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0A883AD5266E191A00DAF016 /* Preview Assets.xcassets */,\n\t\t\t);\n\t\t\tpath = \"Preview Content\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0ABC6F59266A908000089885 /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0ABC6F62266A918000089885 /* JWT.framework */,\n\t\t\t\t0ABC6F5A266A908000089885 /* JWT.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t0A76C86B22ABD2AF00B8A43A /* JWTSwiftUI */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 0A76C88022ABD2B100B8A43A /* Build configuration list for PBXNativeTarget \"JWTSwiftUI\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t0A76C86822ABD2AF00B8A43A /* Sources */,\n\t\t\t\t0A76C86922ABD2AF00B8A43A /* Frameworks */,\n\t\t\t\t0A76C86A22ABD2AF00B8A43A /* Resources */,\n\t\t\t\t0AEEA8BB22B5400E00B67217 /* Embed Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = JWTSwiftUI;\n\t\t\tpackageProductDependencies = (\n\t\t\t\t0AC002752786598E002167AD /* JWTDesktopSwiftToolkit */,\n\t\t\t);\n\t\t\tproductName = JWTSwiftUI;\n\t\t\tproductReference = 0A76C86C22ABD2AF00B8A43A /* JWTSwiftUI.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t0A883AB4266E166600DAF016 /* iOSJWTSwiftUI */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 0A883AC1266E166900DAF016 /* Build configuration list for PBXNativeTarget \"iOSJWTSwiftUI\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t0A883AB1266E166600DAF016 /* Sources */,\n\t\t\t\t0A883AB2266E166600DAF016 /* Frameworks */,\n\t\t\t\t0A883AB3266E166600DAF016 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = iOSJWTSwiftUI;\n\t\t\tpackageProductDependencies = (\n\t\t\t\t0AABB95927A6A3C4006718A0 /* JWTDesktopSwiftToolkit */,\n\t\t\t);\n\t\t\tproductName = iOSJWTSwiftUI;\n\t\t\tproductReference = 0A883AB5266E166600DAF016 /* iOSJWTSwiftUI.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t0A883ACB266E191700DAF016 /* MacJWTSwiftUI */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 0A883AD9266E191A00DAF016 /* Build configuration list for PBXNativeTarget \"MacJWTSwiftUI\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t0A883AC8266E191700DAF016 /* Sources */,\n\t\t\t\t0A883AC9266E191700DAF016 /* Frameworks */,\n\t\t\t\t0A883ACA266E191700DAF016 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = MacJWTSwiftUI;\n\t\t\tpackageProductDependencies = (\n\t\t\t\t0AABB95727A6A3C0006718A0 /* JWTDesktopSwiftToolkit */,\n\t\t\t);\n\t\t\tproductName = MacJWTSwiftUI;\n\t\t\tproductReference = 0A883ACC266E191700DAF016 /* MacJWTSwiftUI.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t0A76C86422ABD2AF00B8A43A /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastSwiftUpdateCheck = 1250;\n\t\t\t\tLastUpgradeCheck = 1250;\n\t\t\t\tORGANIZATIONNAME = \"Dmitry Lobanov\";\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t0A76C86B22ABD2AF00B8A43A = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 11.0;\n\t\t\t\t\t};\n\t\t\t\t\t0A883AB4266E166600DAF016 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 12.5;\n\t\t\t\t\t};\n\t\t\t\t\t0A883ACB266E191700DAF016 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 12.5;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 0A76C86722ABD2AF00B8A43A /* Build configuration list for PBXProject \"JWTSwiftUI\" */;\n\t\t\tcompatibilityVersion = \"Xcode 9.3\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 0A76C86322ABD2AF00B8A43A;\n\t\t\tproductRefGroup = 0A76C86D22ABD2AF00B8A43A /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t0A76C86B22ABD2AF00B8A43A /* JWTSwiftUI */,\n\t\t\t\t0A883AB4266E166600DAF016 /* iOSJWTSwiftUI */,\n\t\t\t\t0A883ACB266E191700DAF016 /* MacJWTSwiftUI */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t0A76C86A22ABD2AF00B8A43A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0A76C87C22ABD2B100B8A43A /* LaunchScreen.storyboard in Resources */,\n\t\t\t\t0A76C87922ABD2B100B8A43A /* Preview Assets.xcassets in Resources */,\n\t\t\t\t0A76C87622ABD2B100B8A43A /* Assets.xcassets in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t0A883AB3266E166600DAF016 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0A883ABF266E166900DAF016 /* Preview Assets.xcassets in Resources */,\n\t\t\t\t0A883ABC266E166900DAF016 /* Assets.xcassets in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t0A883ACA266E191700DAF016 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0A883AD6266E191A00DAF016 /* Preview Assets.xcassets in Resources */,\n\t\t\t\t0A883AD3266E191A00DAF016 /* Assets.xcassets in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t0A76C86822ABD2AF00B8A43A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0A60395422B22BA700256661 /* JWTModel.swift in Sources */,\n\t\t\t\t0A76C87022ABD2AF00B8A43A /* AppDelegate.swift in Sources */,\n\t\t\t\t0A76C87222ABD2AF00B8A43A /* SceneDelegate.swift in Sources */,\n\t\t\t\t0A76C87422ABD2AF00B8A43A /* ContentView.swift in Sources */,\n\t\t\t\t0A76C88822ABE51800B8A43A /* BottomView.swift in Sources */,\n\t\t\t\t0A76C88422ABD2F200B8A43A /* HeaderView.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t0A883AB1266E166600DAF016 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0A883AC4266E169900DAF016 /* BottomView.swift in Sources */,\n\t\t\t\t0A883AC7266E169900DAF016 /* HeaderView.swift in Sources */,\n\t\t\t\t0A883AC6266E169900DAF016 /* ContentView.swift in Sources */,\n\t\t\t\t0A883AB8266E166600DAF016 /* iOSJWTSwiftUIApp.swift in Sources */,\n\t\t\t\t0A883AC5266E169900DAF016 /* JWTModel.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t0A883AC8266E191700DAF016 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0A883ACF266E191700DAF016 /* MacJWTSwiftUIApp.swift in Sources */,\n\t\t\t\t0A883ADF266E192500DAF016 /* ContentView.swift in Sources */,\n\t\t\t\t0A883ADD266E192500DAF016 /* HeaderView.swift in Sources */,\n\t\t\t\t0A883ADC266E192500DAF016 /* JWTModel.swift in Sources */,\n\t\t\t\t0A883ADE266E192500DAF016 /* BottomView.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXVariantGroup section */\n\t\t0A76C87A22ABD2B100B8A43A /* LaunchScreen.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t0A76C87B22ABD2B100B8A43A /* Base */,\n\t\t\t);\n\t\t\tname = LaunchScreen.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t0A76C87E22ABD2B100B8A43A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++14\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu11;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 14.5;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;\n\t\t\t\tMTL_FAST_MATH = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t0A76C87F22ABD2B100B8A43A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++14\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu11;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 14.5;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tMTL_FAST_MATH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_COMPILATION_MODE = wholemodule;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-O\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t0A76C88122ABD2B100B8A43A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tDEVELOPMENT_ASSET_PATHS = \"JWTSwiftUI/Preview\\\\ Content\";\n\t\t\t\tENABLE_PREVIEWS = YES;\n\t\t\t\tINFOPLIST_FILE = JWTSwiftUI/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = org.example.JWTSwiftUI;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSUPPORTED_PLATFORMS = \"iphonesimulator iphoneos\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t0A76C88222ABD2B100B8A43A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tDEVELOPMENT_ASSET_PATHS = \"JWTSwiftUI/Preview\\\\ Content\";\n\t\t\t\tENABLE_PREVIEWS = YES;\n\t\t\t\tINFOPLIST_FILE = JWTSwiftUI/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = org.example.JWTSwiftUI;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSUPPORTED_PLATFORMS = \"iphonesimulator iphoneos\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t0A883AC2266E166900DAF016 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tDEVELOPMENT_ASSET_PATHS = \"\\\"iOSJWTSwiftUI/Preview Content\\\"\";\n\t\t\t\tENABLE_PREVIEWS = YES;\n\t\t\t\tINFOPLIST_FILE = iOSJWTSwiftUI/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 14.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = org.opensource.iOSJWTSwiftUI;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t0A883AC3266E166900DAF016 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tDEVELOPMENT_ASSET_PATHS = \"\\\"iOSJWTSwiftUI/Preview Content\\\"\";\n\t\t\t\tENABLE_PREVIEWS = YES;\n\t\t\t\tINFOPLIST_FILE = iOSJWTSwiftUI/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 14.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = org.opensource.iOSJWTSwiftUI;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t0A883ADA266E191A00DAF016 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;\n\t\t\t\tCODE_SIGN_ENTITLEMENTS = MacJWTSwiftUI/MacJWTSwiftUI.entitlements;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tDEVELOPMENT_ASSET_PATHS = \"\\\"MacJWTSwiftUI/Preview Content\\\"\";\n\t\t\t\tENABLE_PREVIEWS = YES;\n\t\t\t\tINFOPLIST_FILE = MacJWTSwiftUI/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/../Frameworks\",\n\t\t\t\t);\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 11.3;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = org.opensource.MacJWTSwiftUI;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t0A883ADB266E191A00DAF016 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;\n\t\t\t\tCODE_SIGN_ENTITLEMENTS = MacJWTSwiftUI/MacJWTSwiftUI.entitlements;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tDEVELOPMENT_ASSET_PATHS = \"\\\"MacJWTSwiftUI/Preview Content\\\"\";\n\t\t\t\tENABLE_PREVIEWS = YES;\n\t\t\t\tINFOPLIST_FILE = MacJWTSwiftUI/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/../Frameworks\",\n\t\t\t\t);\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 11.3;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = org.opensource.MacJWTSwiftUI;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t0A76C86722ABD2AF00B8A43A /* Build configuration list for PBXProject \"JWTSwiftUI\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t0A76C87E22ABD2B100B8A43A /* Debug */,\n\t\t\t\t0A76C87F22ABD2B100B8A43A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t0A76C88022ABD2B100B8A43A /* Build configuration list for PBXNativeTarget \"JWTSwiftUI\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t0A76C88122ABD2B100B8A43A /* Debug */,\n\t\t\t\t0A76C88222ABD2B100B8A43A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t0A883AC1266E166900DAF016 /* Build configuration list for PBXNativeTarget \"iOSJWTSwiftUI\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t0A883AC2266E166900DAF016 /* Debug */,\n\t\t\t\t0A883AC3266E166900DAF016 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t0A883AD9266E191A00DAF016 /* Build configuration list for PBXNativeTarget \"MacJWTSwiftUI\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t0A883ADA266E191A00DAF016 /* Debug */,\n\t\t\t\t0A883ADB266E191A00DAF016 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\n/* Begin XCSwiftPackageProductDependency section */\n\t\t0AABB95727A6A3C0006718A0 /* JWTDesktopSwiftToolkit */ = {\n\t\t\tisa = XCSwiftPackageProductDependency;\n\t\t\tproductName = JWTDesktopSwiftToolkit;\n\t\t};\n\t\t0AABB95927A6A3C4006718A0 /* JWTDesktopSwiftToolkit */ = {\n\t\t\tisa = XCSwiftPackageProductDependency;\n\t\t\tproductName = JWTDesktopSwiftToolkit;\n\t\t};\n\t\t0AC002752786598E002167AD /* JWTDesktopSwiftToolkit */ = {\n\t\t\tisa = XCSwiftPackageProductDependency;\n\t\t\tproductName = JWTDesktopSwiftToolkit;\n\t\t};\n/* End XCSwiftPackageProductDependency section */\n\t};\n\trootObject = 0A76C86422ABD2AF00B8A43A /* Project object */;\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/JWTSwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "Example/JWTSwiftUI/JWTSwiftUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IDEDidComputeMac32BitWarning</key>\n\t<true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "Example/JWTSwiftUI/MacJWTSwiftUI/Assets.xcassets/AccentColor.colorset/Contents.json",
    "content": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/MacJWTSwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"mac\",\n      \"scale\" : \"1x\",\n      \"size\" : \"16x16\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"scale\" : \"2x\",\n      \"size\" : \"16x16\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"scale\" : \"1x\",\n      \"size\" : \"32x32\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"scale\" : \"2x\",\n      \"size\" : \"32x32\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"scale\" : \"1x\",\n      \"size\" : \"128x128\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"scale\" : \"2x\",\n      \"size\" : \"128x128\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"scale\" : \"1x\",\n      \"size\" : \"256x256\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"scale\" : \"2x\",\n      \"size\" : \"256x256\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"scale\" : \"1x\",\n      \"size\" : \"512x512\"\n    },\n    {\n      \"idiom\" : \"mac\",\n      \"scale\" : \"2x\",\n      \"size\" : \"512x512\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/MacJWTSwiftUI/Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/MacJWTSwiftUI/ContentView.swift",
    "content": "//\n//  ContentView.swift\n//  MacJWTSwiftUI\n//\n//  Created by Dmitry Lobanov on 07.06.2021.\n//  Copyright © 2021 Dmitry Lobanov. All rights reserved.\n//\n\nimport SwiftUI\n\nstruct ContentView: View {\n    var body: some View {\n        Text(\"Hello, world!\")\n            .padding()\n    }\n}\n\nstruct ContentView_Previews: PreviewProvider {\n    static var previews: some View {\n        ContentView()\n    }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/MacJWTSwiftUI/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>$(DEVELOPMENT_LANGUAGE)</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSMinimumSystemVersion</key>\n\t<string>$(MACOSX_DEPLOYMENT_TARGET)</string>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>Copyright © 2021 Dmitry Lobanov. All rights reserved.</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Example/JWTSwiftUI/MacJWTSwiftUI/MacJWTSwiftUI.entitlements",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n    <key>com.apple.security.app-sandbox</key>\n    <true/>\n    <key>com.apple.security.files.user-selected.read-only</key>\n    <true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "Example/JWTSwiftUI/MacJWTSwiftUI/MacJWTSwiftUIApp.swift",
    "content": "//\n//  MacJWTSwiftUIApp.swift\n//  MacJWTSwiftUI\n//\n//  Created by Dmitry Lobanov on 07.06.2021.\n//  Copyright © 2021 Dmitry Lobanov. All rights reserved.\n//\n\nimport SwiftUI\n\n@main\nstruct MacJWTSwiftUIApp: App {\n    @StateObject private var model: JWTModel = .init(data: .RS256())\n\n    var body: some Scene {\n        WindowGroup {\n            ContentView.init(model: self.model)\n        }\n    }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/MacJWTSwiftUI/Preview Content/Preview Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/iOSJWTSwiftUI/Assets.xcassets/AccentColor.colorset/Contents.json",
    "content": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/iOSJWTSwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"76x76\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"76x76\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"83.5x83.5\"\n    },\n    {\n      \"idiom\" : \"ios-marketing\",\n      \"scale\" : \"1x\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/iOSJWTSwiftUI/Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/iOSJWTSwiftUI/ContentView.swift",
    "content": "//\n//  ContentView.swift\n//  iOSJWTSwiftUI\n//\n//  Created by Dmitry Lobanov on 07.06.2021.\n//  Copyright © 2021 Dmitry Lobanov. All rights reserved.\n//\n\nimport SwiftUI\n\nstruct ContentView: View {\n    var body: some View {\n        Text(\"Hello, world!\")\n            .padding()\n    }\n}\n\nstruct ContentView_Previews: PreviewProvider {\n    static var previews: some View {\n        ContentView()\n    }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/iOSJWTSwiftUI/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>$(DEVELOPMENT_LANGUAGE)</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UIApplicationSceneManifest</key>\n\t<dict>\n\t\t<key>UIApplicationSupportsMultipleScenes</key>\n\t\t<true/>\n\t</dict>\n\t<key>UIApplicationSupportsIndirectInputEvents</key>\n\t<true/>\n\t<key>UILaunchScreen</key>\n\t<dict/>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations~ipad</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "Example/JWTSwiftUI/iOSJWTSwiftUI/Preview Content/Preview Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Example/JWTSwiftUI/iOSJWTSwiftUI/iOSJWTSwiftUIApp.swift",
    "content": "//\n//  iOSJWTSwiftUIApp.swift\n//  iOSJWTSwiftUI\n//\n//  Created by Dmitry Lobanov on 07.06.2021.\n//  Copyright © 2021 Dmitry Lobanov. All rights reserved.\n//\n\nimport SwiftUI\n\n@main\nstruct iOSJWTSwiftUIApp: App {\n    @StateObject private var model: JWTModel = .init(data: .RS256())\n\n    var body: some Scene {\n        WindowGroup {\n            ContentView.init(model: self.model)\n        }\n    }\n}\n"
  },
  {
    "path": "JWT.podspec",
    "content": "class VersionFile\n  class << self\n    def version\n      File.new(self.filepath).gets.rstrip\n    end\n    def filepath\n      './VERSION'\n    end\n  end\nend\n\nPod::Spec.new do |s|\n  s.name         = 'JWT'\n  s.version      = \"#{VersionFile.version}\"\n  s.summary      = 'A JSON Web Token implementation in Objective-C.'\n  s.homepage     = \"https://github.com/yourkarma/#{s.name}\"\n  s.license      = { :type => 'MIT', :file => 'LICENSE' }\n  s.author       = { 'Klaas Pieter Annema' => 'klaaspieter@annema.me' }\n  s.source       = { :git => \"https://github.com/yourkarma/#{s.name}.git\", :tag => s.version.to_s }\n\n\n  s.ios.deployment_target = '6.0'\n  s.osx.deployment_target = '10.8'\n  s.tvos.deployment_target = '9.0'\n  s.watchos.deployment_target = '7.4'\n  s.source_files = 'Sources/**/*.{h,m}'\n  s.private_header_files = 'Sources/**/*Subclass.{hm}'\n  s.module_name = s.name\n  s.requires_arc = true\n  s.framework    = 'Security'\n  s.dependency 'Base64', '~> 1.1.2'\nend\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) 2013 Karma Mobility, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "Package.resolved",
    "content": "{\n  \"object\": {\n    \"pins\": [\n      {\n        \"package\": \"Base64\",\n        \"repositoryURL\": \"https://github.com/lolgear/Base64\",\n        \"state\": {\n          \"branch\": \"distribution/swift_package_manager_support\",\n          \"revision\": \"015ce993db89e0212c1ea0d5aa845abb478d4313\",\n          \"version\": null\n        }\n      }\n    ]\n  },\n  \"version\": 1\n}\n"
  },
  {
    "path": "Package.swift",
    "content": "// swift-tools-version:5.4\n// The swift-tools-version declares the minimum version of Swift required to build this package.\nimport PackageDescription\n\nlet package = Package(\n    name: \"JWT\",\n    platforms: [\n        .iOS(.v9),\n        .macOS(.v10_10),\n        .watchOS(.v3),\n        .tvOS(.v9),\n    ],\n    products: [\n        // Products define the executables and libraries produced by a package, and make them visible to other packages.\n        .library(\n            name: \"JWT\",\n            targets: [\"JWT\"]\n        )\n    ],\n    dependencies: [.package(url: \"https://github.com/lolgear/Base64\", .branchItem(\"distribution/swift_package_manager_support\"))],\n    targets: [\n        // Targets are the basic building blocks of a package. A target can define a module or a test suite.\n        // Targets can depend on other targets in this package, and on products in packages which this package depends on.\n        .target(\n            name: \"JWT\",\n            dependencies: [\"Base64\"]\n        ),\n        .testTarget(\n            name: \"JWTTests\",\n            dependencies: [\"JWT\"]\n        ),\n    ]\n)\n"
  },
  {
    "path": "README.md",
    "content": "[![JWT](http://jwt.io/assets/logo.svg)](https://jwt.io/)\n\n[![Build Status](https://travis-ci.org/yourkarma/JWT.svg?branch=master)](https://travis-ci.org/yourkarma/JWT)\n[![Pod Version](http://img.shields.io/cocoapods/v/JWT.svg?style=flat)](http://cocoadocs.org/docsets/JWT)\n[![Pod Platform](http://img.shields.io/cocoapods/p/JWT.svg?style=flat)](http://cocoadocs.org/docsets/JWT)\n[![Gitter](https://badges.gitter.im/ObjectiveC-JWT/community.svg)](https://gitter.im/ObjectiveC-JWT/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)\n# JWT\n\nA [JSON Web Token][] implementation in Objective-C.\n\n[JSON Web Token]: http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html\n\n# What's new in master and bleeding edge.\n\n* Version Three release (?)\n* [Custom Claims](Documentation/Prerelease/custom_claims.md).\n* EC algorithms support.\n* Keys extraction from Pem files has been updated.\n\n## Custom Claims.\n\n### Deprecation.\nOld ClaimsSet API has been deprecated and will be removed in API version 3.0.\n\n### Process.\n\n1. Define custom serializer for a claim.\n2. Define custom verifier for a claim.\n3. Register new claim with serializer and verifier at claims set coordinator.\n\n### [Example](Documentation/Prerelease/custom_claims.md).\n\n```objective-c\n- (void)test {\n    /// Setup ClaimsSetCoordinator\n    __auto_type claim = JWTClaimVariations.intersectionOfIntervals;\n    __auto_type claimSerializer = JWTClaimSerializerVariations.interval;\n    __auto_type claimVerifier = JWTClaimVerifierVariations.intersection;\n\n    id<JWTClaimsSetCoordinatorProtocol> claimsSetCoordinator = [JWTClaimsSetCoordinatorBase new];\n    [claimsSetCoordinator registerClaim:claim serializer:claimSerializer verifier:claimVerifier forClaimName:JWTClaimsNames.intersectionOfIntervals];\n\n    __auto_type deserialized = ({\n        claimsSetCoordinator.configureClaimsSet(^JWTClaimsSetDSLBase *(JWTClaimsSetDSLBase *claimsSetDSL) {\n            claimsSetDSL.intersection = @[@(2), @(5)];\n            return claimsSetDSL;\n        });\n        self.claimsSetCoordinator.claimsSetStorage;\n    });\n    \n    __auto_type serialized = ({\n        __auto_type dictionary = [self.claimsSetCoordinator.claimsSetSerializer dictionaryFromClaimsSet:deserialized];\n        dictionary;\n    });\n    \n    __auto_type result = @{\n        JWTClaimsNames.intersectionOfIntervals : @\"2,5\"\n    };\n    XCTAssertEqual(serialized.count, 1);\n    XCTAssertEqualObjects(serialized, result);\n}\n```\n\n## EC algorithms support.\n\n### Prerequisites.\n\n* Certificate and P12 for Public and Private keys accordingly.\n* Pem files with keys in *ANSI X9.63* format.\n\n### Example.\n\n```objective-c\nNSString *privateKeyString = @\"<ANSI X9.63 formatted key>\";\nNSString *publicKeyString = @\"<ANSI X9.63 formatted key>\";\n\n// Note: We should pass type of key. Default type is RSA.\nNSDictionary *parameters = @{JWTCryptoKey.parametersKeyBuilder : JWTCryptoKeyBuilder.new.keyTypeEC};\n\nid <JWTCryptoKeyProtocol> privateKey = [[JWTCryptoKeyPrivate alloc] initWithPemEncoded:privateKeyString parameters:parameters error:nil];\nid <JWTCryptoKeyProtocol> publicKey = [[JWTCryptoKeyPublic alloc] initWithPemEncoded:publicKeyString parameters:parameters error:nil];\n\n// Note: JWTAlgorithmRSFamilyDataHolder will be renamed to something more appropriate. It can holds any asymmetric keys pair (private and public).\nid <JWTAlgorithmDataHolderProtocol> holder = [JWTAlgorithmRSFamilyDataHolder new].signKey(privateKey).verifyKey(publicKey).algorithmName(JWTAlgorithmNameES256);\n```\n\n\n# What's new in Version 3.0\n\n* Fluent style expanded.\n* Coding result types added.\n* Algorithms and data holders.\n* Algorithms and data holders chain.\n* Keys loaded from Pem files.\n\n## Introduction to Algorithms data holders and chain.\nYou have an algorithm, a secret data and an unknown jwt token.\nLet's try to decode it.\n\n```objective-c\n// create token\nNSString *token = @\"...\";\n\n// possible that algorithm could return error.\n// you could try use algorithm and data chain.\n\nNSString *firstSecret = @\"first\";\nNSString *firstAlgorithmName = JWTAlgorithmNameHS384;\n\nid <JWTAlgorithmDataHolderProtocol> firstHolder = [JWTAlgorithmHSFamilyDataHolder new].algorithmName(firstAlgorithmName).secret(firstSecret);\n\nid <JWTAlgorithmDataHolderProtocol> errorHolder = [JWTAlgorithmNoneDataHolder new];\n\n// chain together.\nJWTAlgorithmDataHolderChain *chain = [[JWTAlgorithmDataHolderChain alloc] initWithHolders:@[firstHolder, errorHolder]];\n\n// or add them in builder\n[JWTDecodingBuilder decodeMessage:token].addHolder(firstHolder).addHolder(errorHolder);\n\n// or add them as chain\n[JWTDecodingBuilder decodeMessage:token].chain(chain);\n```\n\nMaybe you would like to try different secrets.\n\n```objective-c\n// possible that your algorithm has several secrets.\n// you don't know which secret to use.\n// but you want to decode it.\nNSString *firstSecret = @\"first\";\nNSArray *manySecrets = @[@\"second\", @\"third\", @\"forty two\"];\n// translate to data\nNSArray *manySecretsData = @[];\nfor (NSString *secret in manySecrets) {\n    NSData *secretData = [JWTBase64Coder dataWithBase64UrlEncodedString:secret];\n    if (secret) {\n        manySecretsData = [manySecretsData arrayByAddingObject:secretData];\n    }\n}\n\nNSString *algorithmName = JWTAlgorithmNameHS384;\n\nid <JWTAlgorithmDataHolderProtocol> firstHolder = [JWTAlgorithmHSFamilyDataHolder new].algorithmName(algorithmName).secret(firstSecret);\n\n// lets create chain\nJWTAlgorithmDataHolderChain *chain = [JWTAlgorithmDataHolderChain chainWithHolder:firstHolder];\n\n// and lets populate chain with secrets.\nNSLog(@\"chain has: %@\", chain.debugDescription);\n\nJWTAlgorithmDataHolderChain *expandedChain = [chain chainByPopulatingAlgorithm:firstHolder.currentAlgorithm withManySecretData:manySecretsData];\n\n// now we have expanded chain with many secrets and one algorithm.\nNSLog(@\"expanded chain has: %@\", expandedChain.debugDescription);\n```\n\n## Decode and encode with chain.\n\n```objective-c\nJWTClaimsSet *claimsSet = [[JWTClaimsSet alloc] init];\n// fill it\nclaimsSet.issuer = @\"Facebook\";\nclaimsSet.subject = @\"Token\";\nclaimsSet.audience = @\"https://jwt.io\";\n\n// encode it\nNSString *secret = @\"secret\";\nNSString *algorithmName = @\"HS384\";\nNSDictionary *headers = @{@\"custom\":@\"value\"};\n\nid<JWTAlgorithmDataHolderProtocol>holder = [JWTAlgorithmHSFamilyDataHolder new].algorithmName(algorithmName).secret(secret);\n\nJWTCodingResultType *result = [JWTEncodingBuilder encodeClaimsSet:claimsSet].headers(headers).addHolder(holder).result;\n\nNSString *encodedToken = result.successResult.encoded;\nif (result.successResult) {\n    // handle encoded result\n    NSLog(@\"encoded result: %@\", result.successResult.encoded);\n}\nelse {\n    // handle error\n    NSLog(@\"encode failed, error: %@\", result.errorResult.error);\n}\n\n// decode it\n// you can set any property that you want, all properties are optional\nJWTClaimsSet *trustedClaimsSet = [claimsSet copy];\n\nNSNumber *options = @(JWTCodingDecodingOptionsNone);\nNSString *yourJwt = encodedToken; // from previous example\nJWTCodingResultType *decodedResult = [JWTDecodingBuilder decodeMessage:yourJwt].claimsSet(claimsSet).addHolder(holder).options(options).and.result;\n\nif (decodedResult.successResult) {\n    // handle decoded result\n    NSLog(@\"decoded result: %@\", decodedResult.successResult.headerAndPayloadDictionary);\n    NSLog(@\"headers: %@\", decodedResult.successResult.headers);\n    NSLog(@\"payload: %@\", decodedResult.successResult.payload);\n}\nelse {\n    // handle error\n    NSLog(@\"decode failed, error: %@\", decodedResult.errorResult.error);\n}\n```\n\n## Keys loaded from Pem files.\n\nYou have a key in pem file. And you want to use it directly for sign/verify.\nSuppose, that \"public_rsa.pem\" and \"private_rsa.pem\" are public and private keys in pem format.\n```objective-c\n// Load keys\n- (NSString *)pemKeyStringFromFileWithName:(NSString *)string inBundle:(NSBundle *)bundle {\n    NSURL *fileURL = [bundle URLForResource:name withExtension:@\"pem\"];\n    NSError *error = nil;\n    NSString *fileContent = [NSString stringWithContentsOfURL:fileURL encoding:NSUTF8StringEncoding error:&error];\n    if (error) {\n        NSLog(@\"%@ error: %@\", self.debugDescription, error);\n        return nil;\n    }\n}\n\n// Sign and verify\n- (void)signAndVerifyWithPrivateKeyPemString:(NSString *)privateKey publicKeyPemString:(NSString *)publicKey privateKeyPassphrase:(NSString *)passphrase {\n    NSString *algorithmName = @\"RS256\";\n\n    id <JWTAlgorithmDataHolderProtocol> signDataHolder = [JWTAlgorithmRSFamilyDataHolder new].keyExtractorType([JWTCryptoKeyExtractor privateKeyWithPEMBase64].type).privateKeyCertificatePassphrase(passphrase).algorithmName(algorithmName).secret(privateKey);\n\n    id <JWTAlgorithmDataHolderProtocol> verifyDataHolder = [JWTAlgorithmRSFamilyDataHolder new].keyExtractorType([JWTCryptoKeyExtractor publicKeyWithPEMBase64].type).algorithmName(algorithmName).secret(publicKey);\n\n    // sign\n    NSDictionary *payloadDictionary = @{@\"hello\": @\"world\"};\n\n    JWTCodingBuilder *signBuilder = [JWTEncodingBuilder encodePayload:payloadDictionary].addHolder(signDataHolder);\n    JWTCodingResultType *signResult = signBuilder.result;\n    NSString *token = nil;\n    if (signResult.successResult) {\n        // success\n        NSLog(@\"%@ success: %@\", self.debugDescription, signResult.successResult.encoded);\n        token = signResult.successResult.encoded;\n    }\n    else {\n        // error\n        NSLog(@\"%@ error: %@\", self.debugDescription, signResult.errorResult.error);\n    }\n\n    // verify\n    if (token == nil) {\n        NSLog(@\"something wrong\");\n    }\n\n    JWTCodingBuilder *verifyBuilder = [JWTDecodingBuilder decodeMessage:token].addHolder(verifyDataHolder);\n    JWTCodingResultType *verifyResult = verifyBuilder.result;\n    if (verifyResult.successResult) {\n        // success\n        NSLog(@\"%@ success: %@\", self.debugDescription, verifyResult.successResult.payload);\n        token = verifyResult.successResult.encoded;\n    }\n    else {\n        // error\n        NSLog(@\"%@ error: %@\", self.debugDescription, verifyResult.errorResult.error);\n    }\n}\n```\n\n# Experiments in Version 2.0\n## Whitelists possible algorithms.\nWhen you need to decode jwt by several algorithms you could specify their names in whitelist.\nLater this feature possible will migrate to options.\nFor example, someone returns result or error.\n### Limitations\nRestricted to pair (algorithm or none) due to limitations of unique `secret`.\n\n```objective-c\nNSString *jwtResultOrError = /*...*/;\nNSString *secret = @\"secret\";\nJWTBuilder *builder = [JWT decodeMessage:jwtResultOrError].secret(@\"secret\").whitelist(@[@\"HS256\", @\"none\"]);\nNSDictionary *decoded = builder.decode;\nif (builder.jwtError) {\n    // oh!\n}\nelse {\n    NSDictionary *payload = decoded[@\"payload\"];\n    NSDictionary *header = decoded[@\"header\"];\n    NSArray *tries = decoded[@\"tries\"]; // will be evolded into something appropriate later.\n}\n```\n\n# What's new in Version 2.0\n\n* Old plain style deprecated.\n* Use modern fluent style instead.\n\n```objective-c\nNSDictionary *payload = @{@\"foo\" : @\"bar\"};\nNSString *secret = @\"secret\";\nid<JWTAlgorithm> algorithm = [JWTAlgorithmFactory algorithmByName:@\"HS256\"];\n// Deprecated\n[JWT encodePayload:payload withSecret:secret algorithm:algorithm];\n\n// Modern\n[JWTBuilder encodePayload:payload].secret(secret).algorithm(algorithm).encode;\n```\n\n# Installation\n\nAdd the following to your [CocoaPods][] Podfile:\n\n    pod \"JWT\"\n\n[CocoaPods]: http://cocoapods.org\n\nInstall via Cartfile:\n\n    github \"yourkarma/JWT\" \"master\"\n\nand `import JWT`\n\n# Documentation\n# Usage\n\n## JWTBuilder\n\nTo encode & decode JWTs, use fluent style with the `JWTBuilder` interface\n\n```objective-c\n+ (JWTBuilder *)encodePayload:(NSDictionary *)payload;\n+ (JWTBuilder *)encodeClaimsSet:(JWTClaimsSet *)claimsSet;\n+ (JWTBuilder *)decodeMessage:(NSString *)message;\n```\n\nAs you can see, JWTBuilder has interface from both decoding and encoding.\n\nNote: some attributes are encode-only or decode-only.\n\n    #pragma mark - Encode only\n    *payload;\n    *headers;\n    *algorithm;\n\n    #pragma mark - Decode only\n    *message\n    *options // as forcedOption from jwt decode functions interface.\n    *whitelist  //optional array of algorithm names to whitelist for decoding\n\nYou can inspect JWTBuilder by `jwt`-prefixed attributes.\n\nYou can set JWTBuilder attributes by fluent style (block interface).\n\nYou can encode arbitrary payloads like so:\n\n```objective-c\nNSDictionary *payload = @{@\"foo\" : @\"bar\"};\nNSString *secret = @\"secret\";\nid<JWTAlgorithm> algorithm = [JWTAlgorithmFactory algorithmByName:@\"HS256\"];\n\n[JWTBuilder encodePayload:payload].secret(@\"secret\").algorithm(algorithm).encode;\n```\n\nIf you're using reserved claim names you can encode your claim set like so (all properties are optional):\n\n```objective-c\nJWTClaimsSet *claimsSet = [[JWTClaimsSet alloc] init];\nclaimsSet.issuer = @\"Facebook\";\nclaimsSet.subject = @\"Token\";\nclaimsSet.audience = @\"http://yourkarma.com\";\nclaimsSet.expirationDate = [NSDate distantFuture];\nclaimsSet.notBeforeDate = [NSDate distantPast];\nclaimsSet.issuedAt = [NSDate date];\nclaimsSet.identifier = @\"thisisunique\";\nclaimsSet.type = @\"test\";\n\nNSString *secret = @\"secret\";\nid<JWTAlgorithm> algorithm = [JWTAlgorithmFactory algorithmByName:@\"HS256\"];\n\n[JWTBuilder encodeClaimsSet:claimsSet].secret(secret).algorithm(algorithm).encode;\n```\n\nYou can decode a JWT like so:\n\n```objective-c\nNSString *jwtToken = @\"header.payload.signature\";\nNSString *secret = @\"secret\";\nNSString *algorithmName = @\"HS256\"; //Must specify an algorithm to use\n\nNSDictionary *payload = [JWTBuilder decodeMessage:jwtToken].secret(secret).algorithmName(algorithmName).decode;\n```\n\nIf you want to check claims while decoding, you could use next sample of code (all properties are optional):\n\n```objective-c\n// Trusted Claims Set\nJWTClaimsSet *trustedClaimsSet = [[JWTClaimsSet alloc] init];\ntrustedClaimsSet.issuer = @\"Facebook\";\ntrustedClaimsSet.subject = @\"Token\";\ntrustedClaimsSet.audience = @\"http://yourkarma.com\";\ntrustedClaimsSet.expirationDate = [NSDate date];\ntrustedClaimsSet.notBeforeDate = [NSDate date];\ntrustedClaimsSet.issuedAt = [NSDate date];\ntrustedClaimsSet.identifier = @\"thisisunique\";\ntrustedClaimsSet.type = @\"test\";\n\nNSString *message = @\"encodedJwt\";\nNSString *secret = @\"secret\";\nNSString *algorithmName = @\"chosenAlgorithm\"\n\nJWTBuilder *builder = [JWTBuilder decodeMessage:jwt].secret(secret).algorithmName(algorithmName).claimsSet(trustedClaimsSet);\nNSDictionary *payload = builder.decode;\n\nif (builder.jwtError == nil) {\n    // do your work here\n}\nelse {\n    // handle error\n}\n```\n\nIf you want to enforce a whitelist of valid algorithms:\n\n```objective-c\nNSArray *whitelist = @[@\"HS256\", @\"HS512\"];\nNSString *jwtToken = @\"header.payload.signature\";\nNSString *secret = @\"secret\";\nNSString *algorithmName = @\"HS256\";\n\n//Returns nil\nNSDictionary *payload = [JWTBuilder decodeMessage:jwtToken].secret(secret).algorithmName(algorithmName).whitelist(@[]).decode;\n\n//Returns the decoded payload\nNSDictionary *payload = [JWTBuilder decodeMessage:jwtToken].secret(secret).algorithmName(algorithmName).whitelist(whitelist).decode;\n```\n\n### Encode / Decode Example\n\n```objective-c\n// suppose, that you create ClaimsSet\nJWTClaimsSet *claimsSet = [[JWTClaimsSet alloc] init];\n// fill it\nclaimsSet.issuer = @\"Facebook\";\nclaimsSet.subject = @\"Token\";\nclaimsSet.audience = @\"http://yourkarma.com\";\n\n// encode it\nNSString *secret = @\"secret\";\nNSString *algorithmName = @\"HS384\";\nNSDictionary *headers = @{@\"custom\":@\"value\"};\nid<JWTAlgorithm> algorithm = [JWTAlgorithmFactory algorithmByName:algorithmName];\n\nJWTBuilder *encodeBuilder = [JWT encodeClaimsSet:claimsSet];\nNSString *encodedResult = encodeBuilder.secret(secret).algorithm(algorithm).headers(headers).encode;\n\nif (encodeBuilder.jwtError == nil) {\n    // handle encoded result\n    NSLog(@\"encoded result: %@\", encodedResult);\n}\nelse {\n    // handle error\n    NSLog(@\"encode failed, error: %@\", encodeBuilder.jwtError);\n}\n\n// decode it\n// you can set any property that you want, all properties are optional\nJWTClaimsSet *trustedClaimsSet = [claimsSet copy];\n\n// decode forced ? try YES\nBOOL decodeForced = NO;\nNSNumber *options = @(decodeForced);\nNSString *yourJwt = encodedResult; // from previous example\nNSString *yourSecret = secret; // from previous example\nNSString *yourAlgorithm = algorithmName; // from previous example\nJWTBuilder *decodeBuilder = [JWT decodeMessage:yourJwt];\nNSDictionary *decodedResult = decodeBuilder.message(yourJwt).secret(yourSecret).algorithmName(yourAlgorithm).claimsSet(trustedClaimsSet).options(options).decode;\nif (decodeBuilder.jwtError == nil) {\n    // handle decoded result\n    NSLog(@\"decoded result: %@\", decodedResult);\n}\nelse {\n    // handle error\n    NSLog(@\"decode failed, error: %@\", decodeBuilder.jwtError);\n}\n```\n\n#### NSData\nYou can also encode/decode using a secret that is represented as an NSData object\n\n```objective-c\n//Encode\nNSData *secretData = \"<your data>\";\nNSString *algorithmName = @\"HS384\";\nNSDictionary *headers = @{@\"custom\":@\"value\"};\nid<JWTAlgorithm> algorithm = [JWTAlgorithmFactory algorithmByName:algorithmName];\n\nJWTBuilder *encodeBuilder = [JWT encodeClaimsSet:claimsSet];\nNSString *encodedResult = encodeBuilder.secretData(secretData).algorithm(algorithm).headers(headers).encode;\n\n//Decode\nNSString *jwtToken = @\"header.payload.signature\";\nNSData *secretData = \"<your data>\"\nNSString *algorithmName = @\"HS256\"; //Must specify an algorithm to use\n\nNSDictionary *payload = [JWTBuilder decodeMessage:jwtToken].secretData(secretData).algorithmName(algorithmName).decode;\n```\n\n# Algorithms\n\nThe following algorithms are supported:\n\n* RS256\n* HS512 - HMAC using SHA-512.\n* HS256 / HS384 / HS512\n* None\n\n## RS256 usage.\nFor example, you have your file with privateKey: `file.p12`.\nAnd you have a secret passphrase for that file: `secret`.\n\n```objective-c\n// Encode\nNSDictionary *payload = @{@\"payload\" : @\"hidden_information\"};\nNSString *algorithmName = @\"RS256\";\n\nNSString *filePath = [[NSBundle mainBundle] pathForResource:@\"secret_key\" ofType:@\"p12\"];\nNSData *privateKeySecretData = [NSData dataWithContentsOfFile:filePath];\n\nNSString *passphraseForPrivateKey = @\"secret\";\n\nJWTBuilder *builder = [JWTBuilder encodePayload:payload].secretData(privateKeySecretData).privateKeyCertificatePassphrase(passphraseForPrivateKey).algorithmName(algorithmName);\nNSString *token = builder.encode;\n\n// check error\nif (builder.jwtError == nil) {\n    // handle result\n}\nelse {\n    // error occurred.\n}\n\n// Decode\n// Suppose, that you get token from previous example. You need a valid public key for a private key in previous example.\n// Private key stored in @\"secret_key.p12\". So, you need public key for that private key.\nNSString *publicKey = @\"...\"; // load public key. Or use it as raw string.\n\nalgorithmName = @\"RS256\";\n\nJWTBuilder *decodeBuilder = [JWTBuilder decodeMessage:token].secret(publicKey).algorithmName(algorithmName);\nNSDictionary *envelopedPayload = decodeBuilder.decode;\n\n// check error\nif (decodeBuilder.jwtError == nil) {\n    // handle result\n}\nelse {\n    // error occurred.\n}\n```\n\n\nAdditional algorithms can be added by implementing the `JWTAlgorithm` protocol.\n\n## Before pull request\n\nPlease, read [Contribution notes](https://github.com/yourkarma/JWT/blob/master/.github/CONTRIBUTING.md) before make pull request.\n\n## Powered by\n\n[![JetBrains](https://www.jetbrains.com/apple-touch-icon-180x180.png)](https://www.jetbrains.com)\n"
  },
  {
    "path": "Scripts/Test certificate and public key 1.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQsFADBKMR0wGwYDVQQDDBREaWdp\ndGFsIFNpZ25pbmcgVGVzdDELMAkGA1UEBhMCQVUxHDAaBgkqhkiG9w0BCQEWDXRl\nc3RAdGVzdC5jb20wHhcNMTYwMzEwMjM0ODQ2WhcNMTcwMzEwMjM0ODQ2WjBKMR0w\nGwYDVQQDDBREaWdpdGFsIFNpZ25pbmcgVGVzdDELMAkGA1UEBhMCQVUxHDAaBgkq\nhkiG9w0BCQEWDXRlc3RAdGVzdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\nggEKAoIBAQD2G4yWiZX9H4CsbWWpHT/bfRid7yU569j9f2gSB6kYv9wMsd/Crx2p\nHwIT5uK9gTJ4+5PYaeweB3Tu7uo9ob4EG83k2VF26ruRflzBaSzE4TotxuNoE83B\nVKFoR1oPdg3BmT7qPCRshz6b36zXfxVQgBYU2F2nUQKbjqCiFEs6w2VrbG5RQwHL\nEwmLwDu3WPFOwuO2aPP0dRh1E25DeZlzqNFcYaoAf5wEmwWn79oOmzETWh0uTHTg\ndCrZSp48ZvXf9iFZgqd5HIt0Ub5x5ZYuSZz5FJ8GRRp/0s4q4FG2T0XHsUkvnoMO\nKGkPUmkpFk4CKZa5BnnKIDGQMr2ndjaNAgMBAAGjRDBCMA4GA1UdDwEB/wQEAwIH\ngDAWBgNVHSUBAf8EDDAKBggrBgEFBQcDBDAYBgNVHREEETAPgQ10ZXN0QHRlc3Qu\nY29tMA0GCSqGSIb3DQEBCwUAA4IBAQDcOYflkAlubGJlv5T1G7PdcHzMzu6doah/\n9RmRyHS8wehc0GljYIyBkhbBG/iRumi6nnnU3BARv+JdSHbpIVsRaXmImWv5I/GO\nOfUO6UY7jlsw1mCjQyIIZoOFyUKnbcvrb0bCryD3rcbAflYg8feq3AiQv3CacxOy\nIbYh3khqbs1jKSAzxEdcsuHRB+by5gpwMfF5ByGdMmMl81mFMUuGlcWsfZp2N4Vz\n7MWVRl38OWkwZ0yw/Jpd1kcVwKIrXF3rjA71AN41rzyMvvPaEfdgCyFolixEOoJH\nFdidq1Bf0liKxf+MFJOaxSWKGqrvzPoBfmwCFoPahuaUlVZ4lGvr\n-----END CERTIFICATE-----\n-----BEGIN RSA PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9huMlomV/R+ArG1lqR0/\n230Yne8lOevY/X9oEgepGL/cDLHfwq8dqR8CE+bivYEyePuT2GnsHgd07u7qPaG+\nBBvN5NlRduq7kX5cwWksxOE6LcbjaBPNwVShaEdaD3YNwZk+6jwkbIc+m9+s138V\nUIAWFNhdp1ECm46gohRLOsNla2xuUUMByxMJi8A7t1jxTsLjtmjz9HUYdRNuQ3mZ\nc6jRXGGqAH+cBJsFp+/aDpsxE1odLkx04HQq2UqePGb13/YhWYKneRyLdFG+ceWW\nLkmc+RSfBkUaf9LOKuBRtk9Fx7FJL56DDihpD1JpKRZOAimWuQZ5yiAxkDK9p3Y2\njQIDAQAB\n-----END RSA PUBLIC KEY-----\n"
  },
  {
    "path": "Scripts/Test certificate and public key 2.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDVzCCAj+gAwIBAgIBATANBgkqhkiG9w0BAQsFADBMMR8wHQYDVQQDDBZEaWdp\ndGFsIFNpZ25pbmcgVGVzdCAyMQswCQYDVQQGEwJBVTEcMBoGCSqGSIb3DQEJARYN\ndGVzdEB0ZXN0LmNvbTAeFw0xNjAzMTIwMDUzMDJaFw0xNzAzMTIwMDUzMDJaMEwx\nHzAdBgNVBAMMFkRpZ2l0YWwgU2lnbmluZyBUZXN0IDIxCzAJBgNVBAYTAkFVMRww\nGgYJKoZIhvcNAQkBFg10ZXN0QHRlc3QuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOC\nAQ8AMIIBCgKCAQEAtQ57lsgAE5eWahnJ4e9InudO6rtJ12qE/qaeBrU8qcmJ0ku7\n8Ih2gnShRtdmJGaDgGH1hM6J+ucQvl87foNqJPeAN+s5GeiGw4yoaHTnibJ9/v8r\nzz+PzMwXn6EGykaL6eDAIIOKNcMXvjWZEXtwr/roOFbaEIe6JeqNeSb2mXS+1XI5\nNGCL4jp8y0WmNCp/0LUMGQyj2ilmIgaV74cB2xdxPozZZJnWDASkgbGzi4ijZCpO\nP/yksEvJ7JSNBmmAQoFNslMymOO3XYJs3yvR9thwRl/uHbY4gHRPGHramCdJ6s+L\nw+gzCjslB87HsIy4pp6PeDiOe/tyc79LWcsLbQIDAQABo0QwQjAOBgNVHQ8BAf8E\nBAMCB4AwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwQwGAYDVR0RBBEwD4ENdGVzdEB0\nZXN0LmNvbTANBgkqhkiG9w0BAQsFAAOCAQEAmlDHOKSdE8sRbUHNWZtyghm7FUBc\nrEEB/mM/dtRbq7aUFEPtHpXdKGf/fC0TZxdLoKfIFvgEuPlvzwgFhHTW3qzY4dES\n0n2krALVkfT0IR72vR98AGEE2gchSqGtwr1KkvYE8A4IwU+mlrDzVZoE0OjRg73K\nlpaxc77ln34CB+yAIlL1uunIZj+zmCuhsK4i6QAjzJ1PaNXo5P9F4zfJDW4B0ej6\n/2V9nxBvWW8hdba/eVbDltkvw0dZZay6YgBmVz9mXbAGZ6pk2XOjTlS3XLFgLUVe\n8WTXbktQw0cCcf3xfn6HB/Y+5l/0srZ3i5Su5qtdDDbZ3epBjB3K5kiP8g==\n-----END CERTIFICATE-----\n-----BEGIN RSA PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtQ57lsgAE5eWahnJ4e9I\nnudO6rtJ12qE/qaeBrU8qcmJ0ku78Ih2gnShRtdmJGaDgGH1hM6J+ucQvl87foNq\nJPeAN+s5GeiGw4yoaHTnibJ9/v8rzz+PzMwXn6EGykaL6eDAIIOKNcMXvjWZEXtw\nr/roOFbaEIe6JeqNeSb2mXS+1XI5NGCL4jp8y0WmNCp/0LUMGQyj2ilmIgaV74cB\n2xdxPozZZJnWDASkgbGzi4ijZCpOP/yksEvJ7JSNBmmAQoFNslMymOO3XYJs3yvR\n9thwRl/uHbY4gHRPGHramCdJ6s+Lw+gzCjslB87HsIy4pp6PeDiOe/tyc79LWcsL\nbQIDAQAB\n-----END RSA PUBLIC KEY-----\n"
  },
  {
    "path": "Scripts/cert_1.cer",
    "content": "-----BEGIN CERTIFICATE-----\nMIIB5DCCAY4CCQCShy5E2kz5+jANBgkqhkiG9w0BAQUFADB5MQswCQYDVQQGEwJS\nVTEPMA0GA1UECBMGTW9zY293MQ8wDQYDVQQHEwZNb3Njb3cxDzANBgNVBAoTBk1v\nc2NvdzEPMA0GA1UECxMGTW9zY293MQ8wDQYDVQQDEwZNb3Njb3cxFTATBgkqhkiG\n9w0BCQEWBk1vc2NvdzAeFw0xNzAxMjgxNTIxMzVaFw0xNzAyMjcxNTIxMzVaMHkx\nCzAJBgNVBAYTAlJVMQ8wDQYDVQQIEwZNb3Njb3cxDzANBgNVBAcTBk1vc2NvdzEP\nMA0GA1UEChMGTW9zY293MQ8wDQYDVQQLEwZNb3Njb3cxDzANBgNVBAMTBk1vc2Nv\ndzEVMBMGCSqGSIb3DQEJARYGTW9zY293MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJB\nANY7AQ5MmRhLWrnj3Awbtq3FDMEW9IhNxYuHPtCChpNX505L06NMN2GbtrDFvkMW\nEQpnvblFxme9KPEt3bEMg+8CAwEAATANBgkqhkiG9w0BAQUFAANBAEwYPzEOfqcg\nBbwuparrzcvwGBNS7RCQZnw/3+WfbGtS1TlNukNBK9apnpax5z1vsnBVcO+yDN5y\nVLuautgkfKY=\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "Scripts/cert_1.crt",
    "content": "-----BEGIN CERTIFICATE-----\nMIIB5DCCAY4CCQD1AAN2e7b6+jANBgkqhkiG9w0BAQUFADB5MQswCQYDVQQGEwJS\nVTEPMA0GA1UECBMGTW9zY293MQ8wDQYDVQQHEwZNb3Njb3cxDzANBgNVBAoTBk1v\nc2NvdzEPMA0GA1UECxMGTW9zY293MQ8wDQYDVQQDEwZNb3Njb3cxFTATBgkqhkiG\n9w0BCQEWBk1vc2NvdzAeFw0xNzAxMjgxNTIyMTlaFw0xNzAyMjcxNTIyMTlaMHkx\nCzAJBgNVBAYTAlJVMQ8wDQYDVQQIEwZNb3Njb3cxDzANBgNVBAcTBk1vc2NvdzEP\nMA0GA1UEChMGTW9zY293MQ8wDQYDVQQLEwZNb3Njb3cxDzANBgNVBAMTBk1vc2Nv\ndzEVMBMGCSqGSIb3DQEJARYGTW9zY293MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJB\nANY7AQ5MmRhLWrnj3Awbtq3FDMEW9IhNxYuHPtCChpNX505L06NMN2GbtrDFvkMW\nEQpnvblFxme9KPEt3bEMg+8CAwEAATANBgkqhkiG9w0BAQUFAANBAEiI7mohwYCV\nFV1LPDJxKd95QdWpy/GA9BjytaG89jHdt0jxJztjYColM057I+9zkTSsgvlzifw8\n4V/JcNzei80=\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "Scripts/cert_1.csr",
    "content": "-----BEGIN CERTIFICATE REQUEST-----\nMIIBYjCCAQwCAQAweTELMAkGA1UEBhMCUlUxDzANBgNVBAgTBk1vc2NvdzEPMA0G\nA1UEBxMGTW9zY293MQ8wDQYDVQQKEwZNb3Njb3cxDzANBgNVBAsTBk1vc2NvdzEP\nMA0GA1UEAxMGTW9zY293MRUwEwYJKoZIhvcNAQkBFgZNb3Njb3cwXDANBgkqhkiG\n9w0BAQEFAANLADBIAkEA1jsBDkyZGEtauePcDBu2rcUMwRb0iE3Fi4c+0IKGk1fn\nTkvTo0w3YZu2sMW+QxYRCme9uUXGZ70o8S3dsQyD7wIDAQABoC4wFQYJKoZIhvcN\nAQkCMQgTBk1vc2NvdzAVBgkqhkiG9w0BCQcxCBMGc2VjcmV0MA0GCSqGSIb3DQEB\nBQUAA0EAxWLEcXTTN180TaopGkXGNi7i1TasmeCDawbrBRXpvXZcterzpgGLO2qM\nKbdMi4EjByhZujSqYzbhGztw+pYEAA==\n-----END CERTIFICATE REQUEST-----\n"
  },
  {
    "path": "Scripts/ci-xcode-select.sh",
    "content": "#!/bin/bash\n\nsudo xcode-select -s /Applications/Xcode_13.2.1.app/Contents/Developer\n"
  },
  {
    "path": "Scripts/generate_ec_curved_keys.rb",
    "content": "require 'optparse'\nrequire 'shellwords'\nrequire 'pathname'\nclass ShellExecutor\n\t@@dry_run = false\n\tclass << self\n\t\t# setup\n\t\tdef setup (dry_run = false)\n\t\t\t@@dry_run = dry_run\n\t\tend\n\n\t\tdef dry?\n\t\t\tputs \"Condition statement is #{@@dry_run.to_s}\"\n\t\t\t@@dry_run\n\t\tend\n\n\t\tdef run_command_line(line)\n\t\t\tputs \"I will perform \\n <#{line}>\"\n\t\t\tif dry?\n\t\t\t\tputs \"I am on dry run!\"\n\t\t\telse\n\t\t\t\t# if run\n\t\t\t\tresult = %x(#{line})\n\t\t\t\tputs \"result is:\" + result.to_s\n\t\t\t\tif $? != 0\n\t\t\t\t\tputs \"I fall down on < #{result} >\\n! because of < #{$?} >\"\n\t\t\t\t\texit($?)\n\t\t\t\tend\n\t\t\t\tresult\n\t\t\tend\n\t\tend\n\tend\nend\n\nclass KeysGenerator\n\tmodule FileFormatsModule\n\t\tdef only_name(name)\n\t\t\t# remove extension\n\t\t\tPathname.new(name).basename\n\t\tend\n\t\tdef to_plain_text(name)\n\t\t\tself.only_name(name).sub_ext('.txt')\n\t\tend\n\t\tdef to_p12(name)\n\t\t\t# remove extension\n\t\t\t# add .p12\n\t\t\tself.only_name(name).sub_ext('.p12')\n\t\tend\n\t\tdef to_certificate_request(name)\n\t\t\t# remove extension\n\t\t\t# add .csr\n\t\t\tself.only_name(name).sub_ext('.csr')\n\t\tend\n\t\tdef to_certificate(name, format = '.cer')\n\t\t\t# remove extension\n\t\t\t# add .cer\n\t\t\tself.only_name(name).sub_ext(format)\n\t\tend\n\t\tdef to_pem(name)\n\t\t\t# remove extension\n\t\t\t# add .pem\n\t\t\tself.only_name(name).sub_ext('.pem')\n\t\tend\n\tend\n\tclass FileFormats\n\t\tclass << self\n\t\t\tinclude FileFormatsModule\n\t\tend\n\t\tattr_accessor :name\n\t\tdef initialize(name)\n\t\t\tself.name = @name\n\t\tend\n\t\tdef valid?\n\t\t\t!self.name.nil?\n\t\tend\n\t\tdef to_p12\n\t\t\tself.class.to_p12(self.name)\n\t\tend\n\t\tdef to_certificate_requets\n\t\t\tself.class.to_certificate_request(self.name)\n\t\tend\n\t\tdef to_certificate\n\t\t\tself.class.to_certificate(self.name)\n\t\tend\n\t\tdef to_pem\n\t\t\tself.class.to_pem(self.name)\n\t\tend\n\tend\n\n\tclass << self\n\t\tdef available_ec_curves\n\t\t\t#  secp256r1 - alias?\n\t\t\t%w(prime256v1 secp384r1 secp512r1)\n\t\tend\n\t\tdef available_rsa_sizes\n\t\t\t[ 2048, 3072, 4096 ]\n\t\tend\n\tend\n\n\n\tattr_accessor :type, :curve_name, :rsa_size, :secret\n\tdef initialize(secret = 'secret')\n\t\tself.secret = secret\n\tend\n\n\tTYPES = [:ec, :rsa]\n\tdef type=(value)\n\t\t@type = value.downcase.to_sym\n\tend\n\n\tdef valid?\n\t\tself.class::TYPES.include?(self.type)\n\tend\n\n\tdef fix\n\t\t@curve_name ||= self.class.available_ec_curves.first if self.type == :ec\n\t\t@rsa_size ||= self.class.available_rsa_sizes.first if self.type == :rsa\n\tend\n\n\tdef to_s\n\t\t{\n\t\t\tkey_type: self.type,\n\t\t\tcurve_name: self.curve_name,\n\t\t\trsa_size: self.rsa_size,\n\t\t\trsa_private_key_passphrase: self.secret\n\t\t}\n\tend\n\n\tmodule Generating\n\t\tdef default_subject\n\t\t\t{\n\t\t\t\t\"C\": \"GB\",\n\t\t\t\t\"ST\": \"London\",\n\t\t\t\t\"L\": \"London\",\n\t\t\t\t\"O\": \"Global Security\",\n\t\t\t\t\"OU\": \"IT Department\",\n\t\t\t\t\"CN\": \"example.com\"\n\t\t\t}\n\t\tend\n\n\t\tdef key_and_value_or_empty(key, value, delimiter, empty = -> (v){ v.nil? || v.empty?})\n\t\t\tthe_empty = empty #empty || -> (v){ v.nil? || v.empty?}\n\t\t\t{key => value}.reject{|k,v| the_empty.call(v)}.collect{|k,v| \"#{k}#{delimiter}#{v}\"}.join('')\n\t\tend\n\n\t\tdef subject_value_from_subject(subject = {})\n\t\t\tvalue = subject.collect{|k,v| \"/#{k}=#{v}\"}.join('')\n\t\t\tvalue\n\t\tend\n\n\t\tdef subject_key_and_value_from_subject(subject = {})\n\t\t\tvalue = subject_value_from_subject(subject)\n\t\t\t{'-subj': value}.reject{|k,v| v.empty?}.collect{|k,v| \"#{k} \\\"#{v}\\\"\"}.join('')\n\t\tend\n\n\t\tdef tool\n\t\t\t%q(openssl)\n\t\tend\n\t\tdef suppress_prompt(command)\n\t\t\t%Q(echo '#{secret}' | #{command})\n\t\tend\n\n\t\tdef generate_key(type, name, parameters)\n\t\t\tcase type\n\t\t\twhen :rsa\n\t\t\t\tsize = parameters[:size]\n\t\t\t\trsa_private_key_passphrase = parameters[:rsa_private_key_passphrase]\n\t\t\t\t#%Q(#{tool} genrsa -des3 -out #{name} #{size} -passin 'password')\n\t\t\t\t#%Q(#{tool} genrsa -aes256 -passin pass:#{rsa_private_key_passphrase} -out #{name} #{size})\n\t\t\t\t# ssh-keygen -t rsa -b 4096 -f jwtRS256.key -q -N secret_phrase ( -N - NewPassphrase )\n\t\t\t\t# -q -N #{rsa_private_key_passphrase}\n\t\t\t\t%Q(echo \"y\" | ssh-keygen -t #{type} -b #{size} -f #{name} -q -N '')\n\t\t\twhen :ec\n\t\t\t\tcurve_name = parameters[:curve_name]\n\t\t\t\t%Q(#{tool} ecparam -name #{curve_name} -genkey -noout -out #{name})\n\t\t\tend\n\t\tend\n\n\t\t# def generate_key_rsa(parameter, name)\n\t\t# \t%Q(#{tool} genrsa -des3 -out #{name} #{size} -passin 'password')\n\t\t# \t# %Q(#{tool} genrsa -name #{parameter} -genkey -noout -out #{name})\n\t\t# end\n\n\t\t# def generate_key_ec(curve_name, name)\n\t\t# \t%Q(#{tool} ecparam -name #{curve_name} -genkey -noout -out #{name})\n\t\t# end\n\n\t\t# output keys\n\t\tdef output_key(access, generated_key_name, name)\n\t\t\t%Q(#{tool} #{access == 'private' ? '' : '-pubout' } -in #{generated_key_name} -out #{name} < echo \"#{secret}\")\n\t\tend\n\t\tdef output_public_key(generated_key_name, name)\n\t\t\toutput_key('public', generated_key_name, name)\n\t\tend\n\t\tdef output_private_key(generated_key_name, name)\n\t\t\toutput_key('private', generated_key_name, name)\n\t\tend\n\n\t\tdef export_public_key(type, private_key_pem, public_key_pem)\n\t\t\t%Q(#{tool} #{type} -in #{private_key_pem} -pubout -out #{public_key_pem})\n\t\t\t#openssl ec -in ec256-private.pem -pubout -out ec256-public.pem\n\t\tend\n\n\t\t# with prompt?\n\t\tdef output_certificate_request(private_key_pem, certificate_request, subject = {})\n\t\t\tsubject_key_value = subject_key_and_value_from_subject(subject)\n\t\t\t%Q(#{tool} req -new -key #{private_key_pem} -out #{certificate_request} #{subject_key_value})\n\t\t\t# openssl req -new -key private_1.pem -out cert_1.csr\n\t\tend\n\n\t\tdef output_certificate(certificate_request, private_key_pem, certificate)\n\t\t\t%Q(#{tool} x509 -req -in #{certificate_request} -signkey #{private_key_pem} -out #{certificate})\n\t\t\t# openssl x509 -req -in cert_1.csr -signkey private_1.pem -out cert_1.cer\n\t\tend\n\t\tdef output_p12(certificate, private_key_pem, p12_name, password_file)\n\t\t\t# replace name's extension by p12\n\t\t\t# private_key_pem.pem\n\t\t\t# certificate.crt or certificate.cer\n\t\t\t# p12_name.p12\n\t\t\tpassword_file_content = %Q(\"$(cat #{password_file})\")\n\t\t\tthe_password_key_value = key_and_value_or_empty('-passout pass:', password_file_content, '')\n\t\t\t%Q(#{tool} pkcs12 -export -in #{certificate} -inkey #{private_key_pem} -out #{p12_name} #{the_password_key_value})\n\t\tend\n\t\tdef output_password(file, password = 'password')\n\t\t\t%Q(echo -n \"#{password}\" > #{file})\n\t\tend\n\tend\n\n\tclass << self\n\t\tinclude Generating\n\tend\n\n\tdef generated_by_type(type = self.type)\n\t\t# we need name and parameters?\n\t\tparameters = {}\n\t\tname = nil\n\t\tcase self.type\n\t\twhen :rsa\n\t\t\tparameters[:size] = self.rsa_size\n\t\t\tparameters[:rsa_private_key_passphrase] = self.secret\n\t\t\tname = \"rsa-#{self.rsa_size}\"\n\t\twhen :ec\n\t\t\tparameters[:curve_name] = self.curve_name\n\t\t\tname = \"ec-#{self.curve_name}\"\n\t\tend\n\n\t\tself.generated(type, parameters, \"#{name}-private\", \"#{name}-public\", \"#{name}\", \"#{name}\", \"#{name}-private\", \"#{name}-p12-password\")\n\tend\n\n\tdef generated(type, parameters, private_key_pem, public_key_pem, certificate_request, certificate, p12, p12_password)\n\t\tthe_private_key_pem ||= FileFormats.to_pem private_key_pem\n\t\tthe_public_key_pem ||= FileFormats.to_pem public_key_pem\n\t\tthe_certificate_request ||= FileFormats.to_certificate_request certificate_request\n\t\tthe_certificate ||= FileFormats.to_certificate certificate\n\t\tthe_p12 ||= FileFormats.to_p12 p12\n\t\tthe_p12_password ||= FileFormats.to_plain_text p12_password\n\n\t\t[\n\t\t\tself.class.generate_key(type, the_private_key_pem, parameters),\n\t\t\t#self.class.generate_key(curve_name, the_private_key_pem),\n\t\t\tself.class.export_public_key(type, the_private_key_pem, the_public_key_pem),\n\t\t\tself.class.output_certificate_request(the_private_key_pem, the_certificate_request, self.class.default_subject),\n\t\t\tself.class.output_certificate(the_certificate_request, the_private_key_pem, the_certificate),\n\t\t\tself.class.output_password(the_p12_password),\n\t\t\tself.class.output_p12(the_certificate, the_private_key_pem, the_p12, the_p12_password)\n\t\t]\n\tend\nend\n\nclass MainWork\n\tclass << self\n\t\tdef work(arguments)\n\t\t\tthe_work = new\n\t\t\tthe_work.work(the_work.parse_options(arguments))\n\t\tend\n\tend\n\tdef fix_options(the_options)\n\t\toptions = the_options\n\t\toptions[:result_directory] ||= '../Tests/Resources/Certs/'\n\t\tif options[:test]\n\t\t\toptions[:generated_key_name] ||= 'generated'\n\t\t\toptions[:private_key_name] ||= 'private'\n\t\t\toptions[:public_key_name] ||= 'public'\n\t\tend\n\t\toptions\n\tend\n\tdef required_keys\n\t\t[:key_type]\n\tend\n\tdef valid_options?(the_options)\n\t\t(required_keys - the_options.keys).empty?\n\tend\n\tdef work(options = {})\n\t\toptions = fix_options(options)\n\n\t\tif options[:inspection]\n\t\t\tputs \"options are: #{options}\"\n\t\tend\n\n\t\tunless valid_options? options\n\t\t\tputs \"options are not valid!\"\n\t\t\tputs \"options are: #{options}\"\n\t\t\tputs \"missing options: #{required_keys}\"\n\t\t\texit(0)\n\t\tend\n\n\t\tShellExecutor.setup options[:dry_run]\n\n\t\tgenerator = KeysGenerator.new\n\t\tgenerator.type = options[:key_type]\n\t\tgenerator.curve_name = options[:curve_name]\n\t\tgenerator.rsa_size = options[:rsa_size]\n\n\t\tgenerator.fix\n\n\t\tputs \"generator fixed arguments: #{generator.to_s}\"\n\n\t\tunless generator.valid?\n\t\t\tputs \"generator types are: #{KeysGenerator::TYPES}. You type is: #{generator.type}\"\n\t\t\texit(0)\n\t\tend\n\n\t\tgenerator.generated_by_type(generator.type).each do |command|\n\t\t\tShellExecutor.run_command_line command\n\t\tend\n\t\t #KeyParameters.new(options[:algorithm_type], options[:key_length])\n\t\t# [\n\t\t# \tkey_parameters.generate_key(options[:generated_key_name]),\n\t\t# \tkey_parameters.output_private_key(options[:generated_key_name], options[:private_key_name]),\n\t\t# \tkey_parameters.output_public_key(options[:generated_key_name], options[:public_key_name])\n\t\t# ].map do |command|\n\t\t# \tkey_parameters.suppress_prompt command\n\t\t# end\n\t\t# .each do |command|\n\t\t# \tShellExecutor.run_command_line command\n\t\t# end\n\tend\n\tdef help_message(options)\n\t\t# %x[rdoc $0]\n\t\t# not ok\n\t\tputs <<-__HELP__\n\n\t\t#{options.help}\n\n\t\tthis script will help you generate keys.\n\n\t\tFirst, it takes arguments:\n\t\t[needed] <-f DIRECTORY>: directory where you will gather files\n\t\t[not needed] <-r DIRECTORY>: directory where files will be placed\n\n\n\t\t---------------\n\t\tUsage:\n\t\t---------------\n\t\t#{$0} -t ../Tests/Resources/Certs/\n\n\t\t__HELP__\n\tend\n\tdef parse_options(arguments)\n\t\toptions = {}\n\t\tOptionParser.new do |opts|\n\t\t\topts.banner = \"Usage: #{$0} [options]\"\n\t\t\topts.on('-o', '--output_directory DIRECTORY', 'Output Directory') {|v| options[:output_directory] = v}\n\t\t\topts.on('-t', '--test', 'Test option') {|v| options[:test] = v}\n\t\t\topts.on('-c', '--curve_name CURVE_NAME', 'Curve name') {|v| options[:curve_name] = v}\n\t\t\topts.on('-s', '--size SIZE', 'RSA key size') {|v| options[:rsa_size] = v}\n\t\t\topts.on('-k', '--key_type KEY_TYPE', 'Key Type (RSA or EC), case insensitive') {|v| options[:key_type] = v}\n\t\t\topts.on('-g', '--generated_key_name NAME', 'Generated key name') {|v| options[:generated_key_name] = v}\n\t\t\topts.on('-r', '--private_key_name NAME', 'Private Key Name') {|v| options[:private_key_name] = v}\n\t\t\topts.on('-u', '--public_key_name NAME', 'Public Key Name') {|v| options[:public_key_name] = v}\n\t\t\t# opts.on('-l', '--log_level LEVEL', 'Logger level of warning') {|v| options[:log_level] = v}\n\t\t\t# opts.on('-o', '--output_log OUTPUT', 'Logger output stream') {|v| options[:output_stream] = v}\n\t\t\topts.on('-d', '--dry_run', 'Dry run to see all options') {|v| options[:dry_run] = v}\n\t\t\topts.on('-i', '--inspection', 'Inspection of all items, like tests'){|v| options[:inspection] = v}\n\n\t\t\t# help\n\t\t\topts.on('-h', '--help', 'Help option') { self.help_message(opts); exit()}\n\t\tend.parse!(arguments)\n\t\toptions\n\tend\nend\n\nMainWork.work(ARGV)\n"
  },
  {
    "path": "Scripts/generate_keys.rb",
    "content": "require 'optparse'\nrequire 'shellwords'\nclass ShellExecutor\n\t@@dry_run = false\n\tclass << self\n\t\tdef shared_instance\n\t\t\tunless @@dry_run\n\t\t\t\tMyExecutor.setup()\n\t\t\t\t@@dry_run\n\t\t\tend\n\t\tend\n\n\t\t# setup\n\t\tdef setup (dry_run = false)\n\t\t\t@@dry_run = dry_run\n\t\tend\n\n\t\tdef dry?\n\t\t\tputs \"If statement is #{@@dry_run.to_s}\"\n\t\t\t@@dry_run\n\t\tend\n\n\t\tdef run_command_line(line)\n\t\t\tputs \"I will perform <#{line}>\"\n\t\t\tif dry?\n\t\t\t\tputs \"I am on dry run!\"\n\t\t\telse\n\t\t\t\t# if run\n\t\t\t\tresult = %x(#{line})\n\t\t\t\tputs \"result is:\" + result.to_s\n\t\t\t\tif $? != 0\n\t\t\t\t\tputs \"I fall down on < #{result} >\\n! because of < #{$?} >\"\n\t\t\t\t\texit($?)\n\t\t\t\tend\n\t\t\t\tresult\n\t\t\tend\n\t\tend\n\tend\nend\n\nclass KeyParameters\n\tTYPES = [:rsa, :ec]\n\tSIZES = [256, 384, 512]\n\tattr_accessor :type, :size, :secret\n\tdef initialize(type, size, secret = 'secret')\n\t\tself.type = type\n\t\tself.size = size\n\t\tself.secret = secret\n\tend\n\tdef tool\n\t\t%q(openssl);\n\tend\n\tdef curve_by_size(size)\n\t\tcase size\n\t\twhen 256\n\t\t\t\"#{secp256k1}\"\n\t\twhen 384\n\t\t\t\"#{secp384k1}\"\n\t\twhen 512\n\t\t\t\"#{secp512k1}\"\n\t\tend\n\tend\n\tdef suppress_prompt(command)\n\t\t%Q(echo '#{secret}' | #{command})\n\tend\n\tdef generate_key(name)\n\t\tcase type\n\t\twhen :rsa\n\t\t\t%Q(#{tool} genrsa -des3 -out #{name}.pem #{size} -passin 'password')\n\t\twhen :ec\n\t\t\t%Q(#{tool} ecparam -name #{curve_name} -genkey -noout -out #{name}.pem)\n\t\tend\n\tend\n\tdef output_key(type, access, generated_key_name, name)\n\t\t%Q(#{tool} #{type} #{access == 'private' ? '' : '-pubout' } -in #{generated_key_name}.pem -out #{name}.pem < echo \"#{secret}\")\n\tend\n\tdef output_public_key(generated_key_name, name)\n\t\toutput_key(type, 'public', generated_key_name, name)\n\tend\n\tdef output_private_key(generated_key_name, name)\n\t\toutput_key(type, 'private', generated_key_name, name)\n\tend\nend\n\nclass MainWork\n\tclass << self\n\t\tdef work(arguments)\n\t\t\tthe_work = new\n\t\t\tthe_work.work(the_work.parse_options(arguments))\n\t\tend\n\tend\n\tdef fix_options(the_options)\n\t\toptions = the_options\n\t\toptions[:result_directory] ||= '../Tests/Resources/Certs/'\n\t\tif options[:test]\n\t\t\toptions[:algorithm_type] ||= KeyParameters::TYPES.first\n\t\t\toptions[:key_length] ||= KeyParameters::SIZES.first\n\t\t\toptions[:generated_key_name] ||= 'generated'\n\t\t\toptions[:private_key_name] ||= 'private'\n\t\t\toptions[:public_key_name] ||= 'public'\n\t\tend\n\t\toptions\n\tend\n\tdef work(options = {})\n\t\toptions = fix_options(options)\n\n\t\tif options[:inspection]\n\t\t\tputs \"options are: #{options}\"\n\t\tend\n\n\t\tShellExecutor.setup options[:dry_run]\n\n\t\tkey_parameters = KeyParameters.new(options[:algorithm_type], options[:key_length])\n\t\t[\n\t\t\tkey_parameters.generate_key(options[:generated_key_name]),\n\t\t\tkey_parameters.output_private_key(options[:generated_key_name], options[:private_key_name]),\n\t\t\tkey_parameters.output_public_key(options[:generated_key_name], options[:public_key_name])\n\t\t].map do |command|\n\t\t\tkey_parameters.suppress_prompt command\n\t\tend\n\t\t.each do |command|\n\t\t\tShellExecutor.run_command_line command\n\t\tend\n\tend\n\tdef help_message(options)\n\t\t# %x[rdoc $0]\n\t\t# not ok\n\t\tputs <<-__HELP__\n\n\t\t#{options.help}\n\n\t\tthis script will help you generate keys.\n\n\t\tFirst, it takes arguments:\n\t\t[needed] <-f DIRECTORY>: directory where you will gather files\n\t\t[not needed] <-r DIRECTORY>: directory where files will be placed\n\n\n\t\t---------------\n\t\tUsage:\n\t\t---------------\n\t\t#{$0} -t ../Tests/Resources/Certs/\n\n\t\t__HELP__\n\tend\n\tdef parse_options(arguments)\n\t\toptions = {}\n\t\tOptionParser.new do |opts|\n\t\t\topts.banner = \"Usage: #{$0} [options]\"\n\t\t\topts.on('-o', '--output_directory DIRECTORY', 'Output Directory') {|v| options[:output_directory] = v}\n\t\t\topts.on('-t', '--test', 'Test option') {|v| options[:test] = v}\n\t\t\topts.on('-l', '--length LENGTH', 'Key length') {|v| options[:key_length] = v}\n\t\t\topts.on('-a', '--algorithm ALGORITHM', 'Algorithm type') {|v| options[:algorithm_type] = v}\n\t\t\topts.on('-g', '--generated_key_name NAME', 'Generated key name') {|v| options[:generated_key_name] = v}\n\t\t\topts.on('-r', '--private_key_name NAME', 'Private Key Name') {|v| options[:private_key_name] = v}\n\t\t\topts.on('-u', '--public_key_name NAME', 'Public Key Name') {|v| options[:public_key_name] = v}\n\t\t\t# opts.on('-l', '--log_level LEVEL', 'Logger level of warning') {|v| options[:log_level] = v}\n\t\t\t# opts.on('-o', '--output_log OUTPUT', 'Logger output stream') {|v| options[:output_stream] = v}\n\t\t\topts.on('-d', '--dry_run', 'Dry run to see all options') {|v| options[:dry_run] = v}\n\t\t\topts.on('-i', '--inspection', 'Inspection of all items, like tests'){|v| options[:inspection] = v}\n\n\t\t\t# help\n\t\t\topts.on('-h', '--help', 'Help option') { help_message(opts); exit()}\n\t\tend.parse!(arguments)\n\t\toptions\n\tend\nend\n\nMainWork.work(ARGV)\n"
  },
  {
    "path": "Scripts/openssl_help.sh",
    "content": "exit(0)\n\n# generate rsa private key.\nopenssl genrsa -out private_1.pem\n\n# request certificate with private key in pem format.\nopenssl req -new -key private_1.pem -out cert_1.csr\n\n# extract to pem certificate in csr format.\nopenssl pkcs7 -in cert_1.csr -print_certs -out certs.pem\n\n# extract to cer certificate from csr with private key in pem.\nopenssl x509 -req -in cert_1.csr -signkey private_1.pem -out cert_1.cer\n\n# extract to p12 certificate cert_1.crt with private key in pem.\nopenssl pkcs12 -export -in cert_1.crt -inkey private_1.pem -out cert_1.p12\n\n# extract public key from pem file with cetificate and private key.\nopenssl rsa -in private_256_right.pem -pubout -out public_256_right.pem\n\n# extract p12 to pem with all data ( nodes )\nopenssl pkcs12 -in private_256_right.p12 -out private_256_right.pem -nodes\n\n# generate ecdsa private key.\nopenssl ecparam -genkey -name prime256v1  -out ec256-private.pem\n\n# generate ecdsa public key.\nopenssl ec -in ec256-private.pem -pubout -out ec256-public.pem"
  },
  {
    "path": "Scripts/private_1.pem",
    "content": "-----BEGIN RSA PRIVATE KEY-----\nMIIBOwIBAAJBANY7AQ5MmRhLWrnj3Awbtq3FDMEW9IhNxYuHPtCChpNX505L06NM\nN2GbtrDFvkMWEQpnvblFxme9KPEt3bEMg+8CAwEAAQJBAIUO9tPrzXbibsJgfS7k\nE62QYyCW4mC6dUT5RpF5UJ64acG5SnoE+ZO39oEjrO9p1yzNG73lod3JTjrCyHvK\nx+ECIQD5+ENs/luJOfMKBWDY8EQRahwdQxONTuUhTNL5j78v/wIhANtmBp0TMUW+\ni3wxK2mXE/FiK1wq8bEHUJ40NO8+5awRAiByfXxcco/4ZVtk7puyITH8C+6+lFdj\nNIyL2QUUmvtFfwIgUp416Vp72H6regXuCiIZIXHNUDTftMFDa3/PWzR9OnECIQCT\nrFG5IFGIrmS4cc6ogFPkJyjOylJjkCNRFDlAOyDfJA==\n-----END RSA PRIVATE KEY-----\n"
  },
  {
    "path": "Scripts/private_256_right.pem",
    "content": "Bag Attributes\n    friendlyName: Digital Signing Test\n    localKeyID: 6F 37 3B E6 78 85 E0 42 30 AC B7 D1 2F C6 C5 69 20 C4 3C 9E \nsubject=/CN=Digital Signing Test/C=AU/emailAddress=test@test.com\nissuer=/CN=Digital Signing Test/C=AU/emailAddress=test@test.com\n-----BEGIN CERTIFICATE-----\nMIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQsFADBKMR0wGwYDVQQDDBREaWdp\ndGFsIFNpZ25pbmcgVGVzdDELMAkGA1UEBhMCQVUxHDAaBgkqhkiG9w0BCQEWDXRl\nc3RAdGVzdC5jb20wHhcNMTYwMzEwMjM0ODQ2WhcNMTcwMzEwMjM0ODQ2WjBKMR0w\nGwYDVQQDDBREaWdpdGFsIFNpZ25pbmcgVGVzdDELMAkGA1UEBhMCQVUxHDAaBgkq\nhkiG9w0BCQEWDXRlc3RAdGVzdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\nggEKAoIBAQD2G4yWiZX9H4CsbWWpHT/bfRid7yU569j9f2gSB6kYv9wMsd/Crx2p\nHwIT5uK9gTJ4+5PYaeweB3Tu7uo9ob4EG83k2VF26ruRflzBaSzE4TotxuNoE83B\nVKFoR1oPdg3BmT7qPCRshz6b36zXfxVQgBYU2F2nUQKbjqCiFEs6w2VrbG5RQwHL\nEwmLwDu3WPFOwuO2aPP0dRh1E25DeZlzqNFcYaoAf5wEmwWn79oOmzETWh0uTHTg\ndCrZSp48ZvXf9iFZgqd5HIt0Ub5x5ZYuSZz5FJ8GRRp/0s4q4FG2T0XHsUkvnoMO\nKGkPUmkpFk4CKZa5BnnKIDGQMr2ndjaNAgMBAAGjRDBCMA4GA1UdDwEB/wQEAwIH\ngDAWBgNVHSUBAf8EDDAKBggrBgEFBQcDBDAYBgNVHREEETAPgQ10ZXN0QHRlc3Qu\nY29tMA0GCSqGSIb3DQEBCwUAA4IBAQDcOYflkAlubGJlv5T1G7PdcHzMzu6doah/\n9RmRyHS8wehc0GljYIyBkhbBG/iRumi6nnnU3BARv+JdSHbpIVsRaXmImWv5I/GO\nOfUO6UY7jlsw1mCjQyIIZoOFyUKnbcvrb0bCryD3rcbAflYg8feq3AiQv3CacxOy\nIbYh3khqbs1jKSAzxEdcsuHRB+by5gpwMfF5ByGdMmMl81mFMUuGlcWsfZp2N4Vz\n7MWVRl38OWkwZ0yw/Jpd1kcVwKIrXF3rjA71AN41rzyMvvPaEfdgCyFolixEOoJH\nFdidq1Bf0liKxf+MFJOaxSWKGqrvzPoBfmwCFoPahuaUlVZ4lGvr\n-----END CERTIFICATE-----\nBag Attributes\n    friendlyName: Digital Signing Test\n    localKeyID: 6F 37 3B E6 78 85 E0 42 30 AC B7 D1 2F C6 C5 69 20 C4 3C 9E \nKey Attributes: <No Attributes>\n-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEA9huMlomV/R+ArG1lqR0/230Yne8lOevY/X9oEgepGL/cDLHf\nwq8dqR8CE+bivYEyePuT2GnsHgd07u7qPaG+BBvN5NlRduq7kX5cwWksxOE6Lcbj\naBPNwVShaEdaD3YNwZk+6jwkbIc+m9+s138VUIAWFNhdp1ECm46gohRLOsNla2xu\nUUMByxMJi8A7t1jxTsLjtmjz9HUYdRNuQ3mZc6jRXGGqAH+cBJsFp+/aDpsxE1od\nLkx04HQq2UqePGb13/YhWYKneRyLdFG+ceWWLkmc+RSfBkUaf9LOKuBRtk9Fx7FJ\nL56DDihpD1JpKRZOAimWuQZ5yiAxkDK9p3Y2jQIDAQABAoIBAQDEu88Nw5xvxNAS\nhjz/DE+wwHZ+Qd6LR7qlIkTqLM+C5lQcndBWi6/1MsFxcV8NyAq15b4RANNsSd+y\n5K/BZttD44oah5J0sj4Ql2fEgLP2Cml8kIHXAAW5p1KDzo3y0Bc9DKjbjAo963sk\nFZDQj1lViZ6dOTzcdIjWGxTTm89rf5frVPUJxNFB+VRHWuyRGudXzGw6g0EX0vMx\n92PFy3NFFSczgRZS0rx+PEN/kYBThdZoWcBnhfq2YLLW5ID0urs6vs2QqGZK/AQE\nB3DezX6arlHvyjOtb9oYl9QV5YG1faqgE9YWQvmkxKHvitcTTYA6fgn7KhCqZmno\nF2WrtkDNAoGBAP5tDiFPGonvZJB4KEmWITqWiYFdlZ9yJ5r1mIRywuJQJ6NCwADd\nv3qvGnjpI4NUFNHvuPr+PYXGi8wlvKGXO7EkO7DyB5hs7LiKyppUBH/Vb4KopAFo\nceG/2B21g0AeF6RuRshWIQwqAzTmz+T4+Kj8WE6e146a3L7TNOM5yOrjAoGBAPeh\nUd9hciqlr/8OhnUUIRUC67F3CBjBl7xnDy+00MPe0A1SsKODBQOTQRq/mr75AM8F\nIwI7wTo0joj4x8LP43YUeOUHUapQoX1AUzAlaZhd5m2wAUOkip15P0mw/GpN9brl\ns3BRZ7DHNzyIay9htM+8YGzUEPwUdyQmln6js+PPAoGAdx7gKsA6kLJAx1M6qZlc\n3W1129fRIeH0oRyz1+9TR1p39HxgIQexiuNI5atiMS7AwLoYRYubinK3KVHRy2Zf\nUETCncnzvG3jN1PkH/WOVbu8hdQnVXFtQGDt8pr1ZKOyNg5bnZiVyHgzICWg2Hep\nFJVxUv4TtnTTPZTtgiWf6DkCgYEAsAghp2YiPmbiIbI1quzQR5t36QPw4YhdUTUB\n+qvS7CpsQ8xQfSwaWFxJn7YtTyy7gm7oYCISTkomOQCBIN+flsUe29DEIQqIgf1E\nJamy0vmNYNQJUgiZ8S/L6ZrDFN6unFnFoUZ9K5GylnlzmI8gdbw336UxHcF+oFg+\nC3Bb5MkCgYBuPywM9nuF8EbeuHCl/3LRkVaNwRwFjgb7NV47E30+3YoM6qvcDG1q\niAi5KixQfk1oW1GGdvMOzOIK+AseKZNxuYwAjynNr6iGyMnPAvaVfv8ZcbmAe1Dx\neX8OG0k/j128DnQZd6Be3yl9qH8eOqCv7eZpe0xO0uZjeyA7TFAEhg==\n-----END RSA PRIVATE KEY-----\n"
  },
  {
    "path": "Scripts/private_256_wrong.pem",
    "content": "Bag Attributes\n    friendlyName: Digital Signing Test 2\n    localKeyID: 74 36 2D 52 4A CD E9 18 4E 16 B4 14 20 CF DF DB FE 3C 13 58 \nsubject=/CN=Digital Signing Test 2/C=AU/emailAddress=test@test.com\nissuer=/CN=Digital Signing Test 2/C=AU/emailAddress=test@test.com\n-----BEGIN CERTIFICATE-----\nMIIDVzCCAj+gAwIBAgIBATANBgkqhkiG9w0BAQsFADBMMR8wHQYDVQQDDBZEaWdp\ndGFsIFNpZ25pbmcgVGVzdCAyMQswCQYDVQQGEwJBVTEcMBoGCSqGSIb3DQEJARYN\ndGVzdEB0ZXN0LmNvbTAeFw0xNjAzMTIwMDUzMDJaFw0xNzAzMTIwMDUzMDJaMEwx\nHzAdBgNVBAMMFkRpZ2l0YWwgU2lnbmluZyBUZXN0IDIxCzAJBgNVBAYTAkFVMRww\nGgYJKoZIhvcNAQkBFg10ZXN0QHRlc3QuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOC\nAQ8AMIIBCgKCAQEAtQ57lsgAE5eWahnJ4e9InudO6rtJ12qE/qaeBrU8qcmJ0ku7\n8Ih2gnShRtdmJGaDgGH1hM6J+ucQvl87foNqJPeAN+s5GeiGw4yoaHTnibJ9/v8r\nzz+PzMwXn6EGykaL6eDAIIOKNcMXvjWZEXtwr/roOFbaEIe6JeqNeSb2mXS+1XI5\nNGCL4jp8y0WmNCp/0LUMGQyj2ilmIgaV74cB2xdxPozZZJnWDASkgbGzi4ijZCpO\nP/yksEvJ7JSNBmmAQoFNslMymOO3XYJs3yvR9thwRl/uHbY4gHRPGHramCdJ6s+L\nw+gzCjslB87HsIy4pp6PeDiOe/tyc79LWcsLbQIDAQABo0QwQjAOBgNVHQ8BAf8E\nBAMCB4AwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwQwGAYDVR0RBBEwD4ENdGVzdEB0\nZXN0LmNvbTANBgkqhkiG9w0BAQsFAAOCAQEAmlDHOKSdE8sRbUHNWZtyghm7FUBc\nrEEB/mM/dtRbq7aUFEPtHpXdKGf/fC0TZxdLoKfIFvgEuPlvzwgFhHTW3qzY4dES\n0n2krALVkfT0IR72vR98AGEE2gchSqGtwr1KkvYE8A4IwU+mlrDzVZoE0OjRg73K\nlpaxc77ln34CB+yAIlL1uunIZj+zmCuhsK4i6QAjzJ1PaNXo5P9F4zfJDW4B0ej6\n/2V9nxBvWW8hdba/eVbDltkvw0dZZay6YgBmVz9mXbAGZ6pk2XOjTlS3XLFgLUVe\n8WTXbktQw0cCcf3xfn6HB/Y+5l/0srZ3i5Su5qtdDDbZ3epBjB3K5kiP8g==\n-----END CERTIFICATE-----\nBag Attributes\n    friendlyName: Digital Signing Test 2\n    localKeyID: 74 36 2D 52 4A CD E9 18 4E 16 B4 14 20 CF DF DB FE 3C 13 58 \nKey Attributes: <No Attributes>\n-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAtQ57lsgAE5eWahnJ4e9InudO6rtJ12qE/qaeBrU8qcmJ0ku7\n8Ih2gnShRtdmJGaDgGH1hM6J+ucQvl87foNqJPeAN+s5GeiGw4yoaHTnibJ9/v8r\nzz+PzMwXn6EGykaL6eDAIIOKNcMXvjWZEXtwr/roOFbaEIe6JeqNeSb2mXS+1XI5\nNGCL4jp8y0WmNCp/0LUMGQyj2ilmIgaV74cB2xdxPozZZJnWDASkgbGzi4ijZCpO\nP/yksEvJ7JSNBmmAQoFNslMymOO3XYJs3yvR9thwRl/uHbY4gHRPGHramCdJ6s+L\nw+gzCjslB87HsIy4pp6PeDiOe/tyc79LWcsLbQIDAQABAoIBAGbv0PwswT5iVLYF\n6210qYkOYSO7T4QVn39YI0gVCmRNnPne7P8X1qjcvkSUehH/5ou7JedXtcLcU/yo\nEB8hf9t8i30/UruUI+pRsf2RWYJD5LZxROsTbCI3dsbeugmOikVx7kmN/6oJPRp7\nRodV8v9aW2SMnHYBdKfR7pUOve0IKcAphravK6Hf/V7Yt7IGS3l2JN0lSSTLcO7O\nuj/xTRSCfLCkKS4mriB0yCSiIXG8hnE1eqoSLvmpG0co23hT8eJZ9eM8NyeYwOwM\nLRD8QVyUKqwK4HlvUUSKT/HtZUa8Fa3JqVmTpCccQAfVXWmk9IaUqgH/nheqUKPv\n+9vPXoECgYEA4xFRYyeDA+y3XgSoSNYIl8gQ7PXGPNyzJ+iKCui13911ykLp8850\n9exLcWigHuW4wdqDcKHVZ0Ak91v/jfukh71h4GqHbyoPqWHnsCBjdq0suwBtKN9O\ntnVVpA5pzJxLy68qxs5fJ3/rDiQydajBdRV0/Bl974e/koIL9DBe/9kCgYEAzCBW\nUy1IJcG1zaC6ueHz3OCkkqbfy1CJokXpM6sxc70pDPMAPheIalbxgdprmWcxeGev\nFXcmU2zaaiEVmLdkMIOAmoIukwKMNi8ugNpPoxgN4YTKUAdNoNo0J/ku4PBjSBRZ\nHaaLLUUb5+u8Yk6SoozI1UFBq2iXnATvHc6f/7UCgYA7pS3qzNM2cbTNBo4p68cA\nD7aaeAjlrdeFsSipqu0za9noEmGgAGhqvPIoTSJaW1+H1F1Ydbo3z/ql202qvyI9\n4bpXF8SRp8vLY4NXmXpnDyBD0t3ZsabceL/RQ1P5QkkKrO2goU8PciONaGa0z2pZ\n1hQPsKaLB+6DjpOTRi1+KQKBgEDps6oFx2DCZjc6+sZr9WnzQkKksJxuQyaIhu14\nbmR47hoBGL2mLCps9aYuuHLzHwdEKahw2I5FGnwPg1eqUkEfQIFiDr+PWtlMTcSK\nKDMcTiW+XbvvZp9VZKqlkmPT7i6Y0fIc6Tt/M62gCKtWg0kP7jnq46BHxZbG9ueK\nstTVAoGBAM0dXbhi5OOxu3Eidx8ZLM3Bxx7aGCxc6N3e2vggdoENUqr56aPpUtC4\nYDN7OmXMXxZoSDZtSCzHgmkB5TOeE/OJla5ixEe4gcis66NDZm/WB0rtMsXKxH+P\nk64i5zMRwn4sI2ImdUer5LNej85DBN/AwlLq8nxPoH1rRhXE4iQW\n-----END RSA PRIVATE KEY-----\n"
  },
  {
    "path": "Scripts/public_256_right.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQsFADBKMR0wGwYDVQQDDBREaWdp\ndGFsIFNpZ25pbmcgVGVzdDELMAkGA1UEBhMCQVUxHDAaBgkqhkiG9w0BCQEWDXRl\nc3RAdGVzdC5jb20wHhcNMTYwMzEwMjM0ODQ2WhcNMTcwMzEwMjM0ODQ2WjBKMR0w\nGwYDVQQDDBREaWdpdGFsIFNpZ25pbmcgVGVzdDELMAkGA1UEBhMCQVUxHDAaBgkq\nhkiG9w0BCQEWDXRlc3RAdGVzdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\nggEKAoIBAQD2G4yWiZX9H4CsbWWpHT/bfRid7yU569j9f2gSB6kYv9wMsd/Crx2p\nHwIT5uK9gTJ4+5PYaeweB3Tu7uo9ob4EG83k2VF26ruRflzBaSzE4TotxuNoE83B\nVKFoR1oPdg3BmT7qPCRshz6b36zXfxVQgBYU2F2nUQKbjqCiFEs6w2VrbG5RQwHL\nEwmLwDu3WPFOwuO2aPP0dRh1E25DeZlzqNFcYaoAf5wEmwWn79oOmzETWh0uTHTg\ndCrZSp48ZvXf9iFZgqd5HIt0Ub5x5ZYuSZz5FJ8GRRp/0s4q4FG2T0XHsUkvnoMO\nKGkPUmkpFk4CKZa5BnnKIDGQMr2ndjaNAgMBAAGjRDBCMA4GA1UdDwEB/wQEAwIH\ngDAWBgNVHSUBAf8EDDAKBggrBgEFBQcDBDAYBgNVHREEETAPgQ10ZXN0QHRlc3Qu\nY29tMA0GCSqGSIb3DQEBCwUAA4IBAQDcOYflkAlubGJlv5T1G7PdcHzMzu6doah/\n9RmRyHS8wehc0GljYIyBkhbBG/iRumi6nnnU3BARv+JdSHbpIVsRaXmImWv5I/GO\nOfUO6UY7jlsw1mCjQyIIZoOFyUKnbcvrb0bCryD3rcbAflYg8feq3AiQv3CacxOy\nIbYh3khqbs1jKSAzxEdcsuHRB+by5gpwMfF5ByGdMmMl81mFMUuGlcWsfZp2N4Vz\n7MWVRl38OWkwZ0yw/Jpd1kcVwKIrXF3rjA71AN41rzyMvvPaEfdgCyFolixEOoJH\nFdidq1Bf0liKxf+MFJOaxSWKGqrvzPoBfmwCFoPahuaUlVZ4lGvr\n-----END CERTIFICATE-----\n-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9huMlomV/R+ArG1lqR0/\n230Yne8lOevY/X9oEgepGL/cDLHfwq8dqR8CE+bivYEyePuT2GnsHgd07u7qPaG+\nBBvN5NlRduq7kX5cwWksxOE6LcbjaBPNwVShaEdaD3YNwZk+6jwkbIc+m9+s138V\nUIAWFNhdp1ECm46gohRLOsNla2xuUUMByxMJi8A7t1jxTsLjtmjz9HUYdRNuQ3mZ\nc6jRXGGqAH+cBJsFp+/aDpsxE1odLkx04HQq2UqePGb13/YhWYKneRyLdFG+ceWW\nLkmc+RSfBkUaf9LOKuBRtk9Fx7FJL56DDihpD1JpKRZOAimWuQZ5yiAxkDK9p3Y2\njQIDAQAB\n-----END PUBLIC KEY-----\n"
  },
  {
    "path": "Scripts/public_256_wrong.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDVzCCAj+gAwIBAgIBATANBgkqhkiG9w0BAQsFADBMMR8wHQYDVQQDDBZEaWdp\ndGFsIFNpZ25pbmcgVGVzdCAyMQswCQYDVQQGEwJBVTEcMBoGCSqGSIb3DQEJARYN\ndGVzdEB0ZXN0LmNvbTAeFw0xNjAzMTIwMDUzMDJaFw0xNzAzMTIwMDUzMDJaMEwx\nHzAdBgNVBAMMFkRpZ2l0YWwgU2lnbmluZyBUZXN0IDIxCzAJBgNVBAYTAkFVMRww\nGgYJKoZIhvcNAQkBFg10ZXN0QHRlc3QuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOC\nAQ8AMIIBCgKCAQEAtQ57lsgAE5eWahnJ4e9InudO6rtJ12qE/qaeBrU8qcmJ0ku7\n8Ih2gnShRtdmJGaDgGH1hM6J+ucQvl87foNqJPeAN+s5GeiGw4yoaHTnibJ9/v8r\nzz+PzMwXn6EGykaL6eDAIIOKNcMXvjWZEXtwr/roOFbaEIe6JeqNeSb2mXS+1XI5\nNGCL4jp8y0WmNCp/0LUMGQyj2ilmIgaV74cB2xdxPozZZJnWDASkgbGzi4ijZCpO\nP/yksEvJ7JSNBmmAQoFNslMymOO3XYJs3yvR9thwRl/uHbY4gHRPGHramCdJ6s+L\nw+gzCjslB87HsIy4pp6PeDiOe/tyc79LWcsLbQIDAQABo0QwQjAOBgNVHQ8BAf8E\nBAMCB4AwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwQwGAYDVR0RBBEwD4ENdGVzdEB0\nZXN0LmNvbTANBgkqhkiG9w0BAQsFAAOCAQEAmlDHOKSdE8sRbUHNWZtyghm7FUBc\nrEEB/mM/dtRbq7aUFEPtHpXdKGf/fC0TZxdLoKfIFvgEuPlvzwgFhHTW3qzY4dES\n0n2krALVkfT0IR72vR98AGEE2gchSqGtwr1KkvYE8A4IwU+mlrDzVZoE0OjRg73K\nlpaxc77ln34CB+yAIlL1uunIZj+zmCuhsK4i6QAjzJ1PaNXo5P9F4zfJDW4B0ej6\n/2V9nxBvWW8hdba/eVbDltkvw0dZZay6YgBmVz9mXbAGZ6pk2XOjTlS3XLFgLUVe\n8WTXbktQw0cCcf3xfn6HB/Y+5l/0srZ3i5Su5qtdDDbZ3epBjB3K5kiP8g==\n-----END CERTIFICATE-----\n-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtQ57lsgAE5eWahnJ4e9I\nnudO6rtJ12qE/qaeBrU8qcmJ0ku78Ih2gnShRtdmJGaDgGH1hM6J+ucQvl87foNq\nJPeAN+s5GeiGw4yoaHTnibJ9/v8rzz+PzMwXn6EGykaL6eDAIIOKNcMXvjWZEXtw\nr/roOFbaEIe6JeqNeSb2mXS+1XI5NGCL4jp8y0WmNCp/0LUMGQyj2ilmIgaV74cB\n2xdxPozZZJnWDASkgbGzi4ijZCpOP/yksEvJ7JSNBmmAQoFNslMymOO3XYJs3yvR\n9thwRl/uHbY4gHRPGHramCdJ6s+Lw+gzCjslB87HsIy4pp6PeDiOe/tyc79LWcsL\nbQIDAQAB\n-----END PUBLIC KEY-----\n"
  },
  {
    "path": "Scripts/test_cert_public_256_right.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQsFADBKMR0wGwYDVQQDDBREaWdp\ndGFsIFNpZ25pbmcgVGVzdDELMAkGA1UEBhMCQVUxHDAaBgkqhkiG9w0BCQEWDXRl\nc3RAdGVzdC5jb20wHhcNMTYwMzEwMjM0ODQ2WhcNMTcwMzEwMjM0ODQ2WjBKMR0w\nGwYDVQQDDBREaWdpdGFsIFNpZ25pbmcgVGVzdDELMAkGA1UEBhMCQVUxHDAaBgkq\nhkiG9w0BCQEWDXRlc3RAdGVzdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\nggEKAoIBAQD2G4yWiZX9H4CsbWWpHT/bfRid7yU569j9f2gSB6kYv9wMsd/Crx2p\nHwIT5uK9gTJ4+5PYaeweB3Tu7uo9ob4EG83k2VF26ruRflzBaSzE4TotxuNoE83B\nVKFoR1oPdg3BmT7qPCRshz6b36zXfxVQgBYU2F2nUQKbjqCiFEs6w2VrbG5RQwHL\nEwmLwDu3WPFOwuO2aPP0dRh1E25DeZlzqNFcYaoAf5wEmwWn79oOmzETWh0uTHTg\ndCrZSp48ZvXf9iFZgqd5HIt0Ub5x5ZYuSZz5FJ8GRRp/0s4q4FG2T0XHsUkvnoMO\nKGkPUmkpFk4CKZa5BnnKIDGQMr2ndjaNAgMBAAGjRDBCMA4GA1UdDwEB/wQEAwIH\ngDAWBgNVHSUBAf8EDDAKBggrBgEFBQcDBDAYBgNVHREEETAPgQ10ZXN0QHRlc3Qu\nY29tMA0GCSqGSIb3DQEBCwUAA4IBAQDcOYflkAlubGJlv5T1G7PdcHzMzu6doah/\n9RmRyHS8wehc0GljYIyBkhbBG/iRumi6nnnU3BARv+JdSHbpIVsRaXmImWv5I/GO\nOfUO6UY7jlsw1mCjQyIIZoOFyUKnbcvrb0bCryD3rcbAflYg8feq3AiQv3CacxOy\nIbYh3khqbs1jKSAzxEdcsuHRB+by5gpwMfF5ByGdMmMl81mFMUuGlcWsfZp2N4Vz\n7MWVRl38OWkwZ0yw/Jpd1kcVwKIrXF3rjA71AN41rzyMvvPaEfdgCyFolixEOoJH\nFdidq1Bf0liKxf+MFJOaxSWKGqrvzPoBfmwCFoPahuaUlVZ4lGvr\n-----END CERTIFICATE-----\n-----BEGIN RSA PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9huMlomV/R+ArG1lqR0/\n230Yne8lOevY/X9oEgepGL/cDLHfwq8dqR8CE+bivYEyePuT2GnsHgd07u7qPaG+\nBBvN5NlRduq7kX5cwWksxOE6LcbjaBPNwVShaEdaD3YNwZk+6jwkbIc+m9+s138V\nUIAWFNhdp1ECm46gohRLOsNla2xuUUMByxMJi8A7t1jxTsLjtmjz9HUYdRNuQ3mZ\nc6jRXGGqAH+cBJsFp+/aDpsxE1odLkx04HQq2UqePGb13/YhWYKneRyLdFG+ceWW\nLkmc+RSfBkUaf9LOKuBRtk9Fx7FJL56DDihpD1JpKRZOAimWuQZ5yiAxkDK9p3Y2\njQIDAQAB\n-----END RSA PUBLIC KEY-----\n"
  },
  {
    "path": "Scripts/test_cert_public_256_wrong.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDVzCCAj+gAwIBAgIBATANBgkqhkiG9w0BAQsFADBMMR8wHQYDVQQDDBZEaWdp\ndGFsIFNpZ25pbmcgVGVzdCAyMQswCQYDVQQGEwJBVTEcMBoGCSqGSIb3DQEJARYN\ndGVzdEB0ZXN0LmNvbTAeFw0xNjAzMTIwMDUzMDJaFw0xNzAzMTIwMDUzMDJaMEwx\nHzAdBgNVBAMMFkRpZ2l0YWwgU2lnbmluZyBUZXN0IDIxCzAJBgNVBAYTAkFVMRww\nGgYJKoZIhvcNAQkBFg10ZXN0QHRlc3QuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOC\nAQ8AMIIBCgKCAQEAtQ57lsgAE5eWahnJ4e9InudO6rtJ12qE/qaeBrU8qcmJ0ku7\n8Ih2gnShRtdmJGaDgGH1hM6J+ucQvl87foNqJPeAN+s5GeiGw4yoaHTnibJ9/v8r\nzz+PzMwXn6EGykaL6eDAIIOKNcMXvjWZEXtwr/roOFbaEIe6JeqNeSb2mXS+1XI5\nNGCL4jp8y0WmNCp/0LUMGQyj2ilmIgaV74cB2xdxPozZZJnWDASkgbGzi4ijZCpO\nP/yksEvJ7JSNBmmAQoFNslMymOO3XYJs3yvR9thwRl/uHbY4gHRPGHramCdJ6s+L\nw+gzCjslB87HsIy4pp6PeDiOe/tyc79LWcsLbQIDAQABo0QwQjAOBgNVHQ8BAf8E\nBAMCB4AwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwQwGAYDVR0RBBEwD4ENdGVzdEB0\nZXN0LmNvbTANBgkqhkiG9w0BAQsFAAOCAQEAmlDHOKSdE8sRbUHNWZtyghm7FUBc\nrEEB/mM/dtRbq7aUFEPtHpXdKGf/fC0TZxdLoKfIFvgEuPlvzwgFhHTW3qzY4dES\n0n2krALVkfT0IR72vR98AGEE2gchSqGtwr1KkvYE8A4IwU+mlrDzVZoE0OjRg73K\nlpaxc77ln34CB+yAIlL1uunIZj+zmCuhsK4i6QAjzJ1PaNXo5P9F4zfJDW4B0ej6\n/2V9nxBvWW8hdba/eVbDltkvw0dZZay6YgBmVz9mXbAGZ6pk2XOjTlS3XLFgLUVe\n8WTXbktQw0cCcf3xfn6HB/Y+5l/0srZ3i5Su5qtdDDbZ3epBjB3K5kiP8g==\n-----END CERTIFICATE-----\n-----BEGIN RSA PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtQ57lsgAE5eWahnJ4e9I\nnudO6rtJ12qE/qaeBrU8qcmJ0ku78Ih2gnShRtdmJGaDgGH1hM6J+ucQvl87foNq\nJPeAN+s5GeiGw4yoaHTnibJ9/v8rzz+PzMwXn6EGykaL6eDAIIOKNcMXvjWZEXtw\nr/roOFbaEIe6JeqNeSb2mXS+1XI5NGCL4jp8y0WmNCp/0LUMGQyj2ilmIgaV74cB\n2xdxPozZZJnWDASkgbGzi4ijZCpOP/yksEvJ7JSNBmmAQoFNslMymOO3XYJs3yvR\n9thwRl/uHbY4gHRPGHramCdJ6s+Lw+gzCjslB87HsIy4pp6PeDiOe/tyc79LWcsL\nbQIDAQAB\n-----END RSA PUBLIC KEY-----\n"
  },
  {
    "path": "Sources/JWT/Algorithms/Base/JWTAlgorithmErrorDescription+Subclass.m",
    "content": "//\n//  JWTAlgorithmErrorDescription+Subclass.m\n//  JWT\n//\n//  Created by Dmitry on 7/29/18.\n//  Copyright © 2018 JWTIO. All rights reserved.\n//\n\n#import \"JWTAlgorithmErrorDescription+Subclass.h\"\n\n@implementation JWTAlgorithmErrorDescription (Subclass)\n+ (NSString *)errorDomain {\n    return nil;\n}\n+ (NSInteger)defaultErrorCode {\n    return 0;\n}\n+ (NSInteger)externalCodeForInternalError {\n    return 0;\n}\n+ (NSDictionary *)codesAndUserDescriptions {\n    return nil;\n}\n+ (NSDictionary *)codesAndDescriptions {\n    return nil;\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/Algorithms/Base/JWTAlgorithmErrorDescription.m",
    "content": "//\n//  JWTAlgorithmErrorDescription.m\n//  JWT\n//\n//  Created by Dmitry on 7/29/18.\n//  Copyright © 2018 JWTIO. All rights reserved.\n//\n\n#import \"JWTAlgorithmErrorDescription.h\"\n#import \"JWTAlgorithmErrorDescription+Subclass.h\"\n\n@interface JWTAlgorithmErrorDescription (Keys)\n+ (NSString *)currentErrorDescriptionKey;\n+ (NSString *)externalErrorDescriptionKey;\n@end\n\n@implementation JWTAlgorithmErrorDescription (Keys)\n+ (NSString *)currentErrorDescriptionKey { return @\"errorDescription\"; }\n+ (NSString *)externalErrorDescriptionKey { return @\"externalErrorDescription\"; }\n@end\n\n@interface JWTAlgorithmErrorDescription ()\n+ (NSError *)errorWithCode:(NSInteger)code userDescription:(NSString *)userDescription errorDescription:(NSString *)errorDescription;\n+ (NSError *)errorWithCode:(NSInteger)code userDescription:(NSString *)userDescription errorDescription:(NSString *)errorDescription externalErrorDescription:(NSString *)externalErrorDescription;\n@end\n\n@implementation JWTAlgorithmErrorDescription\n+ (NSString *)userDescriptionForCode:(NSInteger)code {\n    NSString *resultString = [self codesAndUserDescriptions][@(code)];\n    return resultString ?: [self codesAndUserDescriptions][@([self defaultErrorCode])];\n}\n+ (NSString *)errorDescriptionForCode:(NSInteger)code {\n    NSString *resultString = [self codesAndDescriptions][@(code)];\n    return resultString ?: [self codesAndDescriptions][@([self defaultErrorCode])];\n}\n+ (NSError *)errorWithCode:(NSInteger)code userDescription:(NSString *)userDescription errorDescription:(NSString *)errorDescription {\n    return [NSError errorWithDomain:[self errorDomain] code:code userInfo:@{NSLocalizedDescriptionKey: userDescription, [self currentErrorDescriptionKey] : errorDescription}];\n}\n+ (NSError *)errorWithCode:(NSInteger)code userDescription:(NSString *)userDescription errorDescription:(NSString *)errorDescription externalErrorDescription:(NSString *)externalErrorDescription {\n    return [NSError errorWithDomain:[self errorDomain] code:code userInfo:@{NSLocalizedDescriptionKey: userDescription, [self currentErrorDescriptionKey] : errorDescription, [self externalErrorDescriptionKey] : externalErrorDescription}];\n}\n+ (NSError *)errorWithCode:(NSInteger)code {\n    return [self errorWithCode:code userDescription:[self userDescriptionForCode:code] errorDescription:[self errorDescriptionForCode:code]];\n}\n\n+ (NSError *)errorWithExternalError:(NSError *)error {\n    NSString *externalErrorDescription = [@{@\"externalError\": error} description];\n    __auto_type code = [self externalCodeForInternalError];\n    return [self errorWithCode:code userDescription:[self userDescriptionForCode:code] errorDescription:[self errorDescriptionForCode:code] externalErrorDescription:externalErrorDescription];\n}\n@end\n\n"
  },
  {
    "path": "Sources/JWT/Algorithms/Base/JWTAlgorithmFactory.m",
    "content": "//\n//  JWTAlgorithmFactory.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 07.10.15.\n//  Copyright © 2015 Karma. All rights reserved.\n//\n\n#import \"JWTAlgorithmFactory.h\"\n#import \"JWTAlgorithmHSBase.h\"\n#import \"JWTAlgorithmRSBase.h\"\n#import \"JWTAlgorithmNone.h\"\n#import \"JWTAlgorithmAsymmetricBase.h\"\n#import \"JWTBase64Coder.h\"\n\n// not implemented.\n// ES still not implemented. Look at implementation and readme in future releases.\n\n@implementation JWTAlgorithmHolder\n\n- (instancetype)initWithAlgorithm:(id<JWTAlgorithm>)algorithm {\n    if (self = [super init]) {\n        self.algorithm = algorithm;\n    }\n    return self;\n}\n\n- (NSString *)name {\n    return self.algorithm.name;\n}\n\n- (NSData *)signHash:(NSData *)hash key:(NSData *)key error:(NSError *__autoreleasing *)error {\n    return [self.algorithm signHash:hash key:key error:error];\n}\n\n- (BOOL)verifyHash:(NSData *)hash signature:(NSData *)signature key:(NSData *)key error:(NSError *__autoreleasing *)error {\n    return [self.algorithm verifyHash:hash signature:signature key:key error:error];\n}\n\n- (NSData *)encodePayload:(NSString *)theString withSecret:(NSString *)theSecret {\n    NSData *inputData = [theString dataUsingEncoding:NSUTF8StringEncoding];\n    NSData *secretData = [theSecret dataUsingEncoding:NSUTF8StringEncoding];\n    //[JWTBase64Coder dataWithBase64UrlEncodedString:theSecret];\n    return [self encodePayloadData:inputData withSecret:secretData];\n}\n\n- (NSData *)encodePayloadData:(NSData *)theStringData withSecret:(NSData *)theSecretData {\n    return [self signHash:theStringData key:theSecretData error:nil];\n}\n\n- (BOOL)verifySignedInput:(NSString *)input withSignature:(NSString *)signature verificationKey:(NSString *)verificationKey {\n    NSData *inputData = [input dataUsingEncoding:NSUTF8StringEncoding]; //[JWTBase64Coder dataWithBase64UrlEncodedString:input];\n    NSData *signatureData = [JWTBase64Coder dataWithBase64UrlEncodedString:signature];\n    NSData *verificationKeyData = [verificationKey dataUsingEncoding:NSUTF8StringEncoding];\n\n    return [self verifyHash:inputData signature:signatureData key:verificationKeyData error:nil];\n    \n//    return [self verifySignedInput:input withSignature:signature verificationKeyData:verificationKeyData];\n}\n\n- (BOOL)verifySignedInput:(NSString *)input withSignature:(NSString *)signature verificationKeyData:(NSData *)verificationKeyData {\n    NSData *signatureData = [JWTBase64Coder dataWithBase64UrlEncodedString:signature];\n    NSData *inputData = [input dataUsingEncoding:NSUTF8StringEncoding]; //[JWTBase64Coder dataWithBase64UrlEncodedString:input];\n    return [self verifyHash:inputData signature:signatureData key:verificationKeyData error:nil ];\n}\n\n@end\n\n@implementation JWTAlgorithmFactory\n\n+ (BOOL)checkIfSecurityAPIAvailable {\n    BOOL result = NO;\n#if TARGET_OS_MAC && TARGET_OS_IPHONE // iOS >= 10\n    result = [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10, 0, 0}];\n#elif TARGET_OS_MAC && !TARGET_OS_IPHONE // macOS >= 10.12\n    result = [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10, 12, 0}];\n#endif\n    return result;\n}\n\n+ (NSArray<id<JWTAlgorithm>> *)algorithms {\n    if ([self checkIfSecurityAPIAvailable]) {\n        return @[\n                 [JWTAlgorithmNone new],\n                 [JWTAlgorithmHSBase algorithm256],\n                 [JWTAlgorithmHSBase algorithm384],\n                 [JWTAlgorithmHSBase algorithm512],\n                 [JWTAlgorithmAsymmetricBase withRS].with256,\n                 [JWTAlgorithmAsymmetricBase withRS].with384,\n                 [JWTAlgorithmAsymmetricBase withRS].with512,\n                 [JWTAlgorithmAsymmetricBase withES].with256,\n                 [JWTAlgorithmAsymmetricBase withES].with384,\n                 [JWTAlgorithmAsymmetricBase withES].with512\n                 ];\n    }\n    \n    return @[\n            [JWTAlgorithmNone new],\n            [JWTAlgorithmHSBase algorithm256],\n            [JWTAlgorithmHSBase algorithm384],\n            [JWTAlgorithmHSBase algorithm512],\n            [JWTAlgorithmRSBase algorithm256],\n            [JWTAlgorithmRSBase algorithm384],\n            [JWTAlgorithmRSBase algorithm512]\n            ];\n\n}\n\n+ (id<JWTAlgorithm>)algorithmByName:(NSString *)name {\n    id<JWTAlgorithm> algorithm = nil;\n    \n    NSString *algName = [name copy];\n    \n    NSUInteger index = [[self algorithms] indexOfObjectPassingTest:^BOOL(id<JWTAlgorithm> obj, NSUInteger idx, BOOL *stop) {\n        // lowercase comparison\n        return [obj.name isEqualToString:algName];\n    }];\n    \n    if (index != NSNotFound) {\n        algorithm = [self algorithms][index];\n    }\n    \n    return algorithm;\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/Algorithms/Base/JWTAlgorithmNone.m",
    "content": "//\n//  JWTAlgorithmNone.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 16.10.15.\n//  Copyright © 2015 Karma. All rights reserved.\n//\n\n#import \"JWTAlgorithmNone.h\"\nNSString *const JWTAlgorithmNameNone = @\"none\";\n\n@implementation JWTAlgorithmNone\n\n- (NSString *)name {\n    return JWTAlgorithmNameNone;\n}\n\n- (NSData *)signHash:(NSData *)hash key:(NSData *)key error:(NSError *__autoreleasing *)error {\n    return [NSData data];\n}\n\n- (BOOL)verifyHash:(NSData *)hash signature:(NSData *)signature key:(NSData *)key error:(NSError *__autoreleasing *)error {\n    //if a secret is provided, this isn't the None algorithm\n    if (key && key.length > 0) {\n        return NO;\n    }\n    \n    //If the signature isn't blank, this isn't the None algorithm\n    if (signature && signature.length > 0) {\n        return NO;\n    }\n    \n    return YES;\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/Algorithms/ESFamily/JWTAlgorithmAsymmetricBase.m",
    "content": "//\n//  JWTAlgorithmAsymmetricBase.m\n//  Base64\n//\n//  Created by Lobanov Dmitry on 12.03.2018.\n//\n\n#import \"JWTAlgorithmAsymmetricBase.h\"\n#import \"JWTBase64Coder.h\"\n#import \"JWTCryptoSecurity.h\"\n#import \"JWTCryptoKeyExtractor.h\"\n#import \"JWTCryptoKey.h\"\n#import \"JWTAlgorithmFactory.h\"\n#import <Availability.h>\n\n#ifndef IPHONE_SDK_VERSION_GREATER_THAN_10\n#define IPHONE_SDK_VERSION_GREATER_THAN_10 (__IPHONE_OS_VERSION_MAX_ALLOWED && __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000)\n#endif\n\n#ifndef MAC_OS_SDK_VERSION_GREATER_THAN_10_12\n#define MAC_OS_SDK_VERSION_GREATER_THAN_10_12 (__MAC_OS_X_VERSION_MAX_ALLOWED && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101200)\n#endif\n\n// Abilities\n#ifndef JWT_CRYPTO_MODERN_API_IS_ALLOWED\n#define JWT_CRYPTO_MODERN_API_IS_ALLOWED ((IPHONE_SDK_VERSION_GREATER_THAN_10) || (MAC_OS_SDK_VERSION_GREATER_THAN_10_12))\n#endif\n\n// #ifndef IPHONE_OS_VERSION_GREATER_THAN_10\n// #define IPHONE_OS_VERSION_GREATER_THAN_10 (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000)\n// #endif\n\n// #ifndef MAC_OS_VERSION_GREATER_THAN_10\n// #define MAC_OS_VERSION_GREATER_THAN_10 (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)\n// #endif\n\n// // Requirements\n// #ifndef JWT_CRYPTO_MODERN_API_IS_REQUIRED\n// #define JWT_CRYPTO_MODERN_API_IS_REQUIRED ((IPHONE_OS_VERSION_GREATER_THAN_10) || (MAC_OS_VERSION_GREATER_THAN_10))\n// #endif\n\n// TODO:\n// Rewrite errors presentation.\nNSString *const JWTAlgorithmAsymmetricFamilyErrorDomain = @\"io.jwt.jwa.asymmetric\";\n\n@implementation JWTAlgorithmAsymmetricFamilyErrorDescription\n// Subclass\n+ (NSString *)errorDomain {\n    return JWTAlgorithmAsymmetricFamilyErrorDomain;\n}\n+ (NSInteger)defaultErrorCode {\n    return JWTAlgorithmAsymmetricFamilyErrorUnexpected;\n}\n+ (NSInteger)externalErrorCode {\n    return JWTAlgorithmAsymmetricFamilyErrorInternalSecurityAPI;\n}\n+ (NSDictionary *)codesAndUserDescriptions {\n    static NSDictionary *dictionary = nil;\n    static dispatch_once_t onceToken;\n    dispatch_once(&onceToken, ^{\n        dictionary = @{\n                       @(JWTAlgorithmAsymmetricFamilyErrorAlgorithmIsNotSupported) : @\"Algorithm is not supported!\",\n                       @(JWTAlgorithmAsymmetricFamilyErrorInternalSecurityAPI) : @\"algorithm internal security framework error!\",\n                       @(JWTAlgorithmAsymmetricFamilyErrorUnexpected) : @\"Asymmetric algorithm unexpected error!\"\n                       };\n    });\n    return dictionary;\n}\n+ (NSDictionary *)codesAndDescriptions {\n    static NSDictionary *dictionary = nil;\n    static dispatch_once_t onceToken;\n    dispatch_once(&onceToken, ^{\n        dictionary = @{\n                       @(JWTAlgorithmAsymmetricFamilyErrorAlgorithmIsNotSupported) : @\"JWTAlgorithmAsymmetricFamilyErrorAlgorithmIsNotSupported\",\n                       @(JWTAlgorithmAsymmetricFamilyErrorInternalSecurityAPI) : @\"JWTAlgorithmAsymmetricFamilyErrorInternalSecurityAPI\",\n                       @(JWTAlgorithmAsymmetricFamilyErrorUnexpected) : @\"JWTAlgorithmAsymmetricFamilyErrorUnexpected\"\n                       };\n    });\n    return dictionary;\n}\n@end\n\ntypedef NS_ENUM(NSInteger, JWTAlgorithmAsymmetricBase__AlgorithmType) {\n    JWTAlgorithmAsymmetricBase__AlgorithmType__RS,\n    JWTAlgorithmAsymmetricBase__AlgorithmType__ES,\n    JWTAlgorithmAsymmetricBase__AlgorithmType__PS\n};\ntypedef NS_ENUM(NSInteger, JWTAlgorithmAsymmetricBase__AlgorithmNumber) {\n    JWTAlgorithmAsymmetricBase__AlgorithmNumber__256,\n    JWTAlgorithmAsymmetricBase__AlgorithmNumber__384,\n    JWTAlgorithmAsymmetricBase__AlgorithmNumber__512\n};\n@interface JWTAlgorithmAsymmetricBase ()\n@property (copy, nonatomic, readwrite) NSNumber *algorithmType;\n@property (copy, nonatomic, readwrite) NSNumber *algorithmNumber;\n@property (strong, nonatomic, readonly) id <JWTCryptoKeyExtractorProtocol> keyExtractor;\n@property (copy, nonatomic, readwrite) JWTAlgorithmAsymmetricBase *(^setAlgorithmType)(JWTAlgorithmAsymmetricBase__AlgorithmType);\n@property (copy, nonatomic, readwrite) JWTAlgorithmAsymmetricBase *(^setAlgorithmNumber)(JWTAlgorithmAsymmetricBase__AlgorithmNumber);\n@end\n\n@implementation JWTAlgorithmAsymmetricBase\n@synthesize keyExtractorType;\n@synthesize signKey;\n@synthesize verifyKey;\n@synthesize privateKeyCertificatePassphrase;\n- (void)setupFluent {\n    __weak typeof(self) weakSelf = self;\n    self.setAlgorithmType = ^(JWTAlgorithmAsymmetricBase__AlgorithmType type) {\n        weakSelf.algorithmType = @(type);\n        return weakSelf;\n    };\n    self.setAlgorithmNumber = ^(JWTAlgorithmAsymmetricBase__AlgorithmNumber number) {\n        weakSelf.algorithmNumber = @(number);\n        return weakSelf;\n    };\n}\n- (instancetype)init {\n    self = [super init];\n    if (self) {\n        [self setupFluent];\n    }\n    return self;\n}\n\n- (id<JWTCryptoKeyExtractorProtocol>)keyExtractor {\n    return [JWTCryptoKeyExtractor createWithType:self.keyExtractorType];\n}\n@end\n\n@interface JWTAlgorithmAsymmetricBase (SignAndVerify)\n#pragma mark - Private ( Override-part depends on platform )\n- (BOOL)verifyData:(NSData *)plainData signature:(NSData *)signature key:(SecKeyRef)publicKey error:(NSError *__autoreleasing*)error;\n- (NSData *)signData:(NSData *)plainData key:(SecKeyRef)privateKey error:(NSError *__autoreleasing*)error;\n@end\n\n@implementation JWTAlgorithmAsymmetricBase (SignAndVerify)\n#pragma mark - Private ( Override-part depends on platform )\n- (BOOL)verifyData:(NSData *)plainData signature:(NSData *)signature key:(SecKeyRef)publicKey error:(NSError *__autoreleasing*)error {\n    return NO;\n}\n\n- (NSData *)signData:(NSData *)plainData key:(SecKeyRef)privateKey error:(NSError *__autoreleasing*)error {\n    return nil;\n}\n@end\n\n@implementation JWTAlgorithmAsymmetricBase (JWTAsymmetricKeysAlgorithm)\n@dynamic privateKeyCertificatePassphrase;\n- (NSString *)name {\n    return @\"AssymetricBase\";\n}\n\n- (NSData *)signHash:(NSData *)hash key:(NSData *)key error:(NSError *__autoreleasing *)error {\n    return nil;\n}\n\n- (BOOL)verifyHash:(NSData *)hash signature:(NSData *)signature key:(NSData *)key error:(NSError *__autoreleasing *)error {\n    return NO;\n}\n\n#pragma mark - NSCopying\n- (id)copyWithZone:(NSZone *)zone {\n    // create new.\n    id <JWTRSAlgorithm> algorithm = (id<JWTRSAlgorithm>)[JWTAlgorithmFactory algorithmByName:[self name]];\n    algorithm.privateKeyCertificatePassphrase = self.privateKeyCertificatePassphrase;\n    algorithm.keyExtractorType = self.keyExtractorType;\n    algorithm.signKey = self.signKey;\n    algorithm.verifyKey = self.verifyKey;\n    return algorithm;\n}\n@end\n\n@interface JWTAlgorithmAsymmetricBase__Prior10 : JWTAlgorithmAsymmetricBase @end\n@implementation JWTAlgorithmAsymmetricBase__Prior10 @end\n\n#import <Security/Security.h>\n#if JWT_CRYPTO_MODERN_API_IS_ALLOWED\nSecKeyAlgorithm chooseAlgorithm(NSNumber *type, NSNumber *number) {\n    if (@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)) {\n        switch ((JWTAlgorithmAsymmetricBase__AlgorithmNumber)number.integerValue) {\n            case JWTAlgorithmAsymmetricBase__AlgorithmNumber__256:\n                switch ((JWTAlgorithmAsymmetricBase__AlgorithmType)type.integerValue) {\n                    case JWTAlgorithmAsymmetricBase__AlgorithmType__RS: return kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA256;\n                    case JWTAlgorithmAsymmetricBase__AlgorithmType__ES: return kSecKeyAlgorithmECDSASignatureMessageX962SHA256;\n                    case JWTAlgorithmAsymmetricBase__AlgorithmType__PS: {\n                        if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)) {\n                            return kSecKeyAlgorithmRSASignatureMessagePSSSHA256;\n                        }\n                        break;\n                    }\n                }\n            case JWTAlgorithmAsymmetricBase__AlgorithmNumber__384:\n                switch ((JWTAlgorithmAsymmetricBase__AlgorithmType)type.integerValue) {\n                    case JWTAlgorithmAsymmetricBase__AlgorithmType__RS: return kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA384;\n                    case JWTAlgorithmAsymmetricBase__AlgorithmType__ES: return kSecKeyAlgorithmECDSASignatureMessageX962SHA384;\n                    case JWTAlgorithmAsymmetricBase__AlgorithmType__PS: {\n                        if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)) {\n                            return kSecKeyAlgorithmRSASignatureMessagePSSSHA384;\n                        }\n                        break;\n                    }\n                }\n            case JWTAlgorithmAsymmetricBase__AlgorithmNumber__512:\n                switch ((JWTAlgorithmAsymmetricBase__AlgorithmType)type.integerValue) {\n                    case JWTAlgorithmAsymmetricBase__AlgorithmType__RS: return kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA512;\n                    case JWTAlgorithmAsymmetricBase__AlgorithmType__ES: return kSecKeyAlgorithmECDSASignatureMessageX962SHA512;\n                    case JWTAlgorithmAsymmetricBase__AlgorithmType__PS: {\n                        if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)) {\n                            return kSecKeyAlgorithmRSASignatureMessagePSSSHA512;\n                        }\n                        break;\n                    }\n                }\n        }\n        return NULL;\n    } else {\n        return NULL;\n    }\n}\n\n#ifdef NS_AVAILABLE\nNS_AVAILABLE(10_12, 10_0)\n#endif\n@interface JWTAlgorithmAsymmetricBase__After10\n: JWTAlgorithmAsymmetricBase\n@property (assign, nonatomic, readonly) SecKeyAlgorithm algorithm;\n@end\n@implementation JWTAlgorithmAsymmetricBase__After10\n- (SecKeyAlgorithm)chooseAlgorithmByType:(NSNumber *)type number:(NSNumber *)number {\n    return chooseAlgorithm(type, number);\n}\n\n- (SecKeyAlgorithm)algorithm {\n    return [self chooseAlgorithmByType:self.algorithmType number:self.algorithmNumber];\n}\n@end\n\n@implementation JWTAlgorithmAsymmetricBase__After10 (SignAndVerify)\n- (NSData *)signData:(NSData *)plainData key:(SecKeyRef)privateKey error:(NSError *__autoreleasing *)error {\n    if (@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)) {\n        CFErrorRef theError = NULL;\n        NSData *result = (NSData *)CFBridgingRelease(SecKeyCreateSignature(privateKey, self.algorithm, (__bridge CFDataRef)plainData, &theError));\n        if (error && theError) {\n            *error = (__bridge NSError *)(theError);\n        }\n        return result;\n    } else {\n        if (error) {\n            *error = [JWTAlgorithmAsymmetricFamilyErrorDescription errorWithCode:JWTAlgorithmAsymmetricFamilyErrorAlgorithmIsNotSupported];\n        }\n        return nil;\n    }\n}\n- (BOOL)verifyData:(NSData *)plainData signature:(NSData *)signature key:(SecKeyRef)publicKey error:(NSError *__autoreleasing *)error {\n    if (@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)) {\n        CFErrorRef theError = NULL;\n        BOOL result = SecKeyVerifySignature(publicKey, self.algorithm, (__bridge CFDataRef)plainData, (__bridge CFDataRef)signature, &theError);\n        if (error && theError) {\n            *error = (__bridge NSError *)(theError);\n        }\n        return result;\n    } else {\n        if (error) {\n            *error = [JWTAlgorithmAsymmetricFamilyErrorDescription errorWithCode:JWTAlgorithmAsymmetricFamilyErrorAlgorithmIsNotSupported];\n        }\n        return NO;\n    }\n}\n@end\n\n@implementation JWTAlgorithmAsymmetricBase__After10 (JWTAsymmetricKeysAlgorithm)\n#pragma mark - JWTAlgorithm\n- (NSDictionary *)verifyKeyExtractorParameters {\n    switch ((JWTAlgorithmAsymmetricBase__AlgorithmType)self.algorithmType.integerValue) {\n        case JWTAlgorithmAsymmetricBase__AlgorithmType__RS: return @{[JWTCryptoKey parametersKeyBuilder] : [JWTCryptoKeyBuilder new].keyTypeRSA};\n        case JWTAlgorithmAsymmetricBase__AlgorithmType__ES: return @{[JWTCryptoKey parametersKeyBuilder] : [JWTCryptoKeyBuilder new].keyTypeEC};\n        default: return nil;\n    }\n}\n- (NSDictionary *)signKeyExtractorParameters {\n    NSMutableDictionary *mutableDictionary = [[self verifyKeyExtractorParameters] mutableCopy];\n    mutableDictionary[[JWTCryptoKeyExtractor parametersKeyCertificatePassphrase]] = self.privateKeyCertificatePassphrase ?: [NSNull null];\n    return [mutableDictionary copy];\n}\n\n- (BOOL)removeKeyItem:(id<JWTCryptoKeyProtocol>)item error:(NSError *__autoreleasing *)error {\n    NSError *theError = nil;\n    [JWTCryptoSecurity removeKeyByTag:item.tag error:&theError];\n    if (error) {\n        *error = theError;\n    }\n    return theError == nil;\n}\n\n- (NSData *)signHash:(NSData *)hash key:(NSData *)key error:(NSError *__autoreleasing *)error {    \n    id<JWTCryptoKeyExtractorProtocol> theExtractor = self.keyExtractor ?: [JWTCryptoKeyExtractor privateKeyInP12];\n    NSError *extractKeyError = nil;\n    id <JWTCryptoKeyProtocol> keyItem = self.signKey ?: [theExtractor keyFromData:key parameters:[self signKeyExtractorParameters] error:&extractKeyError];\n    \n    if (extractKeyError || keyItem == nil) {\n        // tell about error\n        if (extractKeyError && error) {\n            *error = extractKeyError;\n        }\n        NSError *removeError = nil;\n        [self removeKeyItem:keyItem error:&removeError];\n        return nil;\n    }\n    else {\n        NSError *signError = nil;\n        NSData *result = [self signData:hash key:keyItem.key error:&signError];\n        if (signError && error) {\n            *error = signError;\n        }\n        return result;\n    }\n}\n- (BOOL)verifyHash:(NSData *)hash signature:(NSData *)signature key:(NSData *)key error:(NSError *__autoreleasing *)error {\n    id<JWTCryptoKeyExtractorProtocol> theExtractor = self.keyExtractor ?: [JWTCryptoKeyExtractor publicKeyWithCertificate];\n    NSError *extractKeyError = nil;\n    id<JWTCryptoKeyProtocol> keyItem = self.verifyKey ?: [theExtractor keyFromData:key parameters:[self verifyKeyExtractorParameters] error:&extractKeyError];\n    if (extractKeyError || keyItem == nil) {\n        if (extractKeyError && error) {\n            *error = extractKeyError;\n        }\n        NSError *removeError = nil;\n        [self removeKeyItem:keyItem error:&removeError];\n        return NO;\n    }\n    else {\n        NSError *verifyError = nil;\n        BOOL verified = [self verifyData:hash signature:signature key:keyItem.key error:&verifyError];\n        if (verifyError && error) {\n            *error = verifyError;\n        }\n        NSError *removeError = nil;\n        [self removeKeyItem:keyItem error:&removeError];\n        return verified;\n    }\n}\n\n@end\n#endif\n\n//// MacOS OR iOS is Base\n//#if TARGET_OS_MAC && !TARGET_OS_IPHONE // check that mac version is ok.\n//@interface JWTAlgorithmRSFamilyMember : JWTAlgorithmRSBaseMac @end\n//#else // check that iphone version is ok.\n//@interface JWTAlgorithmRSFamilyMember : JWTAlgorithmRSBaseIOS @end\n//#endif\n// (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0) ||\n@interface JWTAlgorithmAsymmetricBase__FamilyMember :\n#if JWT_CRYPTO_MODERN_API_IS_ALLOWED\nJWTAlgorithmAsymmetricBase__After10\n#else\nJWTAlgorithmAsymmetricBase__Prior10\n#endif\n@end\n\n@implementation JWTAlgorithmAsymmetricBase__FamilyMember\n- (NSString *)stringForAlgorithmNumber:(JWTAlgorithmAsymmetricBase__AlgorithmNumber)number {\n    switch (number) {\n        case JWTAlgorithmAsymmetricBase__AlgorithmNumber__256: return @\"256\";\n        case JWTAlgorithmAsymmetricBase__AlgorithmNumber__384: return @\"384\";\n        case JWTAlgorithmAsymmetricBase__AlgorithmNumber__512: return @\"512\";\n        default: return nil;\n    }\n}\n\n- (NSString *)stringForAlgorithmType:(JWTAlgorithmAsymmetricBase__AlgorithmType)type {\n    switch (type) {\n        case JWTAlgorithmAsymmetricBase__AlgorithmType__RS: return @\"RS\";\n        case JWTAlgorithmAsymmetricBase__AlgorithmType__ES: return @\"ES\";\n        case JWTAlgorithmAsymmetricBase__AlgorithmType__PS: return @\"PS\";\n        default: return nil;\n    }\n}\n\n- (NSString *)name {\n    return [[self stringForAlgorithmType:(JWTAlgorithmAsymmetricBase__AlgorithmType)self.algorithmType.integerValue] stringByAppendingString:[self stringForAlgorithmNumber:(JWTAlgorithmAsymmetricBase__AlgorithmNumber)self.algorithmNumber.integerValue]];\n}\n@end\n\n@interface JWTAlgorithmAsymmetricBase__FamilyMember__RS : JWTAlgorithmAsymmetricBase__FamilyMember @end\n\n@implementation JWTAlgorithmAsymmetricBase__FamilyMember__RS\n- (NSNumber *)algorithmType {\n    return @(JWTAlgorithmAsymmetricBase__AlgorithmType__RS);\n}\n@end\n\n@interface JWTAlgorithmAsymmetricBase__FamilyMember__ES : JWTAlgorithmAsymmetricBase__FamilyMember @end\n\n@implementation JWTAlgorithmAsymmetricBase__FamilyMember__ES\n- (NSNumber *)algorithmType {\n    return @(JWTAlgorithmAsymmetricBase__AlgorithmType__ES);\n}\n@end\n\n@interface JWTAlgorithmAsymmetricBase__FamilyMember__PS : JWTAlgorithmAsymmetricBase__FamilyMember @end\n\n@implementation JWTAlgorithmAsymmetricBase__FamilyMember__PS\n- (NSNumber *)algorithmType {\n    return @(JWTAlgorithmAsymmetricBase__AlgorithmType__PS);\n}\n@end\n\n@implementation JWTAlgorithmAsymmetricBase (Create)\n+ (instancetype)withRS {\n    return [[JWTAlgorithmAsymmetricBase__FamilyMember__RS alloc] init];\n}\n+ (instancetype)withES {\n    return [[JWTAlgorithmAsymmetricBase__FamilyMember__ES alloc] init];\n}\n+ (instancetype)withPS {\n    return [[JWTAlgorithmAsymmetricBase__FamilyMember__PS alloc] init];\n}\n- (instancetype)with256 {\n    return self.setAlgorithmNumber(JWTAlgorithmAsymmetricBase__AlgorithmNumber__256);\n}\n- (instancetype)with384 {\n    return self.setAlgorithmNumber(JWTAlgorithmAsymmetricBase__AlgorithmNumber__384);\n}\n- (instancetype)with512 {\n    return self.setAlgorithmNumber(JWTAlgorithmAsymmetricBase__AlgorithmNumber__512);\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/Algorithms/ESFamily/JWTAlgorithmESBase.m",
    "content": "//\n//  JWTAlgorithmESBase.m\n//  Pods\n//\n//  Created by Lobanov Dmitry on 12.02.17.\n//\n//\n\n#import \"JWTAlgorithmESBase.h\"\n#import <CommonCrypto/CommonCryptor.h>\nNSString *const JWTAlgorithmNameES256 = @\"ES256\";\nNSString *const JWTAlgorithmNameES384 = @\"ES384\";\nNSString *const JWTAlgorithmNameES512 = @\"ES512\";\n@interface JWTAlgorithmESBase ()\n\n@end\n@implementation JWTAlgorithmESBase\n@synthesize keyExtractorType;\n@synthesize signKey;\n@synthesize verifyKey;\n@end\n\n// thanks! https://github.com/soyersoyer/SwCrypt\n@interface JWTAlgorithmESBase (ImportKeys)\n- (void)importKey;\n//importKey(publicKey, format: .importKeyBinary, keyType: .keyPublic)\n@end\n@implementation JWTAlgorithmESBase (ImportKeys)\n- (void)importKey {\n    return;\n}\n@end\n\n@implementation JWTAlgorithmESBase (JWTAsymmetricKeysAlgorithm)\n- (NSString *)name {\n    return @\"ESBase\";\n}\n- (NSData *)signHash:(NSData *)hash key:(NSData *)key error:(NSError *__autoreleasing *)error {\n    return nil;\n}\n- (BOOL)verifyHash:(NSData *)hash signature:(NSData *)signature key:(NSData *)key error:(NSError *__autoreleasing *)error {\n    return NO;\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/Algorithms/HSFamily/JWTAlgorithmHSBase.m",
    "content": "//\n//  JWTAlgorithmHSBase.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 13.03.16.\n//  Copyright © 2016 Karma. All rights reserved.\n//\n\n#import \"JWTAlgorithmHSBase.h\"\n#import \"JWTBase64Coder.h\"\n#import <CommonCrypto/CommonCrypto.h>\n#import <CommonCrypto/CommonHMAC.h>\n\nNSString *const JWTAlgorithmNameHS256 = @\"HS256\";\nNSString *const JWTAlgorithmNameHS384 = @\"HS384\";\nNSString *const JWTAlgorithmNameHS512 = @\"HS512\";\n\n@interface JWTAlgorithmHSBase () @end\n\n@implementation JWTAlgorithmHSBase\n\n- (size_t)ccSHANumberDigestLength {\n    @throw [[NSException alloc] initWithName:NSInternalInconsistencyException reason:@\"ccSHANumberDigestLength property should be overriden\" userInfo:nil];\n}\n\n- (uint32_t)ccHmacAlgSHANumber {\n    @throw [[NSException alloc] initWithName:NSInternalInconsistencyException reason:@\"ccHmacAlgSHANumber property should be overriden\" userInfo:nil];\n}\n\n- (NSData *)signHash:(NSData *)hash key:(NSData *)key error:(NSError *__autoreleasing *)error {\n    size_t amount = self.ccSHANumberDigestLength;\n    size_t fullSize = amount * sizeof(unsigned char);\n    unsigned char* cHMAC = malloc(fullSize);\n    CCHmacAlgorithm ccAlg = self.ccHmacAlgSHANumber;\n    \n    CCHmac(ccAlg, key.bytes, key.length, hash.bytes, hash.length, cHMAC);\n    \n    NSData *result = [[NSData alloc] initWithBytes:cHMAC length:fullSize];\n    free(cHMAC);\n    return result;\n}\n\n- (BOOL)verifyHash:(NSData *)hash signature:(NSData *)signature key:(NSData *)key error:(NSError *__autoreleasing *)error {\n    NSData *expectedSignatureData = [self signHash:hash key:key error:error];\n    return [expectedSignatureData isEqualToData:signature];\n}\n\n- (NSString *)name {\n    return @\"HSBase\";\n}\n\n\n@end\n\n@interface JWTAlgorithmHSFamilyMember : JWTAlgorithmHSBase @end\n@implementation JWTAlgorithmHSFamilyMember @end\n\n@interface JWTAlgorithmHS256 : JWTAlgorithmHSBase @end\n@interface JWTAlgorithmHS384 : JWTAlgorithmHSBase @end\n@interface JWTAlgorithmHS512 : JWTAlgorithmHSBase @end\n\n@implementation JWTAlgorithmHS256\n\n- (size_t)ccSHANumberDigestLength {\n    return CC_SHA256_DIGEST_LENGTH;\n}\n\n- (uint32_t)ccHmacAlgSHANumber {\n    return kCCHmacAlgSHA256;\n}\n\n- (NSString *)name {\n    return @\"HS256\";\n}\n\n@end\n\n@implementation JWTAlgorithmHS384\n\n- (size_t)ccSHANumberDigestLength {\n    return CC_SHA384_DIGEST_LENGTH;\n}\n\n- (uint32_t)ccHmacAlgSHANumber {\n    return kCCHmacAlgSHA384;\n}\n\n- (NSString *)name {\n    return @\"HS384\";\n}\n\n@end\n\n@implementation JWTAlgorithmHS512\n\n- (size_t)ccSHANumberDigestLength {\n    return CC_SHA512_DIGEST_LENGTH;\n}\n\n- (uint32_t)ccHmacAlgSHANumber {\n    return kCCHmacAlgSHA512;\n}\n\n- (NSString *)name {\n    return @\"HS512\";\n}\n\n@end\n\n@interface JWTAlgorithmHSFamilyMemberMutable : JWTAlgorithmHSFamilyMember\n@property (assign, nonatomic, readwrite) size_t ccSHANumberDigestLength;\n@property (assign, nonatomic, readwrite) uint32_t ccHmacAlgSHANumber;\n@property (copy, nonatomic, readwrite) NSString *name;\n@end\n\n@implementation JWTAlgorithmHSFamilyMemberMutable\n\n@synthesize ccSHANumberDigestLength = _ccSHANumberDigestLength;\n@synthesize ccHmacAlgSHANumber = _ccHmacAlgSHANumber;\n@synthesize name = _name;\n\n- (size_t)ccSHANumberDigestLength {\n    return _ccSHANumberDigestLength;\n}\n\n- (uint32_t)ccHmacAlgSHANumber {\n    return _ccHmacAlgSHANumber;\n}\n\n@end\n\n@implementation JWTAlgorithmHSBase (Create)\n\n+ (instancetype)algorithm256 {\n    return [JWTAlgorithmHS256 new];\n}\n\n+ (instancetype)algorithm384 {\n    return [JWTAlgorithmHS384 new];\n}\n\n+ (instancetype)algorithm512 {\n    return [JWTAlgorithmHS512 new];\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/Algorithms/Holders/JWTAlgorithmDataHolder+FluentStyle.m",
    "content": "//\n//  JWTAlgorithmDataHolder+FluentStyle.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 07/06/2019.\n//  Copyright © 2019 JWTIO. All rights reserved.\n//\n\n#import \"JWTAlgorithmDataHolder+FluentStyle.h\"\n\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wobjc-property-implementation\"\n@implementation JWTAlgorithmBaseDataHolder (FluentStyle)\n@end\n\n@implementation JWTAlgorithmRSFamilyDataHolder (FluentStyle)\n@end\n#pragma clang diagnostic pop\n"
  },
  {
    "path": "Sources/JWT/Algorithms/Holders/JWTAlgorithmDataHolder.m",
    "content": "//\n//  JWTAlgorithmDataHolder.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 31.08.16.\n//  Copyright © 2016 Karma. All rights reserved.\n//\n\n#import \"JWTAlgorithmDataHolder.h\"\n#import \"JWTAlgorithmFactory.h\"\n#import \"JWTAlgorithmNone.h\"\n#import \"JWTRSAlgorithm.h\"\n#import \"JWTAlgorithmHSBase.h\"\n#import \"JWTAlgorithmRSBase.h\"\n#import \"JWTBase64Coder.h\"\n#import \"JWTCryptoKey.h\"\n\n@interface JWTAlgorithmBaseDataHolder()\n// not needed by algorithm adoption.\n// @property (copy, nonatomic, readwrite) NSData *internalSecretData;\n// @property (strong, nonatomic, readwrite) id <JWTAlgorithm> internalAlgorithm;\n\n#pragma mark - Setters\n/**\n Sets jwtSecret and returns the JWTAlgorithmBaseDataHolder to allow for method chaining\n */\n@property (copy, nonatomic, readwrite) JWTAlgorithmBaseDataHolder *(^secret)(NSString *secret);\n\n/**\n Sets jwtSecretData and returns the JWTAlgorithmBaseDataHolder to allow for method chaining\n */\n@property (copy, nonatomic, readwrite) JWTAlgorithmBaseDataHolder *(^secretData)(NSData *secretData);\n\n/**\n Sets jwtAlgorithm and returns the JWTAlgorithmBaseDataHolder to allow for method chaining\n */\n@property (copy, nonatomic, readwrite) JWTAlgorithmBaseDataHolder *(^algorithm)(id<JWTAlgorithm>algorithm);\n\n/**\n Sets jwtAlgorithmName and returns the JWTAlgorithmBaseDataHolder to allow for method chaining. See list of names in appropriate headers.\n */\n@property (copy, nonatomic, readwrite) JWTAlgorithmBaseDataHolder *(^algorithmName)(NSString *algorithmName);\n\n/**\n Sets stringCoder and returns the JWTAlgorithmBaseDataHolder to allow for method chaining. See list of names in appropriate headers.\n */\n@property (copy, nonatomic, readwrite) JWTAlgorithmBaseDataHolder *(^stringCoder)(id<JWTStringCoderProtocol> stringCoder);\n@end\n\n@interface JWTAlgorithmBaseDataHolder (Convertions)\n\n- (NSData *)dataFromString:(NSString *)string;\n- (NSString *)stringFromData:(NSData *)data;\n\n@end\n\n@implementation JWTAlgorithmBaseDataHolder (Convertions)\n#pragma mark - Convertions\n- (NSData *)dataFromString:(NSString *)string {\n    NSData *result = [self.internalStringCoder dataWithString:string];\n\n    if (result == nil) {\n        // tell about it?!\n        NSLog(@\"%@ %@ something went wrong. Data is not base64encoded! %@\", self.debugDescription, NSStringFromSelector(_cmd), string);\n    }\n\n    return result;// ?: [string dataUsingEncoding:NSUTF8StringEncoding];\n}\n\n- (NSString *)stringFromData:(NSData *)data {\n    NSString *result = [self.internalStringCoder stringWithData:data];\n\n    if (result == nil) {\n        NSLog(@\"%@ %@ something went wrong. String is not base64encoded\", self.debugDescription, NSStringFromSelector(_cmd));\n    }\n    return result ?: [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];\n}\n@end\n\n@interface JWTAlgorithmBaseDataHolder (Fluent)\n- (void)setupFluent;\n@end\n\n@implementation JWTAlgorithmBaseDataHolder (Fluent)\n#pragma mark - Fluent\n- (void)setupFluent {\n    __weak typeof(self) weakSelf = self;\n    self.secret = ^(NSString *secret) {\n        return [weakSelf secret:secret];\n    };\n\n    self.secretData = ^(NSData *secretData) {\n        return [weakSelf secretData:secretData];\n    };\n\n    self.algorithm = ^(id<JWTAlgorithm> algorithm) {\n        return [weakSelf algorithm:algorithm];\n    };\n\n    self.algorithmName = ^(NSString *algorithmName) {\n        return [weakSelf algorithmName:algorithmName];\n    };\n\n    self.stringCoder = ^(id <JWTStringCoderProtocol> stringCoder) {\n        return [weakSelf stringCoder:stringCoder];\n    };\n}\n@end\n\n@interface JWTAlgorithmBaseDataHolder (Debug)\n- (NSDictionary *)debugInformation;\n@end\n@implementation JWTAlgorithmBaseDataHolder (Debug)\n- (NSString *)debugDescription {\n    return [[self debugInformation] debugDescription];\n}\n- (NSDictionary *)debugInformation {\n    return @{\n             @\"algorithmName\" : self.internalAlgorithmName ?: @\"unknown\",\n             @\"algorithm\" : [self.internalAlgorithm debugDescription] ?: @\"unknown\",\n             @\"secretData\" : [self.internalSecretData debugDescription] ?: @\"unknown\",\n             @\"stringCoder\" : [self.internalStringCoder debugDescription] ?: @\"unknown\"\n             };\n}\n\n@end\n\n@implementation JWTAlgorithmBaseDataHolder\n@synthesize internalAlgorithm;\n@synthesize internalSecretData;\n@synthesize internalStringCoder = _internalStringCoder;\n\n- (id<JWTStringCoderProtocol>)internalStringCoder {\n    return _internalStringCoder ?: [JWTBase64Coder new];\n}\n\n#pragma mark - Custom Getters\n- (NSString *)internalAlgorithmName {\n    return [self.internalAlgorithm name];\n}\n\n- (NSString *)internalSecret {\n    return [self stringFromData:self.internalSecretData];\n}\n\n- (instancetype)init {\n    self = [super init];\n    if (self) {\n        [self setupFluent];\n    }\n    return self;\n}\n\n#pragma mark - Copy\n- (id)copyWithZone:(NSZone *)zone {\n    JWTAlgorithmBaseDataHolder *holder = [self.class new];\n    holder.internalAlgorithm = self.internalAlgorithm;\n    holder.internalSecretData = self.internalSecretData;\n    holder.internalStringCoder = self.internalStringCoder;\n    return holder;\n}\n@end\n\n@implementation JWTAlgorithmBaseDataHolder (Setters)\n- (instancetype)secretData:(NSData *)secretData {\n    self.internalSecretData = secretData;\n    return self;\n}\n\n- (instancetype)secret:(NSString *)secret {\n    self.internalSecretData = [self dataFromString:secret];\n    return self;\n}\n\n- (instancetype)algorithm:(id<JWTAlgorithm>)algorithm {\n    self.internalAlgorithm = algorithm;\n    return self;\n}\n\n- (instancetype)algorithmName:(NSString *)algorithmName {\n    self.internalAlgorithm = [JWTAlgorithmFactory algorithmByName:algorithmName];\n    return self;\n}\n\n- (instancetype)stringCoder:(id<JWTStringCoderProtocol>)stringCoder {\n    self.internalStringCoder = stringCoder;\n    return self;\n}\n@end\n\n@interface JWTAlgorithmBaseDataHolder (Create)\n- (instancetype)initWithAlgorithmName:(NSString *)name;\n@end\n\n@implementation JWTAlgorithmBaseDataHolder (Create)\n- (instancetype)initWithAlgorithmName:(NSString *)name {\n    return [self init].algorithmName(name);\n}\n@end\n\n@implementation JWTAlgorithmNoneDataHolder\n- (instancetype)init {\n    if (self = [super init]) {\n        self.internalAlgorithm = [JWTAlgorithmFactory algorithmByName:JWTAlgorithmNameNone];\n        self.internalSecretData = nil;\n    }\n    return self;\n}\n@end\n\n@implementation JWTAlgorithmHSFamilyDataHolder\n+ (instancetype)createWithAlgorithm256 {\n    return [[self alloc] initWithAlgorithmName:JWTAlgorithmNameHS256];\n}\n+ (instancetype)createWithAlgorithm384 {\n    return [[self alloc] initWithAlgorithmName:JWTAlgorithmNameHS384];\n}\n+ (instancetype)createWithAlgorithm512 {\n    return [[self alloc] initWithAlgorithmName:JWTAlgorithmNameHS512];\n}\n@end\n\n@interface JWTAlgorithmRSFamilyDataHolder()\n#pragma mark - Getters\n@property (copy, nonatomic, readwrite) NSString *internalPrivateKeyCertificatePassphrase;\n@property (copy, nonatomic, readwrite) NSString *internalKeyExtractorType;\n@property (strong, nonatomic, readwrite) id<JWTCryptoKeyProtocol> internalSignKey;\n@property (strong, nonatomic, readwrite) id<JWTCryptoKeyProtocol> internalVerifyKey;\n#pragma mark - Setters\n@property (copy, nonatomic, readwrite) JWTAlgorithmRSFamilyDataHolder *(^privateKeyCertificatePassphrase)(NSString *privateKeyCertificatePassphrase);\n@property (copy, nonatomic, readwrite) JWTAlgorithmRSFamilyDataHolder *(^keyExtractorType)(NSString *keyExtractorType);\n@property (copy, nonatomic, readwrite) JWTAlgorithmRSFamilyDataHolder *(^signKey)(id<JWTCryptoKeyProtocol> signKey);\n@property (copy, nonatomic, readwrite) JWTAlgorithmRSFamilyDataHolder *(^verifyKey)(id<JWTCryptoKeyProtocol> verifyKey);\n@end\n\n@implementation JWTAlgorithmRSFamilyDataHolder (Debug)\n- (NSDictionary *)debugInformation {\n    NSDictionary *add = @{@\"privateKeyCertificatePassphrase\" : self.internalPrivateKeyCertificatePassphrase ?: @\"unknown\",\n                          @\"keyExtractorType\" : self.internalKeyExtractorType ?: @\"unknown\",\n                          @\"signKey\" : [self.internalSignKey debugDescription] ?: @\"unknown\",\n                          @\"verifyKey\" : [self.internalVerifyKey debugDescription] ?: @\"unknown\"\n                          };\n    NSMutableDictionary *result = [[super debugInformation] mutableCopy];\n    [result addEntriesFromDictionary:add];\n    return result;\n}\n@end\n\n@implementation JWTAlgorithmRSFamilyDataHolder\n\n#pragma mark - Initialization\n- (instancetype)init {\n    return (typeof(self))[super init].stringCoder([JWTBase64Coder withBase64String]);\n}\n\n+ (instancetype)createWithAlgorithm256 {\n    return [[self alloc] initWithAlgorithmName:JWTAlgorithmNameRS256];\n}\n\n+ (instancetype)createWithAlgorithm384 {\n    return [[self alloc] initWithAlgorithmName:JWTAlgorithmNameRS384];\n}\n\n+ (instancetype)createWithAlgorithm512 {\n    return [[self alloc] initWithAlgorithmName:JWTAlgorithmNameRS512];\n}\n\n#pragma mark - Getters\n- (id<JWTAlgorithm>)internalAlgorithm {\n    id <JWTAlgorithm> algorithm = [super internalAlgorithm];\n    if ([algorithm conformsToProtocol:@protocol(JWTRSAlgorithm)]) {\n        // copy?\n        id<JWTRSAlgorithm>currentAlgorithm = [(id <JWTRSAlgorithm>)algorithm copyWithZone:nil];\n        currentAlgorithm.privateKeyCertificatePassphrase = self.internalPrivateKeyCertificatePassphrase;\n        currentAlgorithm.keyExtractorType = self.internalKeyExtractorType;\n        currentAlgorithm.signKey = self.internalSignKey;\n        currentAlgorithm.verifyKey = self.internalVerifyKey;\n        algorithm = currentAlgorithm;\n    }\n    return algorithm;\n}\n\n#pragma mark - Copy\n- (id)copyWithZone:(NSZone *)zone {\n    JWTAlgorithmRSFamilyDataHolder *holder = [super copyWithZone:zone];\n    holder.internalPrivateKeyCertificatePassphrase = self.internalPrivateKeyCertificatePassphrase;\n    holder.internalKeyExtractorType = self.internalKeyExtractorType;\n    holder.internalSignKey = self.internalSignKey;\n    holder.internalVerifyKey = self.internalVerifyKey;\n    return holder;\n}\n@end\n\n@implementation JWTAlgorithmRSFamilyDataHolder (Fluent)\n- (void)setupFluent {\n    [super setupFluent];\n    __weak typeof(self) weakSelf = self;\n    self.privateKeyCertificatePassphrase = ^(NSString *privateKeyCertificatePassphrase) {\n        return [weakSelf privateKeyCertificatePassphrase:privateKeyCertificatePassphrase];\n    };\n    self.keyExtractorType = ^(NSString *keyExtractorType) {\n        return [weakSelf keyExtractorType:keyExtractorType];\n    };\n    self.signKey = ^(id<JWTCryptoKeyProtocol> key){\n        return [weakSelf signKey:key];\n    };\n    self.verifyKey = ^(id<JWTCryptoKeyProtocol> key){\n        return [weakSelf verifyKey:key];\n    };\n}\n@end\n\n@implementation JWTAlgorithmRSFamilyDataHolder (Setters)\n- (instancetype)privateKeyCertificatePassphrase:(NSString *)passphrase {\n    self.internalPrivateKeyCertificatePassphrase = passphrase;\n    return self;\n}\n- (instancetype)keyExtractorType:(NSString *)type {\n    self.internalKeyExtractorType = type;\n    return self;\n}\n- (instancetype)signKey:(id<JWTCryptoKeyProtocol>)key {\n    self.internalSignKey = key;\n    return self;\n}\n- (instancetype)verifyKey:(id<JWTCryptoKeyProtocol>)key {\n    self.internalVerifyKey = key;\n    return self;\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/Algorithms/Holders/JWTAlgorithmDataHolderChain.m",
    "content": "//\n//  JWTAlgorithmDataHolderChain.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 02.10.16.\n//  Copyright © 2016 Karma. All rights reserved.\n//\n\n#import \"JWTAlgorithmDataHolderChain.h\"\n\n@interface JWTAlgorithmDataHolderChain()\n\n@property (strong, nonatomic, readwrite) NSArray *holders;\n\n@end\n\n@implementation JWTAlgorithmDataHolderChain\n\n- (NSArray *)holders {\n    if (!_holders) {\n        _holders = @[];\n    }\n    return _holders;\n}\n\n#pragma mark - Initialization\n- (instancetype)initWithHolders:(NSArray *)holders {\n    self = [super init];\n    if (holders) {\n        // check that holders conform to protocol\n        NSArray *checkedHolders = [holders filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id  _Nullable evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) {\n            return [evaluatedObject conformsToProtocol:@protocol(JWTAlgorithmDataHolderProtocol)];\n        }]];\n        self.holders = checkedHolders;\n    }\n    return self;\n}\n\n- (instancetype)initWithHolder:(id<JWTAlgorithmDataHolderProtocol>)holder {\n    if (holder) {\n        return [self initWithHolders:@[holder]];\n    }\n    return nil;\n}\n\n#pragma mark - Appending\n- (instancetype)chainByAppendingChain:(JWTAlgorithmDataHolderChain *)chain {\n    NSArray *holders = self.holders;\n    if (chain) {\n        holders = [holders arrayByAddingObjectsFromArray:chain.holders];\n    }\n    return [[self.class alloc] initWithHolders:holders];\n}\n\n- (instancetype)chainByAppendingHolders:(NSArray *)holders {\n    // create new chain with holders\n    JWTAlgorithmDataHolderChain *chain = nil;\n    if (holders) {\n        chain = [[self.class alloc] initWithHolders:holders];\n    }\n    return [self chainByAppendingChain:chain];\n}\n\n- (instancetype)chainByAppendingHolder:(id<JWTAlgorithmDataHolderProtocol>)holder {\n    return [self chainByAppendingHolders:holder ? @[holder] : nil];\n}\n\n#pragma mark - Create\n+ (instancetype)chainWithHolders:(NSArray *)holders {\n    return [[self new] chainByAppendingHolders:holders];\n}\n\n+ (instancetype)chainWithHolder:(id<JWTAlgorithmDataHolderProtocol>)holder {\n    return [[self new] chainByAppendingHolder:holder];\n}\n\n#pragma mark - Debug\n- (NSString *)debugDescription {\n    return [NSString stringWithFormat:@\"%@ holders: %@\", self.class, [self.holders valueForKey:@\"debugDescription\"]];\n}\n@end\n\n@implementation JWTAlgorithmDataHolderChain (Convenient)\n- (id<JWTAlgorithmDataHolderProtocol>)firstHolderByAlgorithm:(id<JWTAlgorithm>)algorithm {\n    NSInteger index = [self.holders indexOfObjectPassingTest:^BOOL(id <JWTAlgorithmDataHolderProtocol> _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {\n        return [[[obj internalAlgorithm] name] isEqualToString:[algorithm name]];\n    }];\n    if (index != NSNotFound) {\n        return self.holders[index];\n    }\n\n    return nil;\n}\n- (id<JWTAlgorithmDataHolderProtocol>)firstHolderBySecretData:(NSData *)secretData {\n    NSInteger index = [self.holders indexOfObjectPassingTest:^BOOL(id <JWTAlgorithmDataHolderProtocol> _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {\n        return [[obj internalSecretData] isEqualToData:secretData];\n    }];\n    if (index != NSNotFound) {\n        return self.holders[index];\n    }\n\n    return nil;\n}\n- (NSArray *)singleAlgorithm:(id<JWTAlgorithm>)algorithm withManySecretData:(NSArray *)secretsData {\n    NSArray *holders = @[];\n\n    id holder = [self firstHolderByAlgorithm:algorithm];\n\n    if (!holder) {\n        return holders;\n    }\n\n    for (NSData *secretData in secretsData) {\n        id<JWTAlgorithmDataHolderProtocol> newHolder = [holder copy];\n        [newHolder setInternalSecretData:secretData];\n        holders = [holders arrayByAddingObject:newHolder];\n    }\n    return holders;\n}\n\n- (NSArray *)singleSecretData:(NSData *)secretData withManyAlgorithms:(NSArray *)algorithms {\n    NSArray *holders = @[];\n\n    id holder = [self firstHolderBySecretData:secretData];\n\n    if (!holder) {\n        return holders;\n    }\n\n    for (id<JWTAlgorithm>algorithm in algorithms) {\n        id<JWTAlgorithmDataHolderProtocol> newHolder = [holder copy];\n        [newHolder setInternalAlgorithm:algorithm];\n        [holders arrayByAddingObject:newHolder];\n    }\n    return holders;\n}\n\n- (instancetype)chainByPopulatingAlgorithm:(id<JWTAlgorithm>)algorithm withManySecretData:(NSArray *)secretsData {\n    return [[self.class alloc] initWithHolders:[self singleAlgorithm:algorithm withManySecretData:secretsData]];\n}\n\n- (instancetype)chainByPopulatingSecretData:(NSData *)secretData withManyAlgorithms:(NSArray *)algorithms {\n    return [[self.class alloc] initWithHolders:[self singleSecretData:secretData withManyAlgorithms:algorithms]];\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/Algorithms/RSFamily/JWTAlgorithmRSBase.m",
    "content": "//\n//  JWTAlgorithmRSBase.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 13.03.16.\n//  Copyright © 2016 Karma. All rights reserved.\n//\n\n#import \"JWTAlgorithmRSBase.h\"\n#import \"JWTBase64Coder.h\"\n#import \"JWTCryptoSecurity.h\"\n#import \"JWTCryptoKeyExtractor.h\"\n#import \"JWTCryptoKey.h\"\n#import \"JWTAlgorithmFactory.h\"\n#import <CommonCrypto/CommonCrypto.h>\n\n#import \"JWTAlgorithmErrorDescription+Subclass.h\"\nNSString *const JWTAlgorithmRSFamilyErrorDomain = @\"io.jwt.jwa.rs\";\n\n@implementation JWTAlgorithmRSFamilyErrorDescription\n#pragma mark - Subclass\n+ (NSString *)errorDomain {\n    return JWTAlgorithmRSFamilyErrorDomain;\n}\n+ (NSInteger)defaultErrorCode {\n    return JWTAlgorithmRSFamilyErrorUnexpected;\n}\n+ (NSInteger)externalErrorCode {\n    return JWTAlgorithmRSFamilyErrorInternalSecurityAPI;\n}\n+ (NSDictionary *)codesAndUserDescriptions {\n    static NSDictionary *dictionary = nil;\n    static dispatch_once_t onceToken;\n    dispatch_once(&onceToken, ^{\n        dictionary = @{\n                       @(JWTAlgorithmRSFamilyErrorIncorrectHashComputation) : @\"RS algorithm incorrect hash computation!\",\n                       @(JWTAlgorithmRSFamilyErrorIncorrectKeySize) : @\"RS algorithm incorrect key size. Apple have not sent any response about it.\",\n                       @(JWTAlgorithmRSFamilyErrorInternalSecurityAPI) : @\"RS algorithm internal security framework error.\",\n                       @(JWTAlgorithmRSFamilyErrorUnexpected) : @\"RS algorithm unexpected error!\"\n                       };\n    });\n    return dictionary;\n}\n+ (NSDictionary *)codesAndDescriptions {\n    static NSDictionary *dictionary = nil;\n    static dispatch_once_t onceToken;\n    dispatch_once(&onceToken, ^{\n        dictionary = @{\n                       @(JWTAlgorithmRSFamilyErrorIncorrectHashComputation) : @\"JWTAlgorithmRSFamilyErrorIncorrectHashComputation\",\n                       @(JWTAlgorithmRSFamilyErrorIncorrectKeySize) : @\"JWTAlgorithmRSFamilyErrorIncorrectKeySize\",\n                       @(JWTAlgorithmRSFamilyErrorInternalSecurityAPI) : @\"JWTAlgorithmRSFamilyErrorInternalSecurityAPI\",\n                       @(JWTAlgorithmRSFamilyErrorUnexpected) : @\"JWTAlgorithmRSFamilyErrorUnexpected\"\n                       };\n    });\n    return dictionary;\n}\n@end\n\n/*\n*    * Possible inheritence *\n*\n*\n*             RSBase (Public + Create-category)\n*            /      \\\n*           /        \\\n*  RSBaseMac          RSBaseIOS\n*           \\  ifdef /\n*            \\      /\n*         RSFamilyMember\n*                |\n*         RSFamilyMemberMutable\n*\n*/\n\nNSString *const JWTAlgorithmNameRS256 = @\"RS256\";\nNSString *const JWTAlgorithmNameRS384 = @\"RS384\";\nNSString *const JWTAlgorithmNameRS512 = @\"RS512\";\n\n@interface JWTAlgorithmRSBase()\n@property (nonatomic, readonly) id <JWTCryptoKeyExtractorProtocol> keyExtractor;\n@end\n\n@implementation JWTAlgorithmRSBase\n\n#pragma mark - NSCopying\n- (id)copyWithZone:(NSZone *)zone {\n    // create new.\n    id <JWTRSAlgorithm> algorithm = (id<JWTRSAlgorithm>)[JWTAlgorithmFactory algorithmByName:[self name]];\n    algorithm.privateKeyCertificatePassphrase = self.privateKeyCertificatePassphrase;\n    algorithm.keyExtractorType = self.keyExtractorType;\n    algorithm.signKey = self.signKey;\n    algorithm.verifyKey = self.verifyKey;\n    return algorithm;\n}\n\n@synthesize privateKeyCertificatePassphrase;\n@synthesize keyExtractorType;\n@synthesize signKey;\n@synthesize verifyKey;\n- (id<JWTCryptoKeyExtractorProtocol>) keyExtractor {\n    return [JWTCryptoKeyExtractor createWithType:self.keyExtractorType];\n}\n#pragma mark - Override\n- (size_t)ccSHANumberDigestLength {\n    @throw [[NSException alloc] initWithName:NSInternalInconsistencyException reason:@\"ccSHANumberDigestLength property should be overriden\" userInfo:nil];\n}\n\n- (uint32_t)secPaddingPKCS1SHANumber {\n    @throw [[NSException alloc] initWithName:NSInternalInconsistencyException reason:@\"secPaddingPKCS1SHANumber property should be overriden\" userInfo:nil];\n}\n\n- (unsigned char *)CC_SHANumberWithData:(const void *)data withLength:(CC_LONG)len withHashBytes:(unsigned char *)hashBytes {\n    return nil;\n}\n\n- (NSString *)name {\n    return @\"RSBase\";\n}\n\n#pragma mark - JWTAlgorithm\n- (NSDictionary *)verifyKeyExtractorParameters {\n    return @{[JWTCryptoKey parametersKeyBuilder] : [JWTCryptoKeyBuilder new].keyTypeRSA};\n}\n- (NSDictionary *)signKeyExtractorParameters {\n    NSMutableDictionary *mutableDictionary = [[self verifyKeyExtractorParameters] mutableCopy];\n    mutableDictionary[[JWTCryptoKeyExtractor parametersKeyCertificatePassphrase]] = self.privateKeyCertificatePassphrase ?: [NSNull null];\n    return [mutableDictionary copy];\n}\n\n- (BOOL)removeKeyItem:(id<JWTCryptoKeyProtocol>)item error:(NSError *__autoreleasing *)error {\n    NSError *theError = nil;\n    [JWTCryptoSecurity removeKeyByTag:item.tag error:&theError];\n    if (error) {\n        *error = theError;\n    }\n    return theError == nil;\n}\n\n- (NSData *)signHash:(NSData *)hash key:(NSData *)key error:(NSError *__autoreleasing *)error {\n    id<JWTCryptoKeyExtractorProtocol> theExtractor = self.keyExtractor ?: [JWTCryptoKeyExtractor privateKeyInP12];\n    NSError *extractKeyError = nil;\n    id <JWTCryptoKeyProtocol> keyItem = self.signKey ?: [theExtractor keyFromData:key parameters:[self signKeyExtractorParameters] error:&extractKeyError];\n    \n    if (extractKeyError || keyItem == nil) {\n        // tell about error\n        if (extractKeyError && error) {\n            *error = extractKeyError;\n        }\n        NSError *removeError = nil;\n        [self removeKeyItem:keyItem error:&removeError];\n        return nil;\n    }\n    else {\n        NSError *signError = nil;\n        NSData *result = [self signData:hash key:keyItem.key error:&signError];\n        if (signError && error) {\n            *error = signError;\n        }\n        return result;\n    }\n}\n- (BOOL)verifyHash:(NSData *)hash signature:(NSData *)signature key:(NSData *)key error:(NSError *__autoreleasing *)error {\n    id<JWTCryptoKeyExtractorProtocol> theExtractor = self.keyExtractor ?: [JWTCryptoKeyExtractor publicKeyWithCertificate];\n    NSError *extractKeyError = nil;\n    id<JWTCryptoKeyProtocol> keyItem = self.verifyKey ?: [theExtractor keyFromData:key parameters:[self verifyKeyExtractorParameters] error:&extractKeyError];\n    if (extractKeyError || keyItem == nil) {\n        if (extractKeyError && error) {\n            *error = extractKeyError;\n        }\n        NSError *removeError = nil;\n        [self removeKeyItem:keyItem error:&removeError];\n        return NO;\n    }\n    else {\n        NSError *verifyError = nil;\n        BOOL verified = [self verifyData:hash signature:signature key:keyItem.key error:&verifyError];\n        if (verifyError && error) {\n            *error = verifyError;\n        }\n        NSError *removeError = nil;\n        [self removeKeyItem:keyItem error:&removeError];\n        return verified;\n    }\n}\n\n#pragma mark - Private ( Override-part depends on platform )\n- (BOOL)verifyData:(NSData *)plainData signature:(NSData *)signature key:(SecKeyRef)publicKey error:(NSError *__autoreleasing*)error {\n    return NO;\n}\n\n- (NSData *)signData:(NSData *)plainData key:(SecKeyRef)privateKey error:(NSError *__autoreleasing*)error {\n    return nil;\n}\n@end\n\n#if TARGET_OS_MAC && TARGET_OS_IPHONE\n@interface JWTAlgorithmRSBaseIOS : JWTAlgorithmRSBase @end\n@implementation JWTAlgorithmRSBaseIOS\n- (BOOL)verifyData:(NSData *)plainData signature:(NSData *)signature key:(SecKeyRef)publicKey error:(NSError *__autoreleasing *)error {\n    size_t signedHashBytesSize = SecKeyGetBlockSize(publicKey);\n    const void* signedHashBytes = [signature bytes];\n\n    size_t hashBytesSize = self.ccSHANumberDigestLength;\n    uint8_t* hashBytes = malloc(hashBytesSize);\n    if (![self CC_SHANumberWithData:[plainData bytes] withLength:(CC_LONG)[plainData length] withHashBytes:hashBytes]) {\n        if (error) {\n            *error = [JWTAlgorithmRSFamilyErrorDescription errorWithCode:JWTAlgorithmRSFamilyErrorIncorrectHashComputation];\n        }\n        return false;\n    }\n\n    OSStatus status = SecKeyRawVerify(publicKey,\n                                      self.secPaddingPKCS1SHANumber,\n                                      hashBytes,\n                                      hashBytesSize,\n                                      signedHashBytes,\n                                      signedHashBytesSize);\n\n    return status == errSecSuccess;\n}\n\n- (NSData *)signData:(NSData *)plainData key:(SecKeyRef)privateKey error:(NSError *__autoreleasing *)error {\n    size_t signedHashBytesSize = SecKeyGetBlockSize(privateKey);\n    uint8_t* signedHashBytes = malloc(signedHashBytesSize);\n    memset(signedHashBytes, 0x0, signedHashBytesSize);\n\n    size_t hashBytesSize = self.ccSHANumberDigestLength;\n    uint8_t* hashBytes = malloc(hashBytesSize);\n\n    // ([plainData bytes], (CC_LONG)[plainData length], hashBytes)\n    unsigned char *str = [self CC_SHANumberWithData:[plainData bytes] withLength:(CC_LONG)[plainData length] withHashBytes:hashBytes];\n\n    if (!str) {\n        if (error) {\n            *error = [JWTAlgorithmRSFamilyErrorDescription errorWithCode:JWTAlgorithmRSFamilyErrorIncorrectHashComputation];\n        }\n        return nil;\n    }\n\n    SecKeyRawSign(privateKey,\n                  self.secPaddingPKCS1SHANumber,\n                  hashBytes,\n                  hashBytesSize,\n                  signedHashBytes,\n                  &signedHashBytesSize);\n\n    NSData* signedHash = [NSData dataWithBytes:signedHashBytes\n                                        length:(NSUInteger)signedHashBytesSize];\n\n    if (hashBytes) {\n        free(hashBytes);\n    }\n\n    if (signedHashBytes) {\n        free(signedHashBytes);\n    }\n\n    return signedHash;\n}\n@end\n#endif\n\n#if TARGET_OS_MAC && !TARGET_OS_IPHONE\n@interface JWTAlgorithmRSBaseMac : JWTAlgorithmRSBase\n- (BOOL)checkKeyConsistency:(SecKeyRef)key;\n@end\n\n@implementation JWTAlgorithmRSBaseMac\n\n- (BOOL)checkKeyConsistency:(SecKeyRef)key {\n    size_t keyLength = SecKeyGetBlockSize(key);\n    size_t hashBytesSize = self.ccSHANumberDigestLength;\n    Byte bitsPerByte = /*???*/sizeof(Byte) * CHAR_BIT;\n    return keyLength == hashBytesSize * bitsPerByte;\n}\n\n- (NSData *)executeTransform:(SecTransformRef)transform withInput:(NSData *)input withDigestType:(CFStringRef)type withDigestLength:(NSNumber *)length withFalseResult:(CFTypeRef)falseResultRef {\n    CFErrorRef errorRef = NULL;\n\n    CFTypeRef resultRef = NULL;\n    \n    // inout\n    NSData *resultData = nil;\n\n\n    BOOL success = transform != NULL;\n    //TODO: after import algorithm by pem, this code seems not working well.\n    //error: Error Domain=com.apple.security.transforms.error Code=6 \"Invalid digest algorithm for RSA signature, choose one of: SHA1, SHA2 (512bits, 348bits, 256bits, or 224 bits), MD2, or MD5\"\n    //TODO: add error inout parameter to this method.\n    if (success) {\n        // setup digest type\n        success = SecTransformSetAttribute(transform, kSecDigestTypeAttribute, type, &errorRef);\n    }\n\n    if (success) {\n        // digest length\n        success = SecTransformSetAttribute(transform, kSecDigestLengthAttribute, (__bridge CFNumberRef)length, &errorRef);\n    }\n\n    if (success) {\n        // set input\n        success = SecTransformSetAttribute(transform, kSecTransformInputAttributeName, (__bridge CFDataRef)input, &errorRef);\n    }\n\n    if (success) {\n        // execute\n        resultRef = SecTransformExecute(transform, &errorRef);\n        success = (resultRef != falseResultRef);\n    }\n\n    BOOL positiveResult = success; // resultRef != falseResultRef\n\n    // error\n    if (errorRef != NULL) {\n        NSLog(@\"%@ error: %@\", self.debugDescription, (__bridge NSError *)errorRef);\n    }\n    else {\n        if (positiveResult) {\n            resultData = (__bridge NSData *)resultRef;\n        }\n    }\n\n    if (resultRef != NULL) {\n        CFRelease(resultRef);\n    }\n    \n    if (errorRef != NULL) {\n        CFRelease(errorRef);\n    }\n\n    return resultData;\n}\n- (BOOL)verifyData:(NSData *)plainData signature:(NSData *)signature key:(SecKeyRef)publicKey error:(NSError *__autoreleasing *)error {\n\n    size_t signedHashBytesSize = SecKeyGetBlockSize(publicKey);\n    //const void* signedHashBytes = [signature bytes];\n\n    size_t hashBytesSize = self.ccSHANumberDigestLength;\n    uint8_t* hashBytes = malloc(hashBytesSize);\n    Byte bitsPerByte = /*???*/sizeof(Byte) * CHAR_BIT;\n//    NSNumber *plainDataLength = @((CC_LONG)[plainData length]);\n    \n    if (![self checkKeyConsistency:publicKey]) {\n        // error in log!\n        // bug?\n        NSLog(@\"the size of key(%@) should be related to SHA length in bits(%@)\", @(signedHashBytesSize), @(hashBytesSize * bitsPerByte));\n        if (error) {\n            *error = [JWTAlgorithmRSFamilyErrorDescription errorWithCode:JWTAlgorithmRSFamilyErrorIncorrectKeySize];\n        }\n        return NO;\n    }\n    \n    if (![self CC_SHANumberWithData:[plainData bytes] withLength:(CC_LONG)[plainData length] withHashBytes:hashBytes]) {\n        if (error) {\n            *error = [JWTAlgorithmRSFamilyErrorDescription errorWithCode:JWTAlgorithmRSFamilyErrorIncorrectHashComputation];\n        }\n        return NO;\n    }\n\n//    NSString *formattedString = [NSString stringWithFormat:@\"%@: %@ \\n %@: %@ \\n %@: %@\", @\"hashBytesSize\", @(hashBytesSize), @\"plainDataLength\", plainDataLength, @\"signedHashBytesSize\", @(signedHashBytesSize)];\n//\n//    NSLog(@\"%@ %@\", self.debugDescription, formattedString);\n    // verify for iOS\n//    OSStatus status = SecKeyRawVerify(publicKey,\n//                                      self.secPaddingPKCS1SHANumber,\n//                                      hashBytes,\n//                                      hashBytesSize,\n//                                      signedHashBytes,\n//                                      signedHashBytesSize);\n//    return status == errSecSuccess;\n    \n    CFErrorRef errorRef = NULL;\n    SecTransformRef transform = SecVerifyTransformCreate(publicKey, (__bridge CFDataRef)signature, &errorRef);\n\n    // verification. false result is kCFBooleanFalse\n    BOOL result = [self executeTransform:transform withInput:plainData withDigestType:kSecDigestSHA2 withDigestLength:@(signedHashBytesSize) withFalseResult:kCFBooleanFalse] != nil;\n\n    if (transform != NULL) {\n        // TODO: WTF?\n        // somehow it stops there :/\n        // Is it a race condition with removeSecKeyForTag?\n        // don't know :(\n        CFRelease(transform);\n    }\n    \n    if (errorRef != NULL) {\n        CFRelease(errorRef);\n    }\n    \n    if (hashBytes != NULL) {\n        free(hashBytes);\n    }\n\n    return result;\n}\n\n- (NSData *)signData:(NSData *)plainData key:(SecKeyRef)privateKey error:(NSError *__autoreleasing *)error {\n    size_t signedHashBytesSize = SecKeyGetBlockSize(privateKey);\n    //uint8_t* signedHashBytes = malloc(signedHashBytesSize);\n    //memset(signedHashBytes, 0x0, signedHashBytesSize);\n\n    size_t hashBytesSize = self.ccSHANumberDigestLength;\n    uint8_t* hashBytes = malloc(hashBytesSize);\n\n    /**\n     for sha256\n     CC_SHANumberWithData() is CC_SHA256()\n     self.secPaddingPKCS1SHANumber = kSecPaddingPKCS1SHA256\n     self.ccSHANumberDigestLength  = CC_SHA256_DIGEST_LENGTH\n     */\n\n    unsigned char *str = [self CC_SHANumberWithData:[plainData bytes] withLength:(CC_LONG)[plainData length] withHashBytes:hashBytes];\n\n    if (!str) {\n        if (error) {\n            *error = [JWTAlgorithmRSFamilyErrorDescription errorWithCode:JWTAlgorithmRSFamilyErrorIncorrectHashComputation];\n        }\n        return nil;\n    }\n\n    CFErrorRef errorRef = NULL;\n\n    SecTransformRef transform = SecSignTransformCreate(privateKey, &errorRef);\n\n    NSData *resultData = nil;\n    \n    // signing: false result is NULL.\n    resultData = [self executeTransform:transform withInput:plainData withDigestType:kSecDigestSHA2 withDigestLength:@(signedHashBytesSize) withFalseResult:NULL];\n\n    if (transform != NULL) {\n        CFRelease(transform);\n    }\n    \n    if (errorRef != NULL) {\n        CFRelease(errorRef);\n    }\n    \n    if (hashBytes != NULL) {\n        free(hashBytes);\n    }\n\n    return resultData;\n}\n@end\n#endif\n\n\n// MacOS OR iOS is Base\n#if TARGET_OS_MAC && !TARGET_OS_IPHONE\n@interface JWTAlgorithmRSFamilyMember : JWTAlgorithmRSBaseMac @end\n#else\n@interface JWTAlgorithmRSFamilyMember : JWTAlgorithmRSBaseIOS @end\n#endif\n\n@interface JWTAlgorithmRS256 : JWTAlgorithmRSFamilyMember @end\n@interface JWTAlgorithmRS384 : JWTAlgorithmRSFamilyMember @end\n@interface JWTAlgorithmRS512 : JWTAlgorithmRSFamilyMember @end\n\n@implementation JWTAlgorithmRSFamilyMember\n- (uint32_t)secPaddingPKCS1SHANumber {\n    return 0;\n}\n@end\n\n@implementation JWTAlgorithmRS256\n\n- (size_t)ccSHANumberDigestLength {\n    return CC_SHA256_DIGEST_LENGTH;\n}\n\n#if TARGET_OS_MAC && TARGET_OS_IPHONE\n- (uint32_t)secPaddingPKCS1SHANumber {\n    return kSecPaddingPKCS1SHA256;\n}\n#endif\n\n- (unsigned char *)CC_SHANumberWithData:(const void *)data withLength:(CC_LONG)len withHashBytes:(unsigned char *)hashBytes {\n    return CC_SHA256(data, len, hashBytes);\n}\n\n- (NSString *)name {\n    return JWTAlgorithmNameRS256;\n}\n\n@end\n\n@implementation JWTAlgorithmRS384\n\n- (size_t)ccSHANumberDigestLength {\n    return CC_SHA384_DIGEST_LENGTH;\n}\n\n#if TARGET_OS_MAC && TARGET_OS_IPHONE\n- (uint32_t)secPaddingPKCS1SHANumber {\n    return kSecPaddingPKCS1SHA384;\n}\n#endif\n\n- (unsigned char *)CC_SHANumberWithData:(const void *)data withLength:(CC_LONG)len withHashBytes:(unsigned char *)hashBytes {\n    return CC_SHA384(data, len, hashBytes);\n}\n\n- (NSString *)name {\n    return JWTAlgorithmNameRS384;\n}\n\n@end\n\n@implementation JWTAlgorithmRS512\n\n- (size_t)ccSHANumberDigestLength {\n    return CC_SHA512_DIGEST_LENGTH;\n}\n\n#if TARGET_OS_MAC && TARGET_OS_IPHONE\n- (uint32_t)secPaddingPKCS1SHANumber {\n    return kSecPaddingPKCS1SHA512;\n}\n#endif\n\n- (unsigned char *)CC_SHANumberWithData:(const void *)data withLength:(CC_LONG)len withHashBytes:(unsigned char *)hashBytes {\n    return CC_SHA512(data, len, hashBytes);\n}\n\n- (NSString *)name {\n    return JWTAlgorithmNameRS512;\n}\n\n@end\n\n\n@interface JWTAlgorithmRSFamilyMemberMutable : JWTAlgorithmRSFamilyMember\n\n@property (assign, nonatomic, readwrite) size_t ccSHANumberDigestLength;\n@property (assign, nonatomic, readwrite) uint32_t secPaddingPKCS1SHANumber;\n@property (copy, nonatomic, readwrite) unsigned char * (^ccShaNumberWithData)(const void *data, CC_LONG len, unsigned char *hashBytes);\n@property (copy, nonatomic, readwrite) NSString *name;\n@end\n\n@implementation JWTAlgorithmRSFamilyMemberMutable\n\n@synthesize ccSHANumberDigestLength = _ccSHANumberDigestLength;\n@synthesize secPaddingPKCS1SHANumber = _secPaddingPKCS1SHANumber;\n@synthesize name = _name;\n\n- (size_t)ccSHANumberDigestLength {\n    return _ccSHANumberDigestLength;\n}\n\n- (uint32_t)secPaddingPKCS1SHANumber {\n    return _secPaddingPKCS1SHANumber;\n}\n\n- (unsigned char *)CC_SHANumberWithData:(const void *)data withLength:(uint32_t)len withHashBytes:(unsigned char *)hashBytes {\n    unsigned char *result = [super CC_SHANumberWithData:data withLength:len withHashBytes:hashBytes];\n    if (!result && self.ccShaNumberWithData) {\n        result = self.ccShaNumberWithData(data, len, hashBytes);\n    }\n    return result;\n}\n\n@end\n\n\n@implementation JWTAlgorithmRSBase (Create)\n\n+ (instancetype)algorithm256 {\n    return [JWTAlgorithmRS256 new];\n}\n\n+ (instancetype)algorithm384 {\n    return [JWTAlgorithmRS384 new];\n}\n\n+ (instancetype)algorithm512 {\n    return [JWTAlgorithmRS512 new];\n}\n\n+ (instancetype)mutableAlgorithm {\n    JWTAlgorithmRSFamilyMemberMutable *base = [JWTAlgorithmRSFamilyMemberMutable new];\n    base.ccSHANumberDigestLength = CC_SHA256_DIGEST_LENGTH;\n\n    //set to something ok\n    //base.secPaddingPKCS1SHANumber = kSecPaddingPKCS1SHA256;\n    base.ccShaNumberWithData = ^unsigned char *(const void *data, CC_LONG len, unsigned char *hashBytes){\n        return CC_SHA256(data, len, hashBytes);\n    };\n    base.name = @\"RS256\";\n    return base;\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m",
    "content": "//\n//  JWTCryptoKey.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 04.02.17.\n//  Copyright © 2017 JWTIO. All rights reserved.\n//\n\n#import \"JWTCryptoKey.h\"\n#import \"JWTCryptoSecurity.h\"\n#import \"JWTCryptoSecurity+Extraction.h\"\n#import \"JWTCryptoSecurity+ExternalRepresentation.h\"\n#import \"JWTCryptoSecurity+ErrorHandling.h\"\n#import \"JWTBase64Coder.h\"\n@interface JWTCryptoKeyBuilder()\n+ (NSString *)keyTypeRSA;\n+ (NSString *)keyTypeEC;\n@property (assign, nonatomic, readwrite) BOOL public;\n@property (assign, nonatomic, readwrite) NSString *keyType;\n@property (nonatomic, readonly) BOOL withKeyTypeRSA;\n@property (nonatomic, readonly) BOOL withKeyTypeEC;\n@end\n@implementation JWTCryptoKeyBuilder\n+ (NSString *)keyTypeRSA {\n    return @\"RSA\";\n}\n+ (NSString *)keyTypeEC {\n    return @\"EC\";\n}\n- (instancetype)keyTypeRSA {\n    self.keyType = [self.class keyTypeRSA];\n    return self;\n}\n- (instancetype)keyTypeEC {\n    self.keyType = [self.class keyTypeEC];\n    return self;\n}\n- (BOOL)withKeyTypeRSA {\n    return [self.keyType isEqualToString:self.class.keyTypeRSA];\n}\n- (BOOL)withKeyTypeEC {\n    return [self.keyType isEqualToString:self.class.keyTypeEC];\n}\n@end\n@interface JWTCryptoKey ()\n@property (copy, nonatomic, readwrite) NSString *tag;\n@property (assign, nonatomic, readwrite) SecKeyRef key;\n@property (copy, nonatomic, readwrite) NSData *rawKey;\n@end\n@interface JWTCryptoKey (Class)\n+ (NSString *)generateUniqueTag;\n@end\n@implementation JWTCryptoKey (Class)\n+ (NSString *)generateUniqueTag {\n    return [[NSUUID UUID].UUIDString stringByReplacingOccurrencesOfString:@\"-\" withString:@\"\"].lowercaseString;\n}\n@end\n@implementation JWTCryptoKey (Parameters)\n+ (NSString *)parametersKeyBuilder {\n    return NSStringFromSelector(_cmd);\n}\n@end\n@interface JWTCryptoKey (ParametersExtraction)\n- (NSString *)extractedSecKeyTypeWithParameters:(NSDictionary *)parameters;\n- (JWTCryptoKeyBuilder *)extractedBuilderWithParameters:(NSDictionary *)parameters;\n@end\n// Consider that both methods in this category should return non-nullable values\n@implementation JWTCryptoKey (ParametersExtraction)\n// Parameters are nil at that moment, could be used later for some purposes\n- (JWTCryptoKeyBuilder *)extractedBuilderWithParameters:(NSDictionary *)parameters {\n    return (JWTCryptoKeyBuilder *)parameters[[self.class parametersKeyBuilder]] ?: [JWTCryptoKeyBuilder new].keyTypeRSA;\n}\n// Parameters are nil at that moment, could be used later for some purposes\n- (NSString *)extractedSecKeyTypeWithParameters:(NSDictionary *)parameters {\n    JWTCryptoKeyBuilder *builder = [self extractedBuilderWithParameters:parameters];\n    if (builder.withKeyTypeEC) {\n        return JWTCryptoSecurityKeysTypes.EC;\n    }\n    return JWTCryptoSecurityKeysTypes.RSA;\n}\n@end\n@interface JWTCryptoKey (Generator) <JWTCryptoKey__Generator__Protocol, JWTCryptoKey__Raw__Generator__Protocol>\n@end\n\n@implementation JWTCryptoKey (Generator)\n- (instancetype)initWithSecKeyRef:(SecKeyRef)key {\n    if (key == NULL) {\n        return nil;\n    }\n    if (self = [super init]) {\n        self.key = key;\n    }\n    return self;\n}\n- (instancetype)initWithData:(NSData *)data parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error {\n    // add check that everything is fine.\n    return [super init];\n}\n- (instancetype)initWithBase64String:(NSString *)base64String parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error {\n    return [self initWithData:[JWTBase64Coder dataWithBase64UrlEncodedString:base64String] parameters:parameters error:error];\n}\n- (instancetype)initWithPemEncoded:(NSString *)encoded parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error {\n    //TODO: check correctness.\n    //maybe use clean initWithBase64String and remove ?: encoded tail.\n    NSString *clean = ((JWTCryptoSecurityComponent *)[[JWTCryptoSecurity componentsFromFileContent:encoded] componentsOfType:JWTCryptoSecurityComponents.Key].firstObject).content ?: encoded;//[JWTCryptoSecurity stringByRemovingPemHeadersFromString:encoded];\n    return [self initWithBase64String:clean parameters:parameters error:error];\n}\n- (instancetype)initWithPemAtURL:(NSURL *)url parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error {\n    // contents of url\n    NSError *contentsExtractingError = nil;\n    NSString *pemEncoded = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&contentsExtractingError];\n    if (error && contentsExtractingError) {\n        *error = contentsExtractingError;\n        return nil;\n    }\n    return [self initWithPemEncoded:pemEncoded parameters:parameters error:error];\n}\n@end\n\n@implementation JWTCryptoKey (Check)\n- (void)cleanup {\n    if (self.key != NULL) {\n        CFRelease(self.key);\n    }\n}\n\n- (instancetype)checkedWithError:(NSError *__autoreleasing*)error {\n    BOOL checked = self.key != NULL;\n    if (error && !checked) {\n        *error = [NSError errorWithDomain:@\"org.opensource.jwt.security.key\" code:-200 userInfo:@{NSLocalizedDescriptionKey : @\"Security key isn't retrieved! Something went wrong!\"}];\n    }\n    return self;\n}\n@end\n\n@implementation JWTCryptoKey (ExternalRepresentation)\n- (NSString *)externalRepresentationForCoder:(JWTBase64Coder *)coder error:(NSError *__autoreleasing *)error {\n    NSData *data = [JWTCryptoSecurity externalRepresentationForKey:self.key error:error];\n    NSString *result = (NSString *)[coder ?: JWTBase64Coder.withBase64String stringWithData:data];\n    return result;\n}\n@end\n\n@implementation JWTCryptoKey\n- (void)dealloc {\n    [self cleanup];\n}\n@end\n\n@implementation JWTCryptoKeyPublic\n- (instancetype)initWithData:(NSData *)data parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error {\n    if (self = [super initWithData:data parameters:parameters error:error]) {\n        self.tag = [self.class generateUniqueTag];\n\n        if (!data) {\n            return nil;\n        }\n\n        NSError *removingHeaderError = nil;\n        // asks builder\n        \n        JWTCryptoKeyBuilder *builder = [self extractedBuilderWithParameters:parameters];\n        NSData *keyData = data;\n        if (builder.withKeyTypeRSA) {\n            keyData = [JWTCryptoSecurity dataByRemovingPublicKeyHeader:data error:&removingHeaderError];\n            if (!keyData || removingHeaderError) {\n                if (error && removingHeaderError != nil) {\n                    *error = removingHeaderError;\n                }\n                return nil;\n            }\n        }\n        \n        if (builder.withKeyTypeEC) {\n            NSError *theError = nil;\n            //  keyData = [JWTCryptoSecurity dataByExtractingKeyFromANS1:data error:&theError];\n            if (!keyData || theError) {\n                if (error && theError != nil) {\n                    *error = theError;\n                }\n                return nil;\n            }\n            // unknown here.\n            // process keyData before passing it to JWTCryptoSecurity+addKey... method.\n//            keyData = [JWTCryptoSecurity dataByRemovingPublicKeyHeader:data error:&removingHeaderError];\n//            if (!keyData || removingHeaderError) {\n//                if (error && removingHeaderError != nil) {\n//                    *error = removingHeaderError;\n//                }\n//                return nil;\n//            }\n//            NSData *theData = [data copy];\n//            while (theData != nil && theData.length > 0) {\n//                NSError *theError = nil;\n//                self.key = [JWTCryptoSecurity addKeyWithData:theData asPublic:YES tag:self.tag type:[self extractedSecKeyTypeWithParameters:parameters] error:&theError];\n//                NSLog(@\"theData: %@\", theData);\n//                NSLog(@\"theError: %@\", theError);\n//                if (!theError && self.key) {\n//                    NSLog(@\"Found!\");\n//                    NSLog(@\"theData: %@\", theData);\n//                    NSLog(@\"theKey: %@\", self.key);\n//                    break;\n//                }\n//                NSUInteger length = theData.length - 1;\n//                NSRange range = NSMakeRange(1, length);\n//                theData = [NSData dataWithBytes:((char *)theData.bytes) + range.location length:range.length];\n//            }\n        }\n\n        NSError *addKeyError = nil;\n        \n        self.key = [JWTCryptoSecurity addKeyWithData:keyData asPublic:YES tag:self.tag type:[self extractedSecKeyTypeWithParameters:parameters] error:&addKeyError];\n        if (!self.key || addKeyError) {\n            if (error && addKeyError != nil) {\n                *error = addKeyError;\n            }\n            [self cleanup];\n            return nil;\n        }\n    }\n    return self;\n}\n- (instancetype)initWithCertificateData:(NSData *)certificateData parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error {\n    SecKeyRef key = [JWTCryptoSecurity publicKeyFromCertificate:certificateData];\n    if (!key) {\n        // error: Public certificate incorrect.\n        return nil;\n    }\n\n    if (self = [super init]) {\n        self.key = key;\n    }\n\n    return self;\n}\n- (instancetype)initWithCertificateBase64String:(NSString *)certificate parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error {\n    // cleanup certificate if needed.\n    // call initWithCertificateData:(NSData *)certificateData\n    NSData *certificateData = [JWTBase64Coder dataWithBase64UrlEncodedString:certificate];\n    return [self initWithCertificateData:certificateData parameters:parameters error:error];\n}\n@end\n\n@implementation JWTCryptoKeyPrivate\n- (instancetype)initWithData:(NSData *)data parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error {\n    if (self = [super initWithData:data parameters:parameters error:error]) {\n        self.tag = [self.class generateUniqueTag];\n        NSError *addKeyError = nil;\n        if (!data) {\n            // error: no data?\n            // or put it in superclass?\n            return nil;\n        }\n        \n        NSData *theData = [data copy];\n        JWTCryptoKeyBuilder *builder = [self extractedBuilderWithParameters:parameters];\n        if (builder.withKeyTypeEC) {\n            // cheat and shit!\n            // ahaha. try to find correct key here.\n            // possible soultion - dataByExtracting in cryptoKeySecurity.\n            while (/* DISABLES CODE */ (0) && theData != nil && theData.length > 0) {\n                NSError *theError = nil;\n                self.key = [JWTCryptoSecurity addKeyWithData:theData asPublic:NO tag:self.tag type:[self extractedSecKeyTypeWithParameters:parameters] error:&theError];\n                NSLog(@\"theData: %@\", theData);\n                NSLog(@\"theError: %@\", theError);\n                if (!theError && self.key) {\n                    NSLog(@\"Found!\");\n                    NSLog(@\"theData: %@\", theData);\n                    NSLog(@\"theKey: %@\", self.key);\n                    break;\n                }\n                NSUInteger length = theData.length - 1;\n                NSRange range = NSMakeRange(1, length);\n                theData = [NSData dataWithBytes:((char *)theData.bytes) + range.location length:range.length];\n            }\n        }\n        \n        self.key = [JWTCryptoSecurity addKeyWithData:theData asPublic:NO tag:self.tag type:[self extractedSecKeyTypeWithParameters:parameters] error:&addKeyError];\n        if (!self.key || addKeyError) {\n            if (error && addKeyError) {\n                *error = addKeyError;\n            }\n            [self cleanup];\n            return nil;\n        }\n    }\n    return self;\n}\n// Exists\n- (instancetype)initWithP12AtURL:(NSURL *)url withPassphrase:(NSString *)passphrase parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error {\n    // take data.\n    // cleanup if needed.\n    NSData *data = [NSData dataWithContentsOfURL:url];\n    return [self initWithP12Data:data withPassphrase:passphrase parameters:parameters error:error];\n}\n- (instancetype)initWithP12Data:(NSData *)p12Data withPassphrase:(NSString *)passphrase parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error {\n    if (p12Data == nil) {\n        return nil;\n    }\n\n    // cleanup if needed.\n    SecIdentityRef identity = nil;\n    SecTrustRef trust = nil;\n    {\n        CFErrorRef extractError = NULL;\n        [JWTCryptoSecurity extractIdentityAndTrustFromPKCS12:(__bridge CFDataRef)p12Data password:(__bridge CFStringRef)passphrase identity:&identity trust:&trust error:&extractError];\n        if (extractError != nil) {\n            if (error) {\n                *error = (NSError *)CFBridgingRelease(extractError);\n                return nil;\n            }\n        }\n    }\n    \n    BOOL identityAndTrust = identity && trust;\n    \n    // we don't need trust anymore.\n    if (trust) {\n        CFRelease(trust);\n    }\n    \n    SecKeyRef privateKey = NULL;\n    if (identityAndTrust) {\n        OSStatus status = SecIdentityCopyPrivateKey(identity, &privateKey);\n        NSError *theError = [JWTCryptoSecurity securityErrorWithOSStatus:status];\n        if (theError) {\n            if (error) {\n                *error = theError;\n            }\n        }\n    }\n    \n    if (identity) {\n        CFRelease(identity);\n    }\n    \n    if (privateKey != NULL) {\n        if (self = [super init]) {\n            self.key = privateKey;\n        }\n    }\n    \n    return self;\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor+FluentStyle.m",
    "content": "//\n//  JWTCryptoKeyExtractor+FluentStyle.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 07/06/2019.\n//  Copyright © 2019 JWTIO. All rights reserved.\n//\n\n#import \"JWTCryptoKeyExtractor+FluentStyle.h\"\n\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wobjc-property-implementation\"\n@implementation JWTCryptoKeyExtractor (FluentStyle)\n\n@end\n#pragma clang diagnostic pop\n"
  },
  {
    "path": "Sources/JWT/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m",
    "content": "//\n//  JWTCryptoKeyExtractor.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 04.02.17.\n//  Copyright © 2017 JWTIO. All rights reserved.\n//\n\n#import \"JWTCryptoKeyExtractor.h\"\n#import \"JWTCryptoKey.h\"\n#import \"JWTBase64Coder.h\"\n\n@interface JWTCryptoKeyExtractor ()\n@property (strong, nonatomic, readwrite) JWTCryptoKeyBuilder *internalKeyBuilder;\n@property (copy, nonatomic, readwrite) JWTCryptoKeyExtractor * (^keyBuilder)(JWTCryptoKeyBuilder *keyBuilder);\n@end\n\n@interface JWTCryptoKeyExtractor (Parameters)\n- (NSDictionary *)enhancedParameters:(NSDictionary *)parameters;\n@end\n\n@implementation JWTCryptoKeyExtractor (Parameters)\n- (NSDictionary *)enhancedParameters:(NSDictionary *)parameters {\n    if (self.internalKeyBuilder != nil) {\n        NSMutableDictionary *theParameters = [NSMutableDictionary dictionaryWithDictionary:parameters ?: @{}];\n        [theParameters setObject:self.internalKeyBuilder forKeyedSubscript:JWTCryptoKey.parametersKeyBuilder];\n    }\n    return parameters;\n}\n@end\n\n@implementation JWTCryptoKeyExtractor\n- (NSString *)type {\n    return self.class.type;\n}\n+ (NSString *)type {\n\treturn NSStringFromClass(self);\n}\n+ (NSString *)parametersKeyCertificatePassphrase {\n    return NSStringFromSelector(_cmd);\n}\n\n- (instancetype)init {\n    if (self = [super init]) {\n        [self setupFluent];\n    }\n    return self;\n}\n\n#pragma mark - Fluent\n- (void)setupFluent {\n    __weak typeof(self) weakSelf = self;\n    self.keyBuilder = ^(JWTCryptoKeyBuilder *keyBuilder) {\n        return [weakSelf configuredByKeyBuilder:keyBuilder];\n    };\n}\n\n#pragma mark - <JWTCryptoKeyExtractorProtocol>\n- (id<JWTCryptoKeyProtocol>)keyFromData:(NSData *)data parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing *)error {\n//#pragma message \"Not Implemented\"\n    if (error) {\n        *error = [NSError errorWithDomain:@\"io.jwt.crypto.rsa\" code:-100 userInfo:@{\n                                                                                    NSLocalizedDescriptionKey : @\"Method not implemented\"\n                                                                                    }];\n    }\n    return nil;\n}\n- (id<JWTCryptoKeyProtocol>)keyFromString:(NSString *)string parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing *)error {\n    if (error) {\n        *error = [NSError errorWithDomain:@\"io.jwt.crypto.rsa\" code:-100 userInfo:@{\n                                                                           NSLocalizedDescriptionKey : @\"Method not implemented\"\n                                                                           }];\n    }\n    return nil;\n}\n@end\n\n@implementation JWTCryptoKeyExtractor (Setters)\n- (instancetype)configuredByKeyBuilder:(JWTCryptoKeyBuilder *)keyBuilder {\n    self.internalKeyBuilder = keyBuilder;\n    return self;\n}\n@end\n\n@interface JWTCryptoKeyExtractor_Public_Pem_Certificate : JWTCryptoKeyExtractor @end\n\n@implementation JWTCryptoKeyExtractor_Public_Pem_Certificate\n- (id<JWTCryptoKeyProtocol>)keyFromData:(NSData *)data parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing *)error {\n    NSDictionary *theParameters = [self enhancedParameters:parameters];\n    return [[JWTCryptoKeyPublic alloc] initWithCertificateData:data parameters:theParameters error:error];\n}\n@end\n\n@interface JWTCryptoKeyExtractor_Private_P12 : JWTCryptoKeyExtractor @end\n\n@implementation JWTCryptoKeyExtractor_Private_P12\n- (id<JWTCryptoKeyProtocol>)keyFromData:(NSData *)data parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing *)error {\n    NSString *certificatePassphrase = parameters[self.class.parametersKeyCertificatePassphrase];\n    if ([certificatePassphrase isEqual:[NSNull null]]) {\n        certificatePassphrase = nil;\n    }\n    NSDictionary *theParameters = [self enhancedParameters:parameters];\n    return [[JWTCryptoKeyPrivate alloc] initWithP12Data:data withPassphrase:certificatePassphrase parameters:theParameters error:error];\n}\n@end\n\n@interface JWTCryptoKeyExtractor_Public_Pem_Key : JWTCryptoKeyExtractor @end\n\n@implementation JWTCryptoKeyExtractor_Public_Pem_Key\n- (id<JWTCryptoKeyProtocol>)keyFromData:(NSData *)data parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing *)error {\n    return [self keyFromString:[JWTBase64Coder base64UrlEncodedStringWithData:data] parameters:parameters error:error];\n}\n- (id<JWTCryptoKeyProtocol>)keyFromString:(NSString *)string parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing *)error {\n    NSDictionary *theParameters = [self enhancedParameters:parameters];\n    return [[JWTCryptoKeyPublic alloc] initWithPemEncoded:string parameters:theParameters error:error];\n}\n@end\n\n@interface JWTCryptoKeyExtractor_Private_Pem_Key : JWTCryptoKeyExtractor @end\n\n@implementation JWTCryptoKeyExtractor_Private_Pem_Key\n- (id<JWTCryptoKeyProtocol>)keyFromData:(NSData *)data parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing *)error {\n    return [self keyFromString:[JWTBase64Coder base64UrlEncodedStringWithData:data] parameters:parameters error:error];\n}\n- (id<JWTCryptoKeyProtocol>)keyFromString:(NSString *)string parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing *)error {\n    NSDictionary *theParameters = [self enhancedParameters:parameters];\n    return [[JWTCryptoKeyPrivate alloc] initWithPemEncoded:string parameters:theParameters error:error];\n}\n@end\n\n@implementation JWTCryptoKeyExtractor (ClassCluster)\n+ (instancetype)publicKeyWithCertificate {\n    return [JWTCryptoKeyExtractor_Public_Pem_Certificate new];\n}\n+ (instancetype)privateKeyInP12 {\n    return [JWTCryptoKeyExtractor_Private_P12 new];\n}\n+ (instancetype)publicKeyWithPEMBase64 {\n    return [JWTCryptoKeyExtractor_Public_Pem_Key new];\n}\n+ (instancetype)privateKeyWithPEMBase64 {\n    return [JWTCryptoKeyExtractor_Private_Pem_Key new];\n}\n+ (NSArray *)availableExtractors {\n    return @[\n             [self publicKeyWithCertificate],\n             [self privateKeyInP12],\n             [self publicKeyWithPEMBase64],\n             [self privateKeyWithPEMBase64]\n             ];\n}\n+ (NSDictionary *)typesAndExtractors {\n    static NSDictionary *dictionary = nil;\n    return dictionary ?: (dictionary = [[NSDictionary alloc] initWithObjects:[self availableExtractors] forKeys:[[self availableExtractors] valueForKey:@\"type\"]]);\n}\n+ (instancetype)createWithType:(NSString *)type {\n\treturn [self typesAndExtractors][type];\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity+ErrorHandling.m",
    "content": "//\n//  JWTCryptoSecurity+ErrorHandling.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 08.08.2018.\n//  Copyright © 2018 JWTIO. All rights reserved.\n//\n\n#import \"JWTCryptoSecurity+ErrorHandling.h\"\n#import \"JWTDeprecations.h\"\n\n@implementation JWTCryptoSecurity (ErrorHandling)\n+ (NSError *)securityErrorWithOSStatus:(OSStatus)status {\n    if (status == errSecSuccess) {\n        return nil;\n    }\n//  if  @available(macOS 10.3, iOS 11.3, tvOS 11.3, watchOS 4.3, *)\n    // appropriate for Xcode 9 and higher.\n    // rewrite it later?\n#if JWT_COMPILE_TIME_AVAILABILITY(JWT_macOS(1030), JWT_iOS(110300), JWT_tvOS(110300), JWT_watchOS(40300))\n    NSString *message = (NSString *)CFBridgingRelease(SecCopyErrorMessageString(status, NULL)) ?: @\"Unknown error message\";\n    return [NSError errorWithDomain:NSOSStatusErrorDomain code:status userInfo:@{NSLocalizedDescriptionKey : message}];\n#else\n    return [NSError errorWithDomain:NSOSStatusErrorDomain code:status userInfo:nil];\n#endif\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity+ExternalRepresentation.m",
    "content": "//\n//  JWTCryptoSecurity+ExternalRepresentation.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 08.08.2018.\n//  Copyright © 2018 JWTIO. All rights reserved.\n//\n\n#import \"JWTCryptoSecurity+ExternalRepresentation.h\"\n\n@implementation JWTCryptoSecurity (ExternalRepresentation)\n\n+ (NSData *)externalRepresentationForKey:(SecKeyRef)key error:(NSError *__autoreleasing *)error {\n    if (key == NULL) {\n        return nil;\n    }\n    \n    if (@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)) {\n        CFErrorRef copyError = NULL;\n        NSData *result = (NSData *)CFBridgingRelease(SecKeyCopyExternalRepresentation(key, &copyError));\n        if (error && copyError != NULL) {\n            *error = CFBridgingRelease(copyError);\n            return nil;\n        }\n        return result;\n        \n    } else {\n        return nil;\n    }\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity+Extraction.m",
    "content": "//\n//  JWTCryptoSecurity+Extraction.m\n//  JWT\n//\n//  Created by Dmitry on 7/31/18.\n//  Copyright © 2018 JWTIO. All rights reserved.\n//\n\n#import \"JWTCryptoSecurity+Extraction.h\"\n@implementation JWTCryptoSecurityComponent\n- (instancetype)initWithContent:(NSString *)content type:(NSString *)type {\n    if (type == nil || content == nil) {\n        return nil;\n    }\n    if (self = [super init]) {\n        self.content = content;\n        self.type = type;\n    }\n    return self;\n}\n@end\n\n@interface JWTCryptoSecurityComponents ()\n@property (copy, nonatomic, readwrite) NSArray <JWTCryptoSecurityComponent *>*components;\n@end\n\n@implementation JWTCryptoSecurityComponents\n+ (NSString *)Certificate { return NSStringFromSelector(_cmd).uppercaseString; }\n+ (NSString *)PrivateKey { return @\"Private\".uppercaseString; }\n+ (NSString *)PublicKey { return @\"Public\".uppercaseString; }\n+ (NSString *)Key { return NSStringFromSelector(_cmd).uppercaseString; }\n+ (NSArray *)components:(NSArray *)components ofType:(NSString *)type {\n    return [components filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@\"type contains %@\", type]];\n}\n\n- (instancetype)initWithComponents:(NSArray *)components {\n    if (self = [self init]) {\n        self.components = components;\n    }\n    return self;\n}\n\n- (NSArray *)componentsOfType:(NSString *)type {\n    return [self.class components:self.components ofType:type];\n}\n@end\n\n@interface JWTCryptoSecurityComponents (Extraction)\n+ (NSString *)determineTypeByPemHeaderType:(NSString *)headerType;\n+ (NSRegularExpression *)pemEntryRegularExpression;\n+ (JWTCryptoSecurityComponent *)componentFromTextResult:(NSTextCheckingResult *)textResult inContent:(NSString *)content;\n+ (instancetype)parsedComponentsInContent:(NSString *)content;\n@end\n\n@implementation JWTCryptoSecurityComponents (Extraction)\n+ (NSString *)determineTypeByPemHeaderType:(NSString *)headerType {\n    __auto_type validateBlock = ^(NSString *headerType, NSString *string) {\n        return [headerType rangeOfString:string options:NSCaseInsensitiveSearch].location != NSNotFound;\n    };\n    if (validateBlock(headerType, @\"CERTIFICATE\")) {\n        return self.Certificate;\n    }\n    if (validateBlock(headerType, @\"PUBLIC\")) {\n        return self.PublicKey;\n    }\n    if (validateBlock(headerType, @\"PRIVATE\")) {\n        return self.PrivateKey;\n    }\n    if (validateBlock(headerType, @\"KEY\")) {\n        return self.Key;\n    }\n    return nil;\n}\n\n+ (NSRegularExpression *)pemEntryRegularExpression {\n    __auto_type expression = [[NSRegularExpression alloc] initWithPattern:@\"-----BEGIN(?<Begin>[\\\\w\\\\s]+)-----(?<Content>.+?)-----END(?<End>[\\\\w\\\\s]+)-----\" options:NSRegularExpressionDotMatchesLineSeparators error:nil];\n    return expression;\n}\n+ (JWTCryptoSecurityComponent *)componentFromTextResult:(NSTextCheckingResult *)textResult inContent:(NSString *)content {\n    if (textResult.numberOfRanges > 2) {\n        __auto_type beginRange = [textResult rangeAtIndex:1];\n        __auto_type contentRange = [textResult rangeAtIndex:2];\n        // cleanup string.\n        __auto_type beginString = [content substringWithRange:beginRange];\n        __auto_type contentString = [content substringWithRange:contentRange];\n        __auto_type resultType = [beginString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];//[self determineTypeByPemHeaderType:beginString]; // we need full string to parse attributes \"Private/Public\" \"EC/RSA\" \"KEY/CERTIFICATE\" etc.\n        __auto_type resultContent = [contentString stringByReplacingOccurrencesOfString:@\"\\n\" withString:@\"\"];\n        return [[JWTCryptoSecurityComponent alloc] initWithContent:resultContent type:resultType];\n    }\n    else {\n        return nil;\n    }\n}\n+ (instancetype)parsedComponentsInContent:(NSString *)content {\n    __auto_type expression = [self pemEntryRegularExpression];\n    __auto_type results = [expression matchesInString:content options:0 range:NSMakeRange(0, content.length)];\n    __auto_type components = (NSArray <JWTCryptoSecurityComponent *>*)@[];\n    for (NSTextCheckingResult *result in results) {\n        id object = [self componentFromTextResult:result inContent:content];\n        components = [components arrayByAddingObject:object];\n    }\n    return [[self alloc] initWithComponents:components];\n}\n@end\n\n@implementation JWTCryptoSecurity (Extraction)\n+ (JWTCryptoSecurityComponents *)componentsFromFile:(NSURL *)url {\n    NSError *error = nil;\n    __auto_type content = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error];\n    return [self componentsFromFileContent:content];\n}\n+ (JWTCryptoSecurityComponents *)componentsFromFileContent:(NSString *)content {\n    return [JWTCryptoSecurityComponents parsedComponentsInContent:content];\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m",
    "content": "//\n//  JWTCryptoSecurity.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 04.02.17.\n//  Copyright © 2017 JWTIO. All rights reserved.\n//\n\n#import \"JWTCryptoSecurity.h\"\n#import \"JWTCryptoSecurity+ErrorHandling.h\"\n#import \"JWTErrorDescription.h\"\n#import \"JWTDeprecations.h\"\n\n@interface JWTMemoryLayout : NSObject\n+ (NSString *)typeUInt8;\n+ (NSString *)typeCUnsignedChar;\n- (instancetype)initWithType:(NSString *)type;\n+ (instancetype)createWithType:(NSString *)type;\n@property (copy, nonatomic, readwrite) NSString *type;\n@property (assign, nonatomic, readonly) NSInteger size;\n@end\n@implementation JWTMemoryLayout\n+ (NSString *)typeUInt8 {\n    return NSStringFromSelector(_cmd);\n}\n+ (NSString *)typeCUnsignedChar {\n    return [self typeUInt8];\n}\n- (instancetype)initWithType:(NSString *)type {\n    self = [super init];\n    if (self) {\n        self.type = type;\n    }\n    return self;\n}\n+ (instancetype)createWithType:(NSString *)type {\n    return [[self alloc] initWithType:type];\n}\n+ (NSDictionary *)sizesAndTypes {\n    static NSDictionary *sizesAndTypes = nil;\n    return sizesAndTypes ?: (sizesAndTypes = @{\n        [self typeUInt8] : @(1) // or 8?\n    });\n}\n- (NSInteger)size {\n    return [[self.class sizesAndTypes][self.type] integerValue];\n}\n@end\n\n@implementation JWTCryptoSecurityKeysTypes\n+ (NSString *)RSA {\n    return (__bridge NSString *)kSecAttrKeyTypeRSA;\n}\n+ (NSString *)EC {\n    //    extern const CFStringRef kSecAttrKeyTypeEC\n    //    __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_4_0);\n    //    extern const CFStringRef kSecAttrKeyTypeECSECPrimeRandom\n    //    __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_10_0);\n    return (__bridge NSString *)kSecAttrKeyTypeEC;\n}\n@end\n\n@interface JWTCryptoSecurity ()\n+ (NSDictionary *)dictionaryByCombiningDictionaries:(NSArray *)dictionaries;\n@end\n\n@implementation JWTCryptoSecurity (KeysManipulation)\n+ (SecKeyRef)addKeyWithData:(NSData *)data asPublic:(BOOL)thePublic tag:(NSString *)tag type:(NSString *)type error:(NSError *__autoreleasing*)error; {\n    NSString *keyClass = (__bridge NSString *)(thePublic ? kSecAttrKeyClassPublic : kSecAttrKeyClassPrivate);\n    NSInteger sizeInBits = data.length * [JWTMemoryLayout createWithType:[JWTMemoryLayout typeUInt8]].size;\n    NSDictionary *attributes = @{\n                                 (__bridge NSString*)kSecAttrKeyType : type,\n                                 (__bridge NSString*)kSecAttrKeyClass : keyClass,\n                                 (__bridge NSString*)kSecAttrKeySizeInBits : @(sizeInBits)\n                                 };\n    \n    if (@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)) {\n        CFErrorRef createError = NULL;\n        SecKeyRef key = SecKeyCreateWithData((__bridge CFDataRef)data, (__bridge CFDictionaryRef)attributes, &createError);\n        if (error && createError != NULL) {\n            *error = (__bridge NSError*)createError;\n        }\n        return key;\n    }\n    // oh... not avaialbe API :/\n    else {\n        \n        CFTypeRef result = NULL;\n        NSData *tagData = [tag dataUsingEncoding:NSUTF8StringEncoding];\n        NSDictionary *commonAttributes = @{\n                                           (__bridge NSString*)kSecClass: (__bridge NSString*)kSecClassKey,\n                                           (__bridge NSString*)kSecAttrApplicationTag: tagData,\n                                           (__bridge NSString*)kSecAttrAccessible: (__bridge NSString*)kSecAttrAccessibleWhenUnlocked\n                                           };\n        \n        \n        NSDictionary *addItemAttributes = @{\n                                            (__bridge NSString*)kSecValueData: data,\n                                            (__bridge NSString*)kSecReturnPersistentRef: @(YES),\n                                            };\n        \n        OSStatus addItemStatus = SecItemAdd((__bridge CFDictionaryRef)[self dictionaryByCombiningDictionaries:@[attributes, commonAttributes, addItemAttributes]], &result);\n        if (addItemStatus != errSecSuccess && addItemStatus != errSecDuplicateItem) {\n            // add item error\n            // not duplicate and not added to keychain.\n            return NULL;\n        }\n        \n        NSDictionary *copyAttributes = @{\n                                         (__bridge NSString*)kSecReturnRef: @(YES),\n                                         };\n        \n        CFTypeRef key = NULL;\n        // TODO: Add error handling later.\n        OSStatus copyItemStatus = SecItemCopyMatching((__bridge CFDictionaryRef)[self dictionaryByCombiningDictionaries:@[attributes, commonAttributes, copyAttributes]], &key);\n        if (key == NULL) {\n            // copy item error\n            if (error) {\n                *error = [JWTCryptoSecurity securityErrorWithOSStatus:copyItemStatus];\n            }\n        }\n        return (SecKeyRef)key;\n    }\n    \n    return NULL;\n}\n+ (SecKeyRef)addKeyWithData:(NSData *)data asPublic:(BOOL)public tag:(NSString *)tag error:(NSError *__autoreleasing*)error; {\n    return [self addKeyWithData:data asPublic:public tag:tag type:JWTCryptoSecurityKeysTypes.RSA error:error];\n}\n\n+ (SecKeyRef)keyByTag:(NSString *)tag error:(NSError *__autoreleasing*)error; {\n    return NULL;\n}\n\n+ (BOOL)removeKeyByTag:(NSString *)tag error:(NSError *__autoreleasing*)error; {\n    NSData *tagData = [tag dataUsingEncoding:NSUTF8StringEncoding];\n    if (tagData == nil) {\n        // tell that nothing to remove.\n        if (error) {\n            *error = [JWTErrorDescription errorWithCode:JWTUnexpectedError];\n        }\n        return NO;\n    }\n    NSDictionary *removeAttributes = @{\n                                       (__bridge NSString*)kSecClass: (__bridge NSString*)kSecClassKey,\n                                       (__bridge NSString*)kSecAttrKeyType: (__bridge NSString*)kSecAttrKeyTypeRSA,\n                                       (__bridge NSString*)kSecAttrApplicationTag: tagData\n                                       };\n    OSStatus status = SecItemDelete((__bridge CFDictionaryRef)removeAttributes);\n    if (status != errSecSuccess) {\n        if (error) {\n            *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:status userInfo:nil];\n        }\n    }\n    return status != errSecSuccess;\n    \n}\n@end\n\n@implementation JWTCryptoSecurity\n+ (NSDictionary *)dictionaryByCombiningDictionaries:(NSArray *)dictionaries {\n    NSMutableDictionary *result = [@{} mutableCopy];\n    for (NSDictionary *dictionary in dictionaries) {\n        [result addEntriesFromDictionary:dictionary];\n    }\n    return [result copy];\n}\n+ (NSString *)keyTypeRSA {\n    return JWTCryptoSecurityKeysTypes.RSA;\n}\n+ (NSString *)keyTypeEC {\n    return JWTCryptoSecurityKeysTypes.EC;\n}\n@end\n\n@implementation JWTCryptoSecurity (Certificates)\n+ (OSStatus)extractIdentityAndTrustFromPKCS12:(CFDataRef)inPKCS12Data password:(CFStringRef)password identity:(SecIdentityRef *)outIdentity trust:(SecTrustRef *)outTrust {\n    return [self extractIdentityAndTrustFromPKCS12:inPKCS12Data password:password identity:outIdentity trust:outTrust error:NULL];\n}\n+ (OSStatus)extractIdentityAndTrustFromPKCS12:(CFDataRef)inPKCS12Data password:(CFStringRef)password identity:(SecIdentityRef *)outIdentity trust:(SecTrustRef *)outTrust error:(CFErrorRef *)error {\n\n    OSStatus securityError = errSecSuccess;\n\n\n    const void *keys[] =   { kSecImportExportPassphrase };\n    const void *values[] = { password };\n    CFDictionaryRef optionsDictionary = NULL;\n\n    /* Create a dictionary containing the passphrase if one\n     was specified.  Otherwise, create an empty dictionary. */\n    optionsDictionary = CFDictionaryCreate(\n                                           NULL, keys,\n                                           values, (password ? 1 : 0),\n                                           NULL, NULL);  // 1\n\n    CFArrayRef items = NULL;\n    securityError = SecPKCS12Import(inPKCS12Data,\n                                    optionsDictionary,\n                                    &items);                    // 2\n    \n    /**\n     @discussion\n     If a pkcs12 that was created with only one private key in it and no certificate was tried used, this just crashed when accessing index 0 with the CFArrayGetValueAtIndex.\n     */\n    if (items != nil && CFArrayGetCount(items) == 0) {\n        securityError = errSecPkcs12VerifyFailure;\n    }\n    \n    //\n    if (securityError == 0) {                                   // 3\n        CFDictionaryRef myIdentityAndTrust = CFArrayGetValueAtIndex (items, 0);\n        const void *tempIdentity = NULL;\n        tempIdentity = CFDictionaryGetValue (myIdentityAndTrust,\n                                             kSecImportItemIdentity);\n        CFRetain(tempIdentity);\n        *outIdentity = (SecIdentityRef)tempIdentity;\n        const void *tempTrust = NULL;\n        tempTrust = CFDictionaryGetValue (myIdentityAndTrust, kSecImportItemTrust);\n\n        CFRetain(tempTrust);\n        *outTrust = (SecTrustRef)tempTrust;\n    }\n    else {\n        if (error) {\n            NSError *resultError = [JWTCryptoSecurity securityErrorWithOSStatus:securityError];\n            CFErrorRef theError = (CFErrorRef)CFBridgingRetain(resultError);\n            *error = theError;\n        }\n    }\n\n    if (optionsDictionary) {\n        CFRelease(optionsDictionary);\n    }\n    \n    if (items) {\n        CFRelease(items);\n    }\n    \n    return securityError;\n}\n\n+ (SecKeyRef)trustCopyKey:(SecTrustRef)trust {\n//    API_DEPRECATED_WITH_REPLACEMENT(\"SecTrustCopyKey\", macos(10.7, 11.0), ios(2.0, 14.0), watchos(1.0, 7.0), tvos(9.0, 14.0));\n#if JWT_COMPILE_TIME_AVAILABILITY(JWT_macOS(110000), JWT_iOS(140000), JWT_tvOS(140000), JWT_watchOS(70000))\n    return SecTrustCopyKey(trust);\n#else\n    return SecTrustCopyPublicKey(trust);\n#endif\n}\n+ (SecKeyRef)publicKeyFromCertificate:(NSData *)certificateData {\n    SecCertificateRef certificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificateData);\n    if (certificate != NULL) {\n        SecPolicyRef secPolicy = SecPolicyCreateBasicX509();\n        SecTrustRef trust;\n        SecTrustCreateWithCertificates(certificate, secPolicy, &trust);\n\n        //        if (@available(macOS 10.14, iOS 12.0, tvOS 12.0, watchOS 5.0, *)) {\n#if JWT_COMPILE_TIME_AVAILABILITY(JWT_macOS(101400), JWT_iOS(120000), JWT_tvOS(120000), JWT_watchOS(50000))\n            CFErrorRef errorRef = NULL;\n            BOOL result = SecTrustEvaluateWithError(trust, &errorRef);\n            if (result == NO) {\n                NSError *error = (__bridge NSError *)errorRef;\n                NSLog(@\"%s Error occured while retrieving public key from : %@\", __PRETTY_FUNCTION__, error);\n                if (errorRef != NULL) {\n                    CFRelease(errorRef);\n                }\n            }\n#else\n            SecTrustResultType resultType;\n            SecTrustEvaluate(trust, &resultType);\n#endif\n\n        SecKeyRef publicKey = [self trustCopyKey:trust];\n        (CFRelease(trust));\n        (CFRelease(secPolicy));\n        (CFRelease(certificate));\n        return publicKey;\n    }\n    return NULL;\n}\n@end\n\n@implementation JWTCryptoSecurity (PublicKey)\n/**\n This method strips the x509 from a provided ASN.1 DER public key.\n If the key doesn't contain a header, the DER data is returned as is.\n\n Supported formats are:\n\n Headerless:\n SEQUENCE\n    INTEGER (1024 or 2048 bit) -- modulo\n    INTEGER -- public exponent\n\n With x509 header:\n SEQUENCE\n    SEQUENCE\n        OBJECT IDENTIFIER 1.2.840.113549.1.1.1\n        NULL\n    BIT STRING\n        SEQUENCE\n        INTEGER (1024 or 2048 bit) -- modulo\n        INTEGER -- public exponent\n\n Example of headerless key:\n https://lapo.it/asn1js/#3082010A0282010100C1A0DFA367FBC2A5FD6ED5A071E02A4B0617E19C6B5AD11BB61192E78D212F10A7620084A3CED660894134D4E475BAD7786FA1D40878683FD1B7A1AD9C0542B7A666457A270159DAC40CE25B2EAE7CCD807D31AE725CA394F90FBB5C5BA500545B99C545A9FE08EFF00A5F23457633E1DB84ED5E908EF748A90F8DFCCAFF319CB0334705EA012AF15AA090D17A9330159C9AFC9275C610BB9B7C61317876DC7386C723885C100F774C19830F475AD1E9A9925F9CA9A69CE0181A214DF2EB75FD13E6A546B8C8ED699E33A8521242B7E42711066AEC22D25DD45D56F94D3170D6F2C25164D2DACED31C73963BA885ADCB706F40866B8266433ED5161DC50E4B3B0203010001\n\n Example of key with X509 header (notice the additional ASN.1 sequence):\n https://lapo.it/asn1js/#30819F300D06092A864886F70D010101050003818D0030818902818100D0674615A252ED3D75D2A3073A0A8A445F3188FD3BEB8BA8584F7299E391BDEC3427F287327414174997D147DD8CA62647427D73C9DA5504E0A3EED5274A1D50A1237D688486FADB8B82061675ABFA5E55B624095DB8790C6DBCAE83D6A8588C9A6635D7CF257ED1EDE18F04217D37908FD0CBB86B2C58D5F762E6207FF7B92D0203010001\n */\n//static func stripPublicKeyHeader(keyData: Data) throws -> Data {\n//    let count = keyData.count / MemoryLayout<CUnsignedChar>.size\n//\n//    guard count > 0 else {\n//        throw SwiftyRSAError(message: \"Provided public key is empty\")\n//    }\n//\n//    var byteArray = [UInt8](repeating: 0, count: count)\n//    (keyData as NSData).getBytes(&byteArray, length: keyData.count)\n//\n//    var index = 0\n//    guard byteArray[index] == 0x30 else {\n//        throw SwiftyRSAError(message: \"Provided key doesn't have a valid ASN.1 structure (first byte should be 0x30 == SEQUENCE)\")\n//    }\n//\n//    index += 1\n//    if byteArray[index] > 0x80 {\n//        index += Int(byteArray[index]) - 0x80 + 1\n//    } else {\n//        index += 1\n//    }\n//\n//    // If current byte marks an integer (0x02), it means the key doesn't have a X509 header and just\n//    // contains its modulo & public exponent. In this case, we can just return the provided DER data as is.\n//    if Int(byteArray[index]) == 0x02 {\n//        return keyData\n//    }\n//\n//    // Now that we've excluded the possibility of headerless key, we're looking for a valid X509 header sequence.\n//    // It should look like this:\n//    // 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00\n//    guard Int(byteArray[index]) == 0x30 else {\n//        throw SwiftyRSAError(message: \"Provided key doesn't have a valid X509 header\")\n//    }\n//\n//    index += 15\n//    if byteArray[index] != 0x03 {\n//        throw SwiftyRSAError(message: \"Invalid byte at index \\(index - 1) (\\(byteArray[index - 1])) for public key header\")\n//    }\n//\n//    index += 1\n//    if byteArray[index] > 0x80 {\n//        index += Int(byteArray[index]) - 0x80 + 1\n//    } else {\n//        index += 1\n//    }\n//\n//    guard byteArray[index] == 0 else {\n//        throw SwiftyRSAError(message: \"Invalid byte at index \\(index - 1) (\\(byteArray[index - 1])) for public key header\")\n//    }\n//\n//    index += 1\n//\n//    let strippedKeyBytes = [UInt8](byteArray[index...keyData.count - 1])\n//    let data = Data(bytes: UnsafePointer<UInt8>(strippedKeyBytes), count: keyData.count - index)\n//\n//    return data\n//}\ntypedef NS_ENUM(NSInteger, JWTPublicHeaderStrippingError) {\n    JWTPublicHeaderStrippingError_KeyIsEmpty = -200,\n    JWTPublicHeaderStrippingError_Invalid_ASN1_Structure,\n    JWTPublicHeaderStrippingError_Invalid_X509_Header,\n    JWTPublicHeaderStrippingError_Invalid_Byte_At_Index,\n};\n+ (NSDictionary *)publicHeaderStrippingMessagesAndCodes {\n    static NSDictionary *publicHeaderStrippingMessagesAndCodes = nil;\n    return publicHeaderStrippingMessagesAndCodes ?:\n    (publicHeaderStrippingMessagesAndCodes = @{\n        @(JWTPublicHeaderStrippingError_KeyIsEmpty) : @\"Provided public key is empty\",\n        @(JWTPublicHeaderStrippingError_Invalid_ASN1_Structure) : @\"Provided key doesn't have a valid ASN.1 structure (first byte should be 0x30 == SEQUENCE)\",\n        @(JWTPublicHeaderStrippingError_Invalid_X509_Header) : @\"Provided key doesn't have a valid X509 header\",\n        @(JWTPublicHeaderStrippingError_Invalid_Byte_At_Index) : @\"Invalid byte at index (index - 1) ((bytes[index - 1])) for public key header. Access as error.userInfo[Parameters][index] or error.userInfo[Parameters][byte]\"\n    });\n}\n+ (NSString *)stringForPublicHeaderStrippingErrorCode:(NSInteger)code {\n    return [self publicHeaderStrippingMessagesAndCodes][@(code)] ?: @\"Unknown Public Header Stripping Error\";\n}\n+ (NSError*)publicHeaderStrippingErrorForCode:(NSInteger)code parameters:(NSDictionary *)parameters {\n    return [NSError errorWithDomain:@\"io.jwt.crypto.stripping_public_header\" code:code userInfo:@{\n                                                                                                  @\"Parameters\" : parameters ?: [NSNull null],NSLocalizedDescriptionKey: [self stringForPublicHeaderStrippingErrorCode:code]\n                                                                                                  }];\n}\n+ (NSError*)publicHeaderStrippingErrorForCode:(NSInteger)code {\n    return [self publicHeaderStrippingErrorForCode:code parameters:nil];\n}\n+ (NSData *)dataByRemovingPublicKeyHeader:(NSData *)data error:(NSError *__autoreleasing *)error {\n    NSError *currentError = nil;\n    NSData *currentData = [data copy];\n    //    let count = keyData.count / MemoryLayout<CUnsignedChar>.size\n    //\n    //    guard count > 0 else {\n    //        throw SwiftyRSAError(message: \"Provided public key is empty\")\n    //    }\n    NSInteger countOfBytes = currentData.length / [JWTMemoryLayout createWithType:[JWTMemoryLayout typeUInt8]].size;\n    if (countOfBytes == 0) {\n        //        throw SwiftyRSAError(message: \"Provided public key is empty\")\n        currentError = [self publicHeaderStrippingErrorForCode:JWTPublicHeaderStrippingError_KeyIsEmpty];\n        if (error) {\n            *error = currentError;\n        }\n        return nil;\n    }\n    //    var byteArray = [UInt8](repeating: 0, count: count)\n    //    (keyData as NSData).getBytes(&byteArray, length: keyData.count)\n//    UInt8 *bytes = (UInt8*)malloc(countOfBytes);\n    UInt8 *bytes = (UInt8 *)[currentData bytes];\n//    memcpy(bytes, [currentData bytes], countOfBytes);\n\n    //    var index = 0\n    //    guard byteArray[index] == 0x30 else {\n    //        throw SwiftyRSAError(message: \"Provided key doesn't have a valid ASN.1 structure (first byte should be 0x30 == SEQUENCE)\")\n    //    }\n\n    UInt8 index = 0;\n    if (bytes[index] != 0x30) {\n        //        throw SwiftyRSAError(message: \"Provided key doesn't have a valid ASN.1 structure (first byte should be 0x30 == SEQUENCE)\")\n        currentError = [self publicHeaderStrippingErrorForCode:JWTPublicHeaderStrippingError_Invalid_ASN1_Structure];\n        if (error) {\n            *error = currentError;\n        }\n        return nil;\n    }\n\n    //    index += 1\n    //    if byteArray[index] > 0x80 {\n    //        index += Int(byteArray[index]) - 0x80 + 1\n    //    } else {\n    //        index += 1\n    //    }\n    index += 1;\n    if (bytes[index] > 0x80) {\n        index += (SInt8)bytes[index] - 0x80 + 1;\n    }\n    else {\n        index += 1;\n    }\n\n    // Headerless!\n    //    // If current byte marks an integer (0x02), it means the key doesn't have a X509 header and just\n    //    // contains its modulo & public exponent. In this case, we can just return the provided DER data as is.\n    //    if Int(byteArray[index]) == 0x02 {\n    //        return keyData\n    //    }\n    if ((SInt8)bytes[index] == 0x02) {\n        return currentData;\n    }\n\n    // Has header.\n\n    //    // Now that we've excluded the possibility of headerless key, we're looking for a valid X509 header sequence.\n    //    // It should look like this:\n    //    // 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00\n    //    guard Int(byteArray[index]) == 0x30 else {\n    //        throw SwiftyRSAError(message: \"Provided key doesn't have a valid X509 header\")\n    //    }\n    if ((SInt8)bytes[index] != 0x30) {\n        //        throw SwiftyRSAError(message: \"Provided key doesn't have a valid X509 header\")\n        currentError = [self publicHeaderStrippingErrorForCode:JWTPublicHeaderStrippingError_Invalid_X509_Header];\n        if (error) {\n            *error = currentError;\n        }\n        return nil;\n    }\n\n    //    index += 15\n    //    if byteArray[index] != 0x03 {\n    //        throw SwiftyRSAError(message: \"Invalid byte at index \\(index - 1) (\\(byteArray[index - 1])) for public key header\")\n    //    }\n    index += 15;\n    if (bytes[index] != 0x03) {\n        //        throw SwiftyRSAError(message: \"Invalid byte at index \\(index - 1) (\\(byteArray[index - 1])) for public key header\")\n        currentError = [self publicHeaderStrippingErrorForCode:JWTPublicHeaderStrippingError_Invalid_Byte_At_Index parameters:@{@\"index\" : @(index - 1), @\"byte\": @(bytes[index - 1] ?: 0)}];\n        if (error) {\n            *error = currentError;\n        }\n        return nil;\n    }\n    //    index += 1\n    //    if byteArray[index] > 0x80 {\n    //        index += Int(byteArray[index]) - 0x80 + 1\n    //    } else {\n    //        index += 1\n    //    }\n    index += 1;\n    if (bytes[index] > 0x80) {\n        index += (SInt8)bytes[index] - 0x80 + 1;\n    }\n    else {\n        index += 1;\n    }\n    //    guard byteArray[index] == 0 else {\n    //        throw SwiftyRSAError(message: \"Invalid byte at index \\(index - 1) (\\(byteArray[index - 1])) for public key header\")\n    //    }\n    if (bytes[index] != 0) {\n        //        throw SwiftyRSAError(message: \"Invalid byte at index \\(index - 1) (\\(byteArray[index - 1])) for public key header\")\n        currentError = [self publicHeaderStrippingErrorForCode:JWTPublicHeaderStrippingError_Invalid_Byte_At_Index parameters:@{@\"index\" : @(index - 1), @\"byte\": @(bytes[index - 1] ?: 0)}];\n        if (error) {\n            *error = currentError;\n        }\n        return nil;\n    }\n    //    index += 1\n    //\n    //    let strippedKeyBytes = [UInt8](byteArray[index...keyData.count - 1])\n    //    let data = Data(bytes: UnsafePointer<UInt8>(strippedKeyBytes), count: keyData.count - index)\n    index += 1;\n    NSInteger countOfStrippedBytes = currentData.length - index;\n    UInt8 *strippedBytes = (UInt8 *)(bytes + index);\n    NSData *resultData = [[NSData alloc] initWithBytes:strippedBytes length:countOfStrippedBytes];\n    //    return data\n    return resultData;\n}\n+ (NSData *)dataByExtractingKeyFromANS1:(NSData *)data error:(NSError *__autoreleasing *)error {\n    if (data == nil) {\n        return nil;\n    }\n    // look for 03 42 00 04\n    \n    int8_t bytesToSearchFor[] = {0x03, 0x42, 0x00, 0x04};\n    int count = sizeof(bytesToSearchFor) / sizeof(bytesToSearchFor[0]);\n    NSData *dataToSearchFor = [NSData dataWithBytes:bytesToSearchFor length:count];\n    NSRange fullRange = NSMakeRange(0, data.length);\n    NSRange foundRange = [data rangeOfData:dataToSearchFor options:0 range:fullRange];\n    \n    NSData *foundData = nil;\n    if (foundRange.location != NSNotFound && foundRange.length != 0) {\n        // try to extract tail of data.\n        // but we should also preserve 0x04.\n        // so, one byte less.\n        NSInteger tailPosition = foundRange.location + foundRange.length - 1;\n        NSInteger length = data.length - tailPosition;\n        if (tailPosition >= 0 && length >= 0) {\n            foundData = [NSData dataWithBytes:((char *)data.bytes) + tailPosition length:length];\n        }\n    }\n    return foundData;\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaim.m",
    "content": "//\n//  JWTClaim.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 13.02.16.\n//  Copyright © 2016 Karma. All rights reserved.\n//\n\n#import \"JWTClaim.h\"\n\n// TODO(3.0): Claim aud should check include in collection?\n// Add claims specification tests.\n// \"iss\" (Issuer) Claim\n// \"sub\" (Subject) Claim\n// \"aud\" (Audience) Claim\n// \"exp\" (Expiration Time) Claim\n// \"nbf\" (Not Before) Claim\n// \"iat\" (Issued At) Claim\n// \"jti\" (JWT ID) Claim\n// \"typ\" (Type) Claim\n// \"scope\" (Scope) Claim\n\n@interface JWTClaimIssuer : JWTClaim\n\n@end\n\n@implementation JWTClaimIssuer\n\n+ (NSString *)name {\n\treturn @\"iss\";\n}\n\n+ (BOOL)verifyValue:(NSString *)value withTrustedValue:(NSString *)trustedValue {\n    return [trustedValue isEqualToString:value];\n}\n\n@end\n\n@interface JWTClaimSubject : JWTClaim\n\n@end\n\n@implementation JWTClaimSubject\n\n+ (NSString *)name {\n\treturn @\"sub\";\n}\n\n+ (BOOL)verifyValue:(NSString *)value withTrustedValue:(NSString *)trustedValue {\n    return [trustedValue isEqualToString:value];\n}\n\n@end\n\n@interface JWTClaimAudience : JWTClaim\n\n@end\n\n// TODO: add array support later\n@implementation JWTClaimAudience\n\n+ (NSString *)name {\n\treturn @\"aud\";\n}\n\n+ (BOOL)verifyValue:(NSString *)value withTrustedValue:(NSString *)trustedValue {\n    return [trustedValue isEqualToString:value];\n}\n\n@end\n\n@interface JWTClaimExpirationTime : JWTClaim\n\n@end\n\n@implementation JWTClaimExpirationTime\n\n+ (NSString *)name {\n\treturn @\"exp\";\n}\n\n+ (BOOL)verifyValue:(NSDate *)value withTrustedValue:(NSDate *)trustedValue {\n    // trustedValue - current date\n    // value - expiration date\n    // trustedValue < value, so\n    return [trustedValue compare:value] == NSOrderedAscending;\n}\n\n@end\n\n@interface JWTClaimNotBefore : JWTClaim\n\n@end\n\n@implementation JWTClaimNotBefore\n\n+ (NSString *)name {\n\treturn @\"nbf\";\n}\n\n+ (BOOL)verifyValue:(NSDate *)value withTrustedValue:(NSDate *)trustedValue {\n    // trustedValue - current date\n    // value - start date\n    // value <= trustedValue, so\n    // trustedValue >= value, which means:\n    // !(trustedValue < value) or NOT OrderedAscending\n    return [trustedValue compare:value] != NSOrderedAscending;\n}\n\n@end\n\n@interface JWTClaimIssuedAt : JWTClaim\n\n@end\n\n@implementation JWTClaimIssuedAt\n\n+ (NSString *)name {\n\treturn @\"iat\";\n}\n\n+ (BOOL)verifyValue:(NSDate *)value withTrustedValue:(NSDate *)trustedValue {\n    // trustedValue - current date\n    // value - issued at date\n    // value < trustedValue, so\n    // trustedValue > value\n    return [trustedValue compare:value] == NSOrderedDescending;\n}\n\n@end\n\n@interface JWTClaimJWTID : JWTClaim\n\n@end\n\n@implementation JWTClaimJWTID\n\n+ (NSString *)name {\n\treturn @\"jti\";\n}\n\n+ (BOOL)verifyValue:(NSString *)value withTrustedValue:(NSString *)trustedValue {\n    return [trustedValue isEqualToString:value];\n}\n\n@end\n\n@interface JWTClaimType : JWTClaim\n\n@end\n\n@implementation JWTClaimType\n\n+ (NSString *)name {\n    return @\"typ\";\n}\n\n+ (BOOL)verifyValue:(NSString *)value withTrustedValue:(NSString *)trustedValue {\n    return [trustedValue isEqualToString:value];\n}\n\n@end\n\n@interface JWTClaimScope : JWTClaim\n\n@end\n\n@implementation JWTClaimScope\n\n+ (NSString *)name {\n    return @\"scope\";\n}\n\n+ (BOOL)verifyValue:(NSString *)value withTrustedValue:(NSString *)trustedValue {\n    return [trustedValue isEqualToString:value];\n}\n\n@end\n\n\n@implementation JWTClaim\n+ (NSString *)name {\n    return @\"\";\n}\n\n+ (NSDictionary *)claimsAndNames {\n    static NSDictionary *dictionary = nil;\n    return dictionary ? dictionary : (dictionary = @{\n\t\t[JWTClaimIssuer name] : [JWTClaimIssuer new],\n\t\t[JWTClaimSubject name] : [JWTClaimSubject new],\n\t\t[JWTClaimAudience name] : [JWTClaimAudience new],\n\t\t[JWTClaimExpirationTime name] : [JWTClaimExpirationTime new],\n\t\t[JWTClaimNotBefore name] : [JWTClaimNotBefore new],\n\t\t[JWTClaimIssuedAt name] : [JWTClaimIssuedAt new],\n\t\t[JWTClaimJWTID name] : [JWTClaimJWTID new],\n\t\t[JWTClaimType name] : [JWTClaimType new],\n        [JWTClaimScope name] : [JWTClaimScope new]\n\t});\n}\n\n+ (instancetype)claimByName:(NSString *)name {    \n    return [self claimsAndNames][name];\n}\n\n+ (BOOL)verifyValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue {\n\treturn NO;\n}\n\n- (BOOL)verifyValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue {\n    return [self.class verifyValue:value withTrustedValue:trustedValue];\n}\n\n@end\n\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimBase.m",
    "content": "//\n//  JWTClaimBase.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 10.08.2020.\n//  Copyright © 2020 JWTIO. All rights reserved.\n//\n\n#import \"JWTClaimBase.h\"\n\n@interface JWTClaimBase ()\n@property (nonatomic, readwrite) NSObject *value;\n@property (copy, nonatomic, readwrite) NSString *name;\n@end\n@implementation JWTClaimBase\n@synthesize value = _value;\n- (instancetype)initWithValue:(NSObject *)value {\n    if (self = [super init]) {\n        self.value = value;\n    }\n    return self;\n}\n\n// MARK: - NSCopying\n- (nonnull id)copyWithZone:(nullable NSZone *)zone {\n    return [self copyWithValue:self.value];\n}\n\n// MARK: - JWTClaimProtocol\n+ (NSString *)name { return @\"\"; }\n- (NSString *)name { return _name ?: self.class.name; }\n- (instancetype)copyWithValue:(NSObject *)value {\n    typeof(self) result = [[self.class alloc] initWithValue:value];\n    result.name = self.name;\n    return result;\n}\n- (instancetype)copyWithName:(NSString *)name {\n    typeof(self) result = [[self.class alloc] initWithValue:self.value];\n    result.name = name;\n    return result;\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimSerializerBase.m",
    "content": "//\n//  JWTClaimSerializerBase.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 30.05.2021.\n//  Copyright © 2021 JWTIO. All rights reserved.\n//\n\n#import \"JWTClaimSerializerBase.h\"\n\n@implementation JWTClaimSerializerBase\n\n- (nonnull NSObject *)deserializedClaimValue:(nonnull NSObject *)value forName:(nonnull NSString *)name {\n    return value;\n}\n\n- (nonnull NSObject *)serializedClaimValue:(nonnull id<JWTClaimProtocol>)claim {\n    return claim.value;\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimSerializerVariations.m",
    "content": "//\n//  JWTClaimSerializerVariations.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 30.05.2021.\n//  Copyright © 2021 JWTIO. All rights reserved.\n//\n\n#import \"JWTClaimSerializerVariations.h\"\n\n@implementation JWTClaimSerializerVariations\n+ (id<JWTClaimSerializerProtocol>)dateAndTimestampTransform {\n    return [JWTClaimSerializerBaseConcreteDateAndTimestamp new];\n}\n+ (id<JWTClaimSerializerProtocol>)identityTransform {\n    return [JWTClaimSerializerBase new];\n}\n@end\n\n@implementation JWTClaimSerializerBaseConcreteDateAndTimestamp\n- (NSObject *)deserializedClaimValue:(NSObject *)value forName:(NSString *)name {\n    if ([value isKindOfClass:NSNumber.class]) {\n        return [NSDate dateWithTimeIntervalSince1970:[(NSNumber *)value doubleValue]];\n    }\n    return value;\n}\n- (NSObject *)serializedClaimValue:(id<JWTClaimProtocol>)claim {\n    __auto_type value = claim.value;\n    if ([value isKindOfClass:NSDate.class]) {\n        return @([(NSDate *)value timeIntervalSince1970]);\n    }\n    return value;\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimVariations.m",
    "content": "//\n//  JWTClaimVariations.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 10.08.2020.\n//  Copyright © 2020 JWTIO. All rights reserved.\n//\n\n#import \"JWTClaimVariations.h\"\n\nNSString *JWTRegisteredClaimNameIssuer = @\"iss\";\nNSString *JWTRegisteredClaimNameSubject = @\"sub\";\nNSString *JWTRegisteredClaimNameAudience = @\"aud\";\nNSString *JWTRegisteredClaimNameExpirationTime = @\"exp\";\nNSString *JWTRegisteredClaimNameNotBefore = @\"nbf\";\nNSString *JWTRegisteredClaimNameIssuedAt = @\"iat\";\nNSString *JWTRegisteredClaimNameJWTID = @\"jti\";\nNSString *JWTRegisteredClaimNameType = @\"typ\";\nNSString *JWTRegisteredClaimNameScope = @\"scope\";\n\n@implementation JWTClaimsNames\n+ (NSString *)issuer { return JWTRegisteredClaimNameIssuer; }\n+ (NSString *)subject { return JWTRegisteredClaimNameSubject; }\n+ (NSString *)audience { return JWTRegisteredClaimNameAudience; }\n+ (NSString *)expirationTime { return JWTRegisteredClaimNameExpirationTime; }\n+ (NSString *)notBefore { return JWTRegisteredClaimNameNotBefore; }\n+ (NSString *)issuedAt { return JWTRegisteredClaimNameIssuedAt; }\n+ (NSString *)jwtID { return JWTRegisteredClaimNameJWTID; }\n+ (NSString *)type { return JWTRegisteredClaimNameType; }\n+ (NSString *)scope { return JWTRegisteredClaimNameScope; }\n@end\n\n@interface JWTClaimBaseConcreteIssuer : JWTClaimBase @end\n@interface JWTClaimBaseConcreteSubject : JWTClaimBase @end\n@interface JWTClaimBaseConcreteAudience : JWTClaimBase @end\n@interface JWTClaimBaseConcreteExpirationTime : JWTClaimBase @end\n@interface JWTClaimBaseConcreteNotBefore : JWTClaimBase @end\n@interface JWTClaimBaseConcreteIssuedAt : JWTClaimBase @end\n@interface JWTClaimBaseConcreteJWTID : JWTClaimBase @end\n@interface JWTClaimBaseConcreteType : JWTClaimBase @end\n@interface JWTClaimBaseConcreteScope : JWTClaimBase @end\n\n@implementation JWTClaimVariations\n+ (id<JWTClaimProtocol>)issuer {\n    return [JWTClaimBaseConcreteIssuer new];\n}\n+ (id<JWTClaimProtocol>)subject {\n    return [JWTClaimBaseConcreteSubject new];\n}\n+ (id<JWTClaimProtocol>)audience {\n    return [JWTClaimBaseConcreteAudience new];\n}\n+ (id<JWTClaimProtocol>)expirationTime {\n    return [JWTClaimBaseConcreteExpirationTime new];\n}\n+ (id<JWTClaimProtocol>)notBefore {\n    return [JWTClaimBaseConcreteNotBefore new];\n}\n+ (id<JWTClaimProtocol>)issuedAt {\n    return [JWTClaimBaseConcreteIssuedAt new];\n}\n+ (id<JWTClaimProtocol>)jwtID {\n    return [JWTClaimBaseConcreteJWTID new];\n}\n+ (id<JWTClaimProtocol>)type {\n    return [JWTClaimBaseConcreteType new];\n}\n+ (id<JWTClaimProtocol>)scope {\n    return [JWTClaimBaseConcreteScope new];\n}\n@end\n\n// MARK: - Base Concrete Claims\n@implementation JWTClaimBaseConcreteIssuer\n+ (NSString *)name { return JWTRegisteredClaimNameIssuer; }\n@end\n\n@implementation JWTClaimBaseConcreteSubject\n+ (NSString *)name { return JWTRegisteredClaimNameSubject; }\n@end\n\n@implementation JWTClaimBaseConcreteAudience\n+ (NSString *)name { return JWTRegisteredClaimNameAudience; }\n@end\n\n@implementation JWTClaimBaseConcreteExpirationTime\n+ (NSString *)name { return JWTRegisteredClaimNameExpirationTime; }\n@end\n\n@implementation JWTClaimBaseConcreteNotBefore\n+ (NSString *)name { return JWTRegisteredClaimNameNotBefore; }\n@end\n\n@implementation JWTClaimBaseConcreteIssuedAt\n+ (NSString *)name { return JWTRegisteredClaimNameIssuedAt; }\n@end\n\n@implementation JWTClaimBaseConcreteJWTID\n+ (NSString *)name { return JWTRegisteredClaimNameJWTID; }\n@end\n\n@implementation JWTClaimBaseConcreteType\n+ (NSString *)name { return JWTRegisteredClaimNameType; }\n@end\n\n@implementation JWTClaimBaseConcreteScope\n+ (NSString *)name { return JWTRegisteredClaimNameScope; }\n@end\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimVerifierBase.m",
    "content": "//\n//  JWTClaimVerifierBase.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 30.05.2021.\n//  Copyright © 2021 JWTIO. All rights reserved.\n//\n\n#import \"JWTClaimVerifierBase.h\"\n\n@implementation JWTClaimVerifierBase\n- (BOOL)verifyValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue {\n    return NO;\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimVerifierVariations.m",
    "content": "//\n//  JWTClaimVerifierVariations.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 30.05.2021.\n//  Copyright © 2021 JWTIO. All rights reserved.\n//\n\n#import \"JWTClaimVerifierVariations.h\"\n\n@implementation JWTClaimVerifierVariations\n+ (id<JWTClaimVerifierProtocol>)issuer {\n    return [JWTClaimVerifierBaseConcreteEqualityForString new];\n}\n\n+ (id<JWTClaimVerifierProtocol>)subject {\n    return [JWTClaimVerifierBaseConcreteEqualityForString new];\n}\n\n+ (id<JWTClaimVerifierProtocol>)audienceEqualSingle {\n    return [JWTClaimVerifierBaseConcreteEqualityForString new];\n}\n\n+ (id<JWTClaimVerifierProtocol>)audienceInSet {\n    return [JWTClaimVerifierBaseConcreteInclusionInSet new];\n}\n\n// trustedValue - current date\n// value - expiration date\n// trustedValue < value, so\n+ (id<JWTClaimVerifierProtocol>)expirationTime {\n    __auto_type verifier = [JWTClaimVerifierBaseConcreteComparison new];\n    verifier.trustedValueAtLeft = YES;\n    verifier.expectedComparison = NSOrderedAscending;\n    return verifier;\n}\n\n// trustedValue - current date\n// value - start date\n// value <= trustedValue, so\n// trustedValue >= value, which means:\n// !(trustedValue < value) or NOT OrderedAscending\n+ (id<JWTClaimVerifierProtocol>)notBefore {\n    __auto_type verifier = [JWTClaimVerifierBaseConcreteComparison new];\n    verifier.trustedValueAtLeft = YES;\n    verifier.expectedComparison = NSOrderedAscending;\n    verifier.notEqual = YES;\n    return verifier;\n}\n\n// trustedValue - current date\n// value - issued at date\n// value < trustedValue, so\n// trustedValue > value\n+ (id<JWTClaimVerifierProtocol>)issuedAt {\n    __auto_type verifier = [JWTClaimVerifierBaseConcreteComparison new];\n    verifier.trustedValueAtLeft = YES;\n    verifier.expectedComparison = NSOrderedDescending;\n    return verifier;\n}\n\n+ (id<JWTClaimVerifierProtocol>)jwtID {\n    return [JWTClaimVerifierBaseConcreteEqualityForString new];\n}\n\n+ (id<JWTClaimVerifierProtocol>)type {\n    return [JWTClaimVerifierBaseConcreteEqualityForString new];\n}\n\n+ (id<JWTClaimVerifierProtocol>)scope {\n    return [JWTClaimVerifierBaseConcreteEqualityForString new];\n}\n@end\n\n@implementation JWTClaimVerifierBaseConcreteEquality\n- (instancetype)init {\n    if (self = [super init]) {\n        self.equal = YES;\n    }\n    return self;\n}\n- (BOOL)verifyValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue {\n    return [value isEqual:trustedValue] == self.equal;\n}\n@end\n\n@implementation JWTClaimVerifierBaseConcreteComparison\n- (BOOL)verifyValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue {\n    if (self.trustedValueAtLeft) {\n        __auto_type swap = value;\n        value = trustedValue;\n        trustedValue = swap;\n    }\n    if ([value respondsToSelector:@selector(compare:)]) {\n        __auto_type result = (NSComparisonResult)[value performSelector:@selector(compare:) withObject:trustedValue];\n        if (self.notEqual) {\n            return result != self.expectedComparison;\n        }\n        return result == self.expectedComparison;\n    }\n    return NO;\n}\n@end\n\n@implementation JWTClaimVerifierBaseConcreteEqualityForString\n- (BOOL)verifyValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue {\n    if ([value isKindOfClass:NSString.class] && [trustedValue isKindOfClass:NSString.class]) {\n        return [(NSString *)value isEqualToString:(NSString *)trustedValue] == self.equal;\n    }\n    return [super verifyValue:value withTrustedValue:trustedValue];\n}\n@end\n\n@implementation JWTClaimVerifierBaseConcreteInclusionInSet\n- (BOOL)verifyValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue {\n    if ([trustedValue isKindOfClass:NSSet.class]) {\n        return [(NSSet *)trustedValue containsObject:value];\n    }\n    return NO;\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimsProviderBase.m",
    "content": "//\n//  JWTClaimsProviderBase.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 22.05.2021.\n//  Copyright © 2021 JWTIO. All rights reserved.\n//\n\n#import \"JWTClaimsProviderBase.h\"\n#import \"JWTClaimVariations.h\"\n\n@interface JWTClaimsProviderBase ()\n@property (strong, nonatomic, readwrite) NSMutableDictionary <NSString *, id<JWTClaimProtocol>> *claimsAndNames;\n@end\n\n@implementation JWTClaimsProviderBase\n+ (NSDictionary *)createClaimsAndNames {\n    __auto_type issuer = JWTClaimVariations.issuer;\n    __auto_type subject = JWTClaimVariations.subject;\n    __auto_type audience = JWTClaimVariations.audience;\n    __auto_type expirationTime = JWTClaimVariations.expirationTime;\n    __auto_type notBefore = JWTClaimVariations.notBefore;\n    __auto_type issuedAt = JWTClaimVariations.issuedAt;\n    __auto_type jwtId = JWTClaimVariations.jwtID;\n    __auto_type type = JWTClaimVariations.type;\n    __auto_type scope = JWTClaimVariations.scope;\n    return @{\n        issuer.name : issuer,\n        subject.name : subject,\n        audience.name : audience,\n        expirationTime.name : expirationTime,\n        notBefore.name : notBefore,\n        issuedAt.name : issuedAt,\n        jwtId.name : jwtId,\n        type.name : type,\n        scope.name : scope\n    };\n}\n\n- (instancetype)init {\n    return [self initWithClaimsAndNames:self.class.createClaimsAndNames];\n}\n\n- (instancetype)initWithClaimsAndNames:(NSDictionary *)dictionary {\n    if (self = [super init]) {\n        self.claimsAndNames = [NSMutableDictionary dictionaryWithDictionary:dictionary];\n    }\n    return self;\n}\n\n// MARK: - JWTClaimsProviderProtocol\n- (NSArray<NSString *> *)availableClaimsNames {\n    return self.claimsAndNames.allKeys;\n}\n\n- (nonnull id<JWTClaimProtocol>)claimByName:(nonnull NSString *)name {\n    __auto_type claim = self.claimsAndNames[name];\n    return [claim copyWithValue:claim.value];\n}\n\n- (void)registerClaim:(id<JWTClaimProtocol>)claim forClaimName:(NSString *)name {\n    if (name == nil) {\n        return;\n    }\n    self.claimsAndNames[name] = [[claim copyWithName:name] copyWithValue:claim.value];\n}\n\n- (void)unregisterClaimForClaimName:(NSString *)name {\n    if (name == nil) {\n        return;\n    }\n    [self.claimsAndNames removeObjectForKey:name];\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimsSet.m",
    "content": "//\n//  JWTClaimsSet.m\n//  JWT\n//\n//  Created by Klaas Pieter Annema on 31-05-13.\n//  Copyright (c) 2013 Karma. All rights reserved.\n//\n\n#import \"JWTClaimsSet.h\"\n\n@implementation JWTClaimsSet\n\n- (id)copyWithZone:(NSZone *)zone {\n    JWTClaimsSet *newClaimsSet = [[self.class alloc] init];\n    \n    newClaimsSet.issuer = self.issuer;\n    newClaimsSet.subject = self.subject;\n    newClaimsSet.audience = self.audience;\n    newClaimsSet.expirationDate = self.expirationDate;\n    newClaimsSet.notBeforeDate = self.notBeforeDate;\n    newClaimsSet.issuedAt = self.issuedAt;\n    newClaimsSet.identifier = self.identifier;\n    newClaimsSet.type = self.type;\n    newClaimsSet.scope = self.scope;\n\n    return newClaimsSet;\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimsSetBase.m",
    "content": "//\n//  JWTClaimsSetBase.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 10.08.2020.\n//  Copyright © 2020 JWTIO. All rights reserved.\n//\n\n#import \"JWTClaimsSetBase.h\"\n#import \"JWTClaimVariations.h\"\n\n@interface JWTClaimsSetBase ()\n@property (strong, nonatomic, readwrite) NSMutableDictionary <NSString *, id<JWTClaimProtocol>> *namesAndClaims;\n@end\n\n@implementation JWTClaimsSetBase\n- (instancetype)initWithClaims:(nonnull NSArray<id<JWTClaimProtocol>> *)claims {\n    if (self = [super init]) {\n        self.namesAndClaims = [NSMutableDictionary dictionaryWithObjects:claims forKeys:[claims valueForKey:@\"name\"]];\n    }\n    return self;\n}\n\n- (instancetype)init {\n    return [self initWithClaims:@[]];\n}\n\n// MARK: - NSCopying\n- (nonnull id)copyWithZone:(nullable NSZone *)zone {\n    return [self copyWithClaims:self.claims];\n}\n\n// MARK: - JWTClaimsSetProtocol\n- (NSArray<id<JWTClaimProtocol>> *)claims {\n    return self.namesAndClaims.allValues;\n}\n\n- (instancetype)copyWithClaims:(NSArray<id<JWTClaimProtocol>> *)claims {\n    return [[self.class alloc] initWithClaims:claims];\n}\n\n- (id<JWTClaimProtocol>)claimByName:(NSString *)name {\n    if (name == nil) {\n        return nil;\n    }\n    return self.namesAndClaims[name];\n}\n\n- (void)appendClaim:(id<JWTClaimProtocol>)claim {\n    if (claim == nil || claim.name == nil) {\n        return;\n    }\n    \n    if (self.namesAndClaims[claim.name]) {\n        return;\n    }\n    \n    self.namesAndClaims[claim.name] = claim;\n}\n\n- (void)removeClaimByName:(NSString *)name {\n    if (name == nil) {\n        return;\n    }\n    [self.namesAndClaims removeObjectForKey:name];\n}\n\n- (BOOL)isEmpty {\n    return self.namesAndClaims.count == 0;\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimsSetCoordinatorBase.m",
    "content": "//\n//  JWTClaimsSetCoordinatorBase.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 31.05.2021.\n//  Copyright © 2021 JWTIO. All rights reserved.\n//\n\n#import \"JWTClaimsSetCoordinatorBase.h\"\n#import \"JWTClaimsProviderBase.h\"\n#import \"JWTClaimsSetBase.h\"\n#import \"JWTClaimsSetSerializerBase.h\"\n#import \"JWTClaimsSetVerifierBase.h\"\n#import \"JWTClaimsSetDSLBase.h\"\n\n@interface JWTClaimsSetCoordinatorBase ()\n@property (copy, nonatomic, readwrite) id <JWTClaimsSetCoordinatorProtocol> (^configureClaimsSet)(JWTClaimsSetDSLBase *(^)(JWTClaimsSetDSLBase *claimsSetDSL));\n@end\n\n@implementation JWTClaimsSetCoordinatorBase\n- (void)sanitize {\n    self.claimsSetSerializer.claimsProvider = self.claimsProvider;\n    self.claimsSetSerializer.claimsSetStorage = self.claimsSetStorage;\n    self.claimsSetVerifier.claimsProvider = self.claimsProvider;\n}\n- (instancetype)init {\n    if (self = [super init]) {\n        self.claimsProvider = [JWTClaimsProviderBase new];\n        self.claimsSetStorage = [JWTClaimsSetBase new];\n        self.claimsSetSerializer = [JWTClaimsSetSerializerBase new];\n        self.claimsSetVerifier = [JWTClaimsSetVerifierBase new];\n        \n        [self setupFluent];\n        [self sanitize];\n    }\n    return self;\n}\n\n// MARK: - JWTClaimsSetCoordinatorProtocol\n- (void)setClaimsProvider:(id<JWTClaimsProviderProtocol>)claimsProvider {\n    _claimsProvider = claimsProvider;\n    [self sanitize];\n}\n\n- (void)setClaimsSetStorage:(id<JWTClaimsSetProtocol>)claimsSetStorage {\n    _claimsSetStorage = claimsSetStorage;\n    [self sanitize];\n}\n\n- (void)setClaimsSetSerializer:(id<JWTClaimsSetSerializerProtocol>)claimsSetSerializer {\n    _claimsSetSerializer = claimsSetSerializer;\n    [self sanitize];\n}\n\n- (void)setClaimsSetVerifier:(id<JWTClaimsSetVerifierProtocol>)claimsSetVerifier {\n    _claimsSetVerifier = claimsSetVerifier;\n    [self sanitize];\n}\n\n- (JWTClaimsSetDSLBase *)dslDesrciption {\n    return [[JWTClaimsSetDSLBase alloc] initWithClaimsProvider:self.claimsProvider claimsSetStorage:self.claimsSetStorage];\n}\n\n- (instancetype)configureClaimsSet:(JWTClaimsSetDSLBase *(^)(JWTClaimsSetDSLBase *claimsSetDSL))claimsSet {\n    if (claimsSet) {\n        __auto_type dsl = self.dslDesrciption;\n        __auto_type value = claimsSet(dsl);\n        self.claimsSetStorage = value.claimsSetStorage ?: [JWTClaimsSetBase new];\n    }\n    return self;\n}\n\n- (void)registerClaim:(id<JWTClaimProtocol>)claim serializer:(id<JWTClaimSerializerProtocol>)serializer verifier:(id<JWTClaimVerifierProtocol>)verifier forClaimName:(NSString *)name {\n    [self.claimsProvider registerClaim:claim forClaimName:name];\n    [self.claimsSetSerializer registerSerializer:serializer forClaimName:name];\n    [self.claimsSetVerifier registerVerifier:verifier forClaimName:name];\n\n}\n- (void)unregisterClaimWithSerializerAndVerifierForClaimName:(NSString *)name {\n    [self.claimsProvider unregisterClaimForClaimName:name];\n    [self.claimsSetSerializer unregisterSerializerForClaimName:name];\n    [self.claimsSetVerifier unregisterVerifierForClaimName:name];\n}\n\n// MARK: - Fluent\n- (void)setupFluent {\n    __weak typeof(self) weakSelf = self;\n    self.configureClaimsSet = ^(JWTClaimsSetDSLBase *(^block)(JWTClaimsSetDSLBase *claimsSetDSL)) {\n        return [weakSelf configureClaimsSet:block];\n    };\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimsSetDSLBase.m",
    "content": "//\n//  JWTClaimsSetDSLBase.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 31.05.2021.\n//  Copyright © 2021 JWTIO. All rights reserved.\n//\n\n#import \"JWTClaimsSetDSLBase.h\"\n#import \"JWTClaimVariations.h\"\n\n@interface JWTClaimsSetDSLBase ()\n@property (strong, nonatomic, readwrite) id <JWTClaimsProviderProtocol> claimsProvider;\n@property (copy, nonatomic, readwrite) id <JWTClaimsSetProtocol> claimsSetStorage;\n@end\n\n@implementation JWTClaimsSetDSLBase\n- (instancetype)initWithClaimsProvider:(id<JWTClaimsProviderProtocol>)claimsProvider claimsSetStorage:(id<JWTClaimsSetProtocol>)claimsSetStorage {\n    if (self = [self init]) {\n        self.claimsProvider = claimsProvider;\n        self.claimsSetStorage = claimsSetStorage;\n    }\n    return self;\n}\n@end\n\n@implementation JWTClaimsSetDSLBase (DSL)\n- (nullable NSObject *)dslValueForName:(NSString *)name {\n    __auto_type claim = [self.claimsProvider claimByName:name];\n    if (claim == nil) {\n        return nil;\n    }\n    return [self.claimsSetStorage claimByName:name].value;\n}\n- (void)dslSetValue:(NSObject *)value forName:(NSString *)name {\n    __auto_type claim = [self.claimsProvider claimByName:name];\n    if (claim == nil) {\n        return;\n    }\n    [self.claimsSetStorage removeClaimByName:name];\n    [self.claimsSetStorage appendClaim:[claim copyWithValue:value]];\n}\n\n// MARK: - DSL\n- (NSString *)issuer { return (NSString *)[self dslValueForName:JWTClaimsNames.issuer]; }\n- (void)setIssuer:(NSString *)value { [self dslSetValue:value forName:JWTClaimsNames.issuer]; }\n- (NSString *)subject { return (NSString *)[self dslValueForName:JWTClaimsNames.subject]; }\n- (void)setSubject:(NSString *)value { [self dslSetValue:value forName:JWTClaimsNames.subject]; }\n- (NSString *)audience { return (NSString *)[self dslValueForName:JWTClaimsNames.audience]; }\n- (void)setAudience:(NSString *)value { [self dslSetValue:value forName:JWTClaimsNames.audience]; }\n- (NSDate *)expirationDate { return (NSDate *)[self dslValueForName:JWTClaimsNames.expirationTime]; }\n- (void)setExpirationDate:(NSDate *)value { [self dslSetValue:value forName:JWTClaimsNames.expirationTime]; }\n- (NSDate *)notBeforeDate { return (NSDate *)[self dslValueForName:JWTClaimsNames.notBefore]; }\n- (void)setNotBeforeDate:(NSDate *)value { [self dslSetValue:value forName:JWTClaimsNames.notBefore]; }\n- (NSDate *)issuedAt { return (NSDate *)[self dslValueForName:JWTClaimsNames.issuedAt]; }\n- (void)setIssuedAt:(NSDate *)value { [self dslSetValue:value forName:JWTClaimsNames.issuedAt]; }\n- (NSString *)identifier { return (NSString *)[self dslValueForName:JWTClaimsNames.jwtID]; }\n- (void)setIdentifier:(NSString *)value { [self dslSetValue:value forName:JWTClaimsNames.jwtID]; }\n- (NSString *)type { return (NSString *)[self dslValueForName:JWTClaimsNames.type]; }\n- (void)setType:(NSString *)value { [self dslSetValue:value forName:JWTClaimsNames.type]; }\n- (NSString *)scope { return (NSString *)[self dslValueForName:JWTClaimsNames.scope]; }\n- (void)setScope:(NSString *)value { [self dslSetValue:value forName:JWTClaimsNames.scope]; }\n@end\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimsSetSerializer.m",
    "content": "//\n//  JWTClaimsSetSerializer.m\n//  JWT\n//\n//  Created by Klaas Pieter Annema on 31-05-13.\n//  Copyright (c) 2013 Karma. All rights reserved.\n//\n\n#import \"JWTClaimsSetSerializer.h\"\n\n@implementation JWTClaimsSetSerializer\n\n+ (NSArray *)claimsSetKeys\n{\n    return @[@\"iss\", @\"sub\", @\"aud\", @\"exp\", @\"nbf\", @\"iat\", @\"jti\", @\"typ\", @\"scope\"];\n}\n\n+ (NSDictionary *)dictionaryWithClaimsSet:(JWTClaimsSet *)theClaimsSet;\n{\n    NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];\n    [self dictionary:dictionary setObjectIfNotNil:theClaimsSet.issuer forKey:@\"iss\"];\n    [self dictionary:dictionary setObjectIfNotNil:theClaimsSet.subject forKey:@\"sub\"];\n    [self dictionary:dictionary setObjectIfNotNil:theClaimsSet.audience forKey:@\"aud\"];\n    [self dictionary:dictionary setDateIfNotNil:theClaimsSet.expirationDate forKey:@\"exp\"];\n    [self dictionary:dictionary setDateIfNotNil:theClaimsSet.notBeforeDate forKey:@\"nbf\"];\n    [self dictionary:dictionary setDateIfNotNil:theClaimsSet.issuedAt forKey:@\"iat\"];\n    [self dictionary:dictionary setObjectIfNotNil:theClaimsSet.identifier forKey:@\"jti\"];\n    [self dictionary:dictionary setObjectIfNotNil:theClaimsSet.type forKey:@\"typ\"];\n    [self dictionary:dictionary setObjectIfNotNil:theClaimsSet.scope forKey:@\"scope\"];\n\n    return [dictionary copy];\n}\n\n+ (JWTClaimsSet *)claimsSetWithDictionary:(NSDictionary *)theDictionary;\n{\n    JWTClaimsSet *claimsSet = [[JWTClaimsSet alloc] init];\n    claimsSet.issuer = [theDictionary objectForKey:@\"iss\"];\n    claimsSet.subject = [theDictionary objectForKey:@\"sub\"];\n    claimsSet.audience = [theDictionary objectForKey:@\"aud\"];\n    claimsSet.expirationDate = [NSDate dateWithTimeIntervalSince1970:[[theDictionary objectForKey:@\"exp\"] doubleValue]];\n    claimsSet.notBeforeDate = [NSDate dateWithTimeIntervalSince1970:[[theDictionary objectForKey:@\"nbf\"] doubleValue]];\n    claimsSet.issuedAt = [NSDate dateWithTimeIntervalSince1970:[[theDictionary objectForKey:@\"iat\"] doubleValue]];\n    claimsSet.identifier = [theDictionary objectForKey:@\"jti\"];\n    claimsSet.type = [theDictionary objectForKey:@\"typ\"];\n    claimsSet.scope = [theDictionary objectForKey:@\"scope\"];\n\n    return claimsSet;\n}\n\n+ (void)dictionary:(NSMutableDictionary *)theDictionary setObjectIfNotNil:(id)theObject forKey:(id<NSCopying>)theKey;\n{\n    if (!theObject)\n        return;\n    \n    [theDictionary setObject:theObject forKey:theKey];\n}\n\n+ (void)dictionary:(NSMutableDictionary *)theDictionary setDateIfNotNil:(NSDate*)date forKey:(id<NSCopying>)theKey;\n{\n    if (!date)\n        return;\n    NSNumber* value = @((unsigned long)[date timeIntervalSince1970]);\n    \n    [theDictionary setObject:value forKey:theKey];\n}\n\n\n@end\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimsSetSerializerBase.m",
    "content": "//\n//  JWTClaimsSetSerializerBase.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 10.08.2020.\n//  Copyright © 2020 JWTIO. All rights reserved.\n//\n\n#import \"JWTClaimsSetSerializerBase.h\"\n#import \"JWTClaimVariations.h\"\n#import \"JWTClaimSerializerVariations.h\"\n\n@interface JWTClaimsSetSerializerBase ()\n@property (strong, nonatomic, readwrite) NSMutableDictionary <NSString *, id<JWTClaimSerializerProtocol>> *namesAndSerializers;\n@end\n\n@implementation JWTClaimsSetSerializerBase\n+ (NSDictionary *)createNamesAndSerializers {\n    __auto_type expirationTime = JWTClaimsNames.expirationTime;\n    __auto_type notBefore = JWTClaimsNames.notBefore;\n    __auto_type issuedAt = JWTClaimsNames.issuedAt;\n    return @{\n        expirationTime : JWTClaimSerializerVariations.dateAndTimestampTransform,\n        notBefore : JWTClaimSerializerVariations.dateAndTimestampTransform,\n        issuedAt : JWTClaimSerializerVariations.dateAndTimestampTransform,\n    };\n}\n- (instancetype)init {\n    if (self = [super init]) {\n        self.namesAndSerializers = [NSMutableDictionary dictionaryWithDictionary:self.class.createNamesAndSerializers];\n    }\n    return self;\n}\n\n- (NSObject *)deserializedClaimValue:(NSObject *)value forName:(NSString *)name {\n    __auto_type serializer = self.namesAndSerializers[name] ?: [JWTClaimSerializerBase new];\n    return [serializer deserializedClaimValue:value forName:name];\n}\n\n- (NSObject *)serializedClaimValue:(id<JWTClaimProtocol>)claim {\n    __auto_type name = claim.name;\n    __auto_type serializer = self.namesAndSerializers[name] ?: [JWTClaimSerializerBase new];\n    return [serializer serializedClaimValue:claim];\n}\n\n// MARK: - JWTClaimsSetSerializerProtocol\n- (void)registerSerializer:(id<JWTClaimSerializerProtocol>)serializer forClaimName:(NSString *)name {\n    if (name != nil) {\n        self.namesAndSerializers[name] = serializer;\n    }\n}\n- (void)unregisterSerializerForClaimName:(NSString *)name {\n    if (name != nil) {\n        [self.namesAndSerializers removeObjectForKey:name];\n    }\n}\n\n- (nullable id<JWTClaimsSetProtocol>)claimsSetFromDictionary:(nonnull NSDictionary *)dictionary {\n    if (dictionary == nil) {\n        return nil;\n    }\n    \n    if (dictionary.count == 0) {\n        return nil;\n    }\n    \n    __auto_type result = [NSMutableArray new];\n    \n    for (NSString *key in dictionary) {\n        __auto_type claim = [self.claimsProvider claimByName:key];\n        __auto_type skipVerification = self.skipClaimsProviderLookupCheck;\n        if (skipVerification || claim != nil) {\n            __auto_type value = [self deserializedClaimValue:dictionary[key] forName:key];\n            [result addObject:[claim copyWithValue:value]];\n        }\n    }\n    \n    if (result.count == 0) {\n        return nil;\n    }\n    \n    return [self.claimsSetStorage copyWithClaims:result];\n}\n\n- (nullable NSDictionary *)dictionaryFromClaimsSet:(nonnull id<JWTClaimsSetProtocol>)claimsSet {\n    if (claimsSet == nil) {\n        return nil;\n    }\n    \n    if (claimsSet.isEmpty) {\n        return nil;\n    }\n    \n    __auto_type result = [NSMutableDictionary new];\n    \n    for (id<JWTClaimProtocol> value in claimsSet.claims) {\n        __auto_type claim = [self.claimsProvider claimByName:value.name];\n        __auto_type skipVerification = self.skipClaimsProviderLookupCheck;\n        if (skipVerification || claim != nil) {\n            result[value.name] = [self serializedClaimValue:value];\n        }\n    }\n    \n    if (result.count == 0) {\n        return nil;\n    }\n    \n    return [NSDictionary dictionaryWithDictionary:result];\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimsSetVerifier.m",
    "content": "//\n//  JWTClaimsSetVerifier.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 13.02.16.\n//  Copyright © 2016 Karma. All rights reserved.\n//\n\n#import \"JWTClaimsSetVerifier.h\"\n#import \"JWTClaimsSetSerializer.h\"\n#import \"JWTClaim.h\"\n\n@implementation JWTClaimsSetVerifier\n\n+ (BOOL)verifyDictionary:(NSDictionary *)dictionary withTrustedDictionary:(NSDictionary *)trustedDictionary byKey:(NSString *)key {\n    NSObject *value = dictionary[key];\n    NSObject *trustedValue = trustedDictionary[key];\n    \n    BOOL result = YES;\n    \n    if (trustedValue) {\n        result = [[JWTClaim claimByName:key] verifyValue:value withTrustedValue:trustedValue];\n    }\n    \n    return result;\n}\n\n+ (BOOL)verifyClaimsSetDictionary:(NSDictionary *)theClaimsSetDictionary withTrustedClaimsSetDictionary:(NSDictionary *)trustedClaimsSetDictionary {\n    \n    NSArray *claimsSets = [JWTClaimsSetSerializer claimsSetKeys];\n    \n    if (!trustedClaimsSetDictionary) {\n        return YES;\n    }\n    \n    if (!theClaimsSetDictionary) {\n        return NO;\n    }\n    \n    BOOL result = YES;\n    \n    for (NSString *key in claimsSets) {\n        result = result && [self verifyDictionary:theClaimsSetDictionary withTrustedDictionary:trustedClaimsSetDictionary byKey:key];\n    }\n    \n    return result;\n}\n\n\n+ (BOOL)verifyClaimsSet:(JWTClaimsSet *)theClaimsSet withTrustedClaimsSet:(JWTClaimsSet *)trustedClaimsSet {\n    \n    NSDictionary *dictionary = [JWTClaimsSetSerializer dictionaryWithClaimsSet:theClaimsSet];\n    \n    NSDictionary *trustedDictionary = [JWTClaimsSetSerializer dictionaryWithClaimsSet:trustedClaimsSet];\n    \n    NSArray *claimsSets = [JWTClaimsSetSerializer claimsSetKeys];\n    \n    BOOL result = YES;\n    for (NSString *key in claimsSets) {\n        result = result && [self verifyDictionary:dictionary withTrustedDictionary:trustedDictionary byKey:key];\n    }\n    \n    return result;\n}\n\n+ (BOOL)verifyClaimsSetDictionary:(NSDictionary *)theClaimsSetDictionary withTrustedClaimsSet:(JWTClaimsSet *)trustedClaimsSet {\n    NSDictionary *trustedDictionary = [JWTClaimsSetSerializer dictionaryWithClaimsSet:trustedClaimsSet];\n\n    return [self verifyClaimsSetDictionary:theClaimsSetDictionary withTrustedClaimsSetDictionary:trustedDictionary];\n}\n\n@end"
  },
  {
    "path": "Sources/JWT/ClaimSet/JWTClaimsSetVerifierBase.m",
    "content": "//\n//  JWTClaimsSetVerifierBase.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 10.08.2020.\n//  Copyright © 2020 JWTIO. All rights reserved.\n//\n\n#import \"JWTClaimsSetVerifierBase.h\"\n#import \"JWTClaimVariations.h\"\n#import \"JWTClaimVerifierVariations.h\"\n\n@interface JWTClaimsSetVerifierBase ()\n@property (strong, nonatomic, readwrite) NSMutableDictionary <NSString *, id<JWTClaimVerifierProtocol>> *namesAndVerifiers;\n@end\n\n@implementation JWTClaimsSetVerifierBase\n+ (NSDictionary *)createNamesAndVerifiers {\n    __auto_type issuer = JWTClaimsNames.issuer;\n    __auto_type subject = JWTClaimsNames.subject;\n    __auto_type audience = JWTClaimsNames.audience;\n    __auto_type expirationTime = JWTClaimsNames.expirationTime;\n    __auto_type notBefore = JWTClaimsNames.notBefore;\n    __auto_type issuedAt = JWTClaimsNames.issuedAt;\n    __auto_type jwtId = JWTClaimsNames.jwtID;\n    __auto_type type = JWTClaimsNames.type;\n    __auto_type scope = JWTClaimsNames.scope;\n    return @{\n        issuer : JWTClaimVerifierVariations.issuer,\n        subject : JWTClaimVerifierVariations.subject,\n        audience : JWTClaimVerifierVariations.audienceEqualSingle,\n        expirationTime : JWTClaimVerifierVariations.expirationTime,\n        notBefore : JWTClaimVerifierVariations.notBefore,\n        issuedAt : JWTClaimVerifierVariations.issuedAt,\n        jwtId : JWTClaimVerifierVariations.jwtID,\n        type : JWTClaimVerifierVariations.type,\n        scope : JWTClaimVerifierVariations.scope,\n    };\n}\n- (instancetype)init {\n    if (self = [super init]) {\n        self.namesAndVerifiers = [NSMutableDictionary dictionaryWithDictionary:self.class.createNamesAndVerifiers];\n    }\n    return self;\n}\n\n- (BOOL)verifyClaim:(id<JWTClaimProtocol>)claim withValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue {\n    __auto_type verifier = self.namesAndVerifiers[claim.name] ?: [JWTClaimVerifierBase new];\n    return [verifier verifyValue:value withTrustedValue:trustedValue];\n}\n\n// MARK: - JWTClaimsSetVerifierProtocol\n- (void)registerVerifier:(id<JWTClaimVerifierProtocol>)verifier forClaimName:(NSString *)name {\n    if (name != nil) {\n        self.namesAndVerifiers[name] = verifier;\n    }\n}\n\n- (void)unregisterVerifierForClaimName:(NSString *)name {\n    if (name != nil) {\n        [self.namesAndVerifiers removeObjectForKey:name];\n    }\n}\n\n- (BOOL)verifyClaimsSet:(id<JWTClaimsSetProtocol>)theClaimsSet withTrustedClaimsSet:(id<JWTClaimsSetProtocol>)trustedClaimsSet {\n    __auto_type untrustedDictionary = [self.serializer dictionaryFromClaimsSet:theClaimsSet];\n    \n    __auto_type trustedDictionary = [self.serializer dictionaryFromClaimsSet:trustedClaimsSet];\n    \n    if (trustedDictionary == nil) {\n        return YES;\n    }\n    \n    if (untrustedDictionary == nil) {\n        return NO;\n    }\n        \n    for (NSString *key in self.claimsProvider.availableClaimsNames) {\n        __auto_type claim = [self.claimsProvider claimByName:key];\n        if (claim == nil) {\n            return NO;\n        }\n        __auto_type trustedValue = (NSObject *)trustedDictionary[key];\n        __auto_type untrustedValue = (NSObject *)untrustedDictionary[key];\n        \n        if (!trustedValue) {\n            continue;\n        }\n        \n        __auto_type claimVerified = [self verifyClaim:claim withValue:untrustedValue withTrustedValue:trustedValue];\n        if (!claimVerified) {\n            return NO;\n        }\n    }\n    \n    return YES;\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/Coding/JWTBuilder+FluentStyle.m",
    "content": "//\n//  JWTBuilder+FluentStyle.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 15/06/2019.\n//  Copyright © 2019 JWTIO. All rights reserved.\n//\n\n#import \"JWTBuilder+FluentStyle.h\"\n\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wobjc-property-implementation\"\n@implementation JWTBuilder (FluentStyle)\n\n@end\n#pragma clang diagnostic pop\n"
  },
  {
    "path": "Sources/JWT/Coding/JWTCoding+ResultTypes.m",
    "content": "//\n//  JWTCoding+ResultTypes.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 30.11.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\n#import \"JWTCoding+ResultTypes.h\"\n\nstatic NSString *JWTCodingResultHeaders = @\"headers\";\nstatic NSString *JWTCodingResultPayload = @\"payload\";\n\n@implementation JWT (ResultTypes) @end\n\n@implementation JWTCodingResultComponents\n+ (NSString *)headers {\n    return JWTCodingResultHeaders;\n}\n+ (NSString *)payload {\n    return JWTCodingResultPayload;\n}\n@end\n\n// Protected?\n@protocol JWTMutableCodingResultTypeSuccessEncodedProtocol <JWTCodingResultTypeSuccessEncodedProtocol>\n@property (copy, nonatomic, readwrite) NSString *encoded;\n@property (copy, nonatomic, readwrite) NSString *token;\n@end\n\n// Protected?\n@protocol JWTMutableCodingResultTypeSuccessDecodedProtocol <JWTCodingResultTypeSuccessDecodedProtocol>\n@property (copy, nonatomic, readwrite) NSDictionary *headers;\n@property (copy, nonatomic, readwrite) NSDictionary *payload;\n@property (copy, nonatomic, readwrite) id<JWTClaimsSetProtocol> claimsSetStorage;\n@end\n\n// Protected?\n@protocol JWTMutableCodingResultTypeErrorProtocol <JWTCodingResultTypeErrorProtocol>\n@property (copy, nonatomic, readwrite) NSError *error;\n@end\n\n@interface JWTCodingResultTypeSuccess () <JWTMutableCodingResultTypeSuccessEncodedProtocol, JWTMutableCodingResultTypeSuccessDecodedProtocol> @end\n\n@implementation JWTCodingResultTypeSuccess\n@synthesize encoded = _encoded;\n@synthesize headers = _headers;\n@synthesize payload = _payload;\n@synthesize claimsSetStorage = _claimsSetStorage;\n//Not used yet. Could be replacement for _encoded.\n@synthesize token = _token;\n\n- (NSDictionary *)headerAndPayloadDictionary {\n    if (self.headers && self.payload) {\n        return @{\n                 JWTCodingResultComponents.headers: self.headers,\n                 JWTCodingResultComponents.payload: self.payload\n        };\n    }\n    return nil;\n}\n- (instancetype)initWithEncoded:(NSString *)encoded {\n    if (self = [super init]) {\n        self.encoded = encoded;\n    }\n    return self;\n}\n- (instancetype)initWithToken:(NSString *)token {\n    if (self = [super init]) {\n        self.token = token;\n    }\n    return self;\n}\n- (instancetype)initWithHeaders:(NSDictionary *)headers withPayload:(NSDictionary *)payload {\n    if (self = [super init]) {\n        self.headers = headers;\n        self.payload = payload;\n    }\n    return self;\n}\n\n- (instancetype)initWithHeadersAndPayload:(NSDictionary *)headersAndPayloadDictionary {\n    NSDictionary *headers = headersAndPayloadDictionary[JWTCodingResultComponents.headers];\n    NSDictionary *payload = headersAndPayloadDictionary[JWTCodingResultComponents.payload];\n    return [self initWithHeaders:headers withPayload:payload];\n}\n\n- (instancetype)initWithClaimsSetStorage:(id<JWTClaimsSetProtocol>)claimsSetStorage {\n    if (self = [super init]) {\n        self.claimsSetStorage = claimsSetStorage;\n    }\n    return self;\n}\n@end\n\n@interface JWTCodingResultTypeError () <JWTMutableCodingResultTypeErrorProtocol> @end\n\n@implementation JWTCodingResultTypeError\n@synthesize error = _error;\n- (instancetype)initWithError:(NSError *)error {\n    if (self = [super init]) {\n        self.error = error;\n    }\n    return self;\n}\n@end\n\n@interface JWTCodingResultType ()\n@property (strong, nonatomic, readwrite) JWTCodingResultTypeSuccess *successResult;\n@property (strong, nonatomic, readwrite) JWTCodingResultTypeError *errorResult;\n@end\n\n@implementation JWTCodingResultType\n- (instancetype)initWithSuccessResult:(JWTCodingResultTypeSuccess *)success {\n    if (self = [super init]) {\n        self.successResult = success;\n    }\n    return self;\n}\n- (instancetype)initWithErrorResult:(JWTCodingResultTypeError *)error {\n    if (self = [super init]) {\n        self.errorResult = error;\n    }\n    return self;\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/Coding/JWTCoding+VersionOne.m",
    "content": "//\n//  JWTCoding+VersionOne.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 27.11.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\n#import \"JWTCoding+VersionOne.h\"\n#import \"JWTBase64Coder.h\"\n\n#import \"JWTRSAlgorithm.h\"\n\n#import \"JWTAlgorithmFactory.h\"\n#import \"JWTAlgorithmHSBase.h\"\n\n#import \"JWTAlgorithmDataHolder.h\"\n\n#import \"JWTClaimsSetSerializer.h\"\n#import \"JWTClaimsSetVerifier.h\"\n\n#import \"JWTErrorDescription.h\"\n\nstatic inline void setError(NSError **error, NSError* value) {\n    if (error) {\n        *error = value;\n    }\n}\n\n@implementation JWT (VersionOne)\n#pragma mark - Private Methods\n+ (NSString *)encodeSegment:(id)theSegment withError:(NSError **)error\n{\n    NSData *encodedSegmentData = nil;\n    \n    if (theSegment) {\n        encodedSegmentData = [NSJSONSerialization dataWithJSONObject:theSegment options:0 error:error];\n    }\n    else {\n        // error!\n        NSError *generatedError = [JWTErrorDescription errorWithCode:JWTInvalidSegmentSerializationError];\n        if (error) {\n            *error = generatedError;\n        }\n        NSLog(@\"%@ Could not encode segment: %@\", self.class, generatedError.localizedDescription);\n        return nil;\n    }\n    \n    NSString *encodedSegment = nil;\n    \n    if (encodedSegmentData) {\n        encodedSegment = [JWTBase64Coder base64UrlEncodedStringWithData:encodedSegmentData];//[encodedSegmentData base64UrlEncodedString];\n    }\n    \n    return encodedSegment;\n}\n\n+ (NSString *)encodeSegment:(id)theSegment;\n{\n    NSError *error;\n    return [self encodeSegment:theSegment withError:&error];\n}\n\n#pragma mark - Public Methods\n\n+ (NSString *)encodeClaimsSet:(JWTClaimsSet *)theClaimsSet withSecret:(NSString *)theSecret;\n{\n    return [self encodeClaimsSet:theClaimsSet withSecret:theSecret algorithm:[JWTAlgorithmFactory algorithmByName:JWTAlgorithmNameHS512]];\n}\n\n+ (NSString *)encodeClaimsSet:(JWTClaimsSet *)theClaimsSet withSecret:(NSString *)theSecret algorithm:(id<JWTAlgorithm>)theAlgorithm;\n{\n    NSDictionary *payload = [JWTClaimsSetSerializer dictionaryWithClaimsSet:theClaimsSet];\n    return [self encodePayload:payload withSecret:theSecret algorithm:theAlgorithm];\n}\n\n+ (NSString *)encodePayload:(NSDictionary *)thePayload withSecret:(NSString *)theSecret;\n{\n    return [self encodePayload:thePayload withSecret:theSecret algorithm:[JWTAlgorithmFactory algorithmByName:JWTAlgorithmNameHS512]];\n}\n\n+ (NSString *)encodePayload:(NSDictionary *)thePayload withSecret:(NSString *)theSecret algorithm:(id<JWTAlgorithm>)theAlgorithm;\n{\n    return [self encodePayload:thePayload withSecret:theSecret withHeaders:nil algorithm:theAlgorithm];\n}\n\n+ (NSString *)encodePayload:(NSDictionary *)thePayload withSecret:(NSString *)theSecret withHeaders:(NSDictionary *)theHeaders algorithm:(id<JWTAlgorithm>)theAlgorithm;\n{\n    \n    NSError *error = nil;\n    NSString *encodedString = [self encodePayload:thePayload withSecret:theSecret withHeaders:theHeaders algorithm:theAlgorithm withError:&error];\n    \n    if (error) {\n        // do something\n    }\n    \n    return encodedString;\n}\n\n+ (NSString *)encodePayload:(NSDictionary *)thePayload withSecret:(NSString *)theSecret withHeaders:(NSDictionary *)theHeaders algorithm:(id<JWTAlgorithm>)theAlgorithm withError:(NSError * __autoreleasing *)theError;\n{\n    \n    NSDictionary *header = @{@\"typ\": @\"JWT\", @\"alg\": theAlgorithm.name};\n    NSMutableDictionary *allHeaders = [header mutableCopy];\n    \n    if (theHeaders.allKeys.count) {\n        [allHeaders addEntriesFromDictionary:theHeaders];\n    }\n    \n    NSString *headerSegment = [self encodeSegment:[allHeaders copy] withError:theError];\n    \n    if (!headerSegment) {\n        // encode header segment error\n        setError(theError, [JWTErrorDescription errorWithCode:JWTEncodingHeaderError]);\n        return nil;\n    }\n    \n    NSString *payloadSegment = [self encodeSegment:thePayload withError:theError];\n    \n    if (!payloadSegment) {\n        // encode payment segment error\n        setError(theError, [JWTErrorDescription errorWithCode:JWTEncodingPayloadError]);\n        return nil;\n    }\n    \n    if (!theAlgorithm) {\n        // error\n        setError(theError, [JWTErrorDescription errorWithCode:JWTUnsupportedAlgorithmError]);\n        return nil;\n    }\n    \n    NSString *signingInput = [@[headerSegment, payloadSegment] componentsJoinedByString:@\".\"];\n    __auto_type theAlgorithmHolder = [[JWTAlgorithmHolder alloc] initWithAlgorithm:theAlgorithm];\n    NSData *signedOutputData = [theAlgorithmHolder encodePayload:signingInput withSecret:theSecret];\n    NSString *signedOutput = [JWTBase64Coder base64UrlEncodedStringWithData:signedOutputData];\n    \n    return [@[headerSegment, payloadSegment, signedOutput] componentsJoinedByString:@\".\"];\n}\n\n#pragma mark - Decode\n\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withTrustedClaimsSet:(JWTClaimsSet *)theTrustedClaimsSet withError:(NSError *__autoreleasing *)theError withForcedAlgorithmByName:(NSString *)theAlgorithmName\n{\n    return [self decodeMessage:theMessage withSecret:theSecret withTrustedClaimsSet:theTrustedClaimsSet withError:theError withForcedAlgorithmByName:theAlgorithmName withForcedOption:NO];\n}\n\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withTrustedClaimsSet:(JWTClaimsSet *)theTrustedClaimsSet withError:(NSError *__autoreleasing *)theError withForcedOption:(BOOL)theForcedOption\n{\n    return [self decodeMessage:theMessage withSecret:theSecret withTrustedClaimsSet:theTrustedClaimsSet withError:theError withForcedAlgorithmByName:JWTAlgorithmNameHS512 withForcedOption:theForcedOption];\n}\n\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withTrustedClaimsSet:(JWTClaimsSet *)theTrustedClaimsSet withError:(NSError *__autoreleasing *)theError withForcedAlgorithmByName:(NSString *)theAlgorithmName withForcedOption:(BOOL)theForcedOption\n{\n    return [self decodeMessage:theMessage withSecret:theSecret withTrustedClaimsSet:theTrustedClaimsSet withError:theError withForcedAlgorithmByName:theAlgorithmName withForcedOption:theForcedOption withAlgorithmWhiteList:nil];\n}\n\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withTrustedClaimsSet:(JWTClaimsSet *)theTrustedClaimsSet withError:(NSError *__autoreleasing *)theError withForcedAlgorithmByName:(NSString *)theAlgorithmName withForcedOption:(BOOL)theForcedOption withAlgorithmWhiteList:(NSSet *)theWhitelist\n{\n    NSDictionary *dictionary = [self decodeMessage:theMessage withSecret:theSecret withError:theError withForcedAlgorithmByName:theAlgorithmName skipVerification:theForcedOption whitelist:theWhitelist];\n    \n    if (*theError) {\n        // do something\n        return dictionary;\n    }\n    \n    if (theTrustedClaimsSet) {\n        BOOL claimVerified = [JWTClaimsSetVerifier verifyClaimsSet:[JWTClaimsSetSerializer claimsSetWithDictionary:dictionary[@\"payload\"]] withTrustedClaimsSet:theTrustedClaimsSet];\n        if (claimVerified) {\n            return dictionary;\n        }\n        else {\n            setError(theError, [JWTErrorDescription errorWithCode:JWTClaimsSetVerificationFailed]);\n            return nil;\n        }\n    }\n    \n    return dictionary;\n}\n\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withError:(NSError *__autoreleasing *)theError withForcedOption:(BOOL)theForcedOption;\n{\n    return [self decodeMessage:theMessage withSecret:theSecret withError:theError withForcedAlgorithmByName:JWTAlgorithmNameHS512 skipVerification:theForcedOption];\n}\n\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withError:(NSError *__autoreleasing *)theError withForcedAlgorithmByName:(NSString *)theAlgorithmName;\n{\n    return [self decodeMessage:theMessage withSecret:theSecret withError:theError withForcedAlgorithmByName:theAlgorithmName skipVerification:NO];\n}\n\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withError:(NSError *__autoreleasing *)theError withForcedAlgorithmByName:(NSString *)theAlgorithmName skipVerification:(BOOL)skipVerification\n{\n    return [self decodeMessage:theMessage withSecret:theSecret withError:theError withForcedAlgorithmByName:theAlgorithmName skipVerification:skipVerification whitelist:nil];\n}\n\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withError:(NSError *__autoreleasing *)theError withForcedAlgorithmByName:(NSString *)theAlgorithmName skipVerification:(BOOL)skipVerification whitelist:(NSSet *)theWhitelist\n{\n    NSArray *parts = [theMessage componentsSeparatedByString:@\".\"];\n    \n    if (parts.count < 3) {\n        // generate error?\n        setError(theError, [JWTErrorDescription errorWithCode:JWTInvalidFormatError]);\n        return nil;\n    }\n    \n    NSString *headerPart = parts[0];\n    NSString *payloadPart = parts[1];\n    NSString *signedPart = parts[2];\n    \n    // decode headerPart\n    NSError *jsonError = nil;\n    NSData *headerData = [JWTBase64Coder dataWithBase64UrlEncodedString:headerPart];\n    id headerJSON = [NSJSONSerialization JSONObjectWithData:headerData\n                                                    options:0\n                                                      error:&jsonError];\n    if (jsonError) {\n        setError(theError, [JWTErrorDescription errorWithCode:JWTDecodingHeaderError]);\n        return nil;\n    }\n    NSDictionary *header = (NSDictionary *)headerJSON;\n    if (!header) {\n        setError(theError, [JWTErrorDescription errorWithCode:JWTNoHeaderError]);\n        return nil;\n    }\n    \n    if (!skipVerification) {\n        // find algorithm\n        \n        //It is insecure to trust the header's value for the algorithm, since\n        //the signature hasn't been verified yet, so an algorithm must be provided\n        if (!theAlgorithmName) {\n            setError(theError, [JWTErrorDescription errorWithCode:JWTUnspecifiedAlgorithmError]);\n            return nil;\n        }\n        \n        NSString *headerAlgorithmName = header[@\"alg\"];\n        \n        //If the algorithm in the header doesn't match what's expected, verification fails\n        if (![theAlgorithmName isEqualToString:headerAlgorithmName]) {\n            setError(theError, [JWTErrorDescription errorWithCode:JWTUnsupportedAlgorithmError]);\n            return nil;\n        }\n        \n        //If a whitelist is passed in, ensure the chosen algorithm is allowed\n        if (theWhitelist) {\n            if (![theWhitelist containsObject:theAlgorithmName]) {\n                setError(theError, [JWTErrorDescription errorWithCode:JWTUnsupportedAlgorithmError]);\n                return nil;\n            }\n        }\n        \n        id<JWTAlgorithm> algorithm = [JWTAlgorithmFactory algorithmByName:theAlgorithmName];\n        \n        if (!algorithm) {\n            setError(theError, [JWTErrorDescription errorWithCode:JWTUnsupportedAlgorithmError]);\n            return nil;\n        }\n        \n        // Verify the signed part\n        NSString *signingInput = [@[headerPart, payloadPart] componentsJoinedByString:@\".\"];\n        __auto_type theAlgorithmHolder = [[JWTAlgorithmHolder alloc] initWithAlgorithm:algorithm];\n        BOOL signatureValid = [theAlgorithmHolder verifySignedInput:signingInput withSignature:signedPart verificationKey:theSecret];\n        \n        if (!signatureValid) {\n            setError(theError, [JWTErrorDescription errorWithCode:JWTInvalidSignatureError]);\n            return nil;\n        }\n    }\n    \n    // and decode payload\n    jsonError = nil;\n    NSData *payloadData = [JWTBase64Coder dataWithBase64UrlEncodedString:payloadPart];\n    id payloadJSON = [NSJSONSerialization JSONObjectWithData:payloadData\n                                                     options:0\n                                                       error:&jsonError];\n    if (jsonError) {\n        setError(theError, [JWTErrorDescription errorWithCode:JWTDecodingPayloadError]);\n        return nil;\n    }\n    NSDictionary *payload = (NSDictionary *)payloadJSON;\n    \n    if (!payload) {\n        setError(theError, [JWTErrorDescription errorWithCode:JWTNoPayloadError]);\n        return nil;\n    }\n    \n    NSDictionary *result = @{\n                             @\"header\" : header,\n                             @\"payload\" : payload\n                             };\n    \n    return result;\n}\n\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withError:(NSError * __autoreleasing *)theError;\n{\n    return [self decodeMessage:theMessage withSecret:theSecret withError:theError withForcedAlgorithmByName:JWTAlgorithmNameHS512];\n}\n\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret;\n{\n    NSError *error = nil;\n    NSDictionary *dictionary = [self decodeMessage:theMessage withSecret:theSecret withError:&error];\n    if (error) {\n        // do something\n    }\n    return dictionary;\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/Coding/JWTCoding+VersionThree.m",
    "content": "//\n//  JWTCoding+VersionThree.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 27.11.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\n#import \"JWTCoding+VersionThree.h\"\n#import \"JWTAlgorithmDataHolderChain.h\"\n#import \"JWTRSAlgorithm.h\"\n#import \"JWTCoding+ResultTypes.h\"\n#import \"JWTAlgorithmFactory.h\"\n#import \"JWTErrorDescription.h\"\n#import \"JWTBase64Coder.h\"\n#import \"JWTClaimsSetsProtocols.h\"\n#import \"JWTClaimsSetDSLBase.h\"\n\n#import \"JWTAlgorithmDataHolder+FluentStyle.h\"\n#import \"JWTCodingBuilder+FluentStyle.h\"\n\nstatic inline void setError(NSError **error, NSError* value) {\n    if (error) {\n        *error = value;\n    }\n}\n\n@implementation JWT (VersionThree)\n+ (JWTEncodingBuilder *)encodeWithHolders:(NSArray *)holders {\n    return [JWTEncodingBuilder createWithHolders:holders];\n}\n+ (JWTEncodingBuilder *)encodeWithChain:(JWTAlgorithmDataHolderChain *)chain {\n    return [JWTEncodingBuilder createWithChain:chain];\n}\n+ (JWTDecodingBuilder *)decodeWithHolders:(NSArray *)holders {\n    return [JWTDecodingBuilder createWithHolders:holders];\n}\n+ (JWTDecodingBuilder *)decodeWithChain:(JWTAlgorithmDataHolderChain *)chain {\n    return [JWTDecodingBuilder createWithChain:chain];\n}\n@end\n\n@interface JWTCodingBuilder ()\n#pragma mark - Internal\n@property (strong, nonatomic, readwrite) JWTAlgorithmDataHolderChain *internalChain;\n@property (copy, nonatomic, readwrite) NSNumber *internalOptions;\n@property (strong, nonatomic, readwrite) id <JWTStringCoderProtocol> internalTokenCoder;\n@property (strong, nonatomic, readwrite) id <JWTStringCoderProtocol> internalHashCoder;\n\n#pragma mark - Fluent\n@property (copy, nonatomic, readwrite) JWTCodingBuilder *(^chain)(JWTAlgorithmDataHolderChain *chain);\n@property (copy, nonatomic, readwrite) JWTCodingBuilder *(^constructChain)(JWTAlgorithmDataHolderChain *(^block)(void));\n@property (copy, nonatomic, readwrite) JWTCodingBuilder *(^modifyChain)(JWTAlgorithmDataHolderChain *(^block)(JWTAlgorithmDataHolderChain * chain));\n@property (copy, nonatomic, readwrite) JWTCodingBuilder *(^options)(NSNumber *options);\n@property (copy, nonatomic, readwrite) JWTCodingBuilder *(^addHolder)(id<JWTAlgorithmDataHolderProtocol> holder);\n@property (copy, nonatomic, readwrite) JWTCodingBuilder *(^constructHolder)(id<JWTAlgorithmDataHolderProtocol>(^block)(id<JWTAlgorithmDataHolderProtocol> holder));\n@property (copy, nonatomic, readwrite) JWTCodingBuilder *(^tokenCoder)(id<JWTStringCoderProtocol> tokenCoder);\n\n@end\n\n@interface JWTCodingBuilder (Fluent_Setup)\n- (void)setupFluent;\n@end\n\n@implementation JWTCodingBuilder (Fluent_Setup)\n- (instancetype)chain:(JWTAlgorithmDataHolderChain *)chain {\n    self.internalChain = chain;\n    return self;\n}\n- (instancetype)options:(NSNumber *)options {\n    self.internalOptions = options;\n    return self;\n}\n- (instancetype)addHolder:(id<JWTAlgorithmDataHolderProtocol>)holder {\n    self.internalChain = [self.internalChain chainByAppendingHolder:holder];\n    return self;\n}\n- (instancetype)tokenCoder:(id<JWTStringCoderProtocol>)tokenCoder {\n    self.internalTokenCoder = tokenCoder;\n    return self;\n}\n- (void)setupFluent {\n    __weak typeof(self) weakSelf = self;\n    self.chain = ^(JWTAlgorithmDataHolderChain *chain) {\n        return [weakSelf chain:chain];\n    };\n    \n    self.constructChain = ^(JWTAlgorithmDataHolderChain *(^block)(void)) {\n        if (block) {\n            JWTAlgorithmDataHolderChain *chain = block();\n            return [weakSelf chain:chain];\n        }\n        return weakSelf;\n    };\n    \n    self.modifyChain = ^(JWTAlgorithmDataHolderChain *(^block)(JWTAlgorithmDataHolderChain *chain)) {\n        if (block) {\n            JWTAlgorithmDataHolderChain *chain = block(weakSelf.internalChain);\n            return [weakSelf chain:chain];\n        }\n        return weakSelf;\n    };\n\n\n    self.options = ^(NSNumber *options) {\n        return [weakSelf options:options];\n    };\n    \n    self.addHolder = ^(id<JWTAlgorithmDataHolderProtocol> holder) {\n        return [weakSelf addHolder:holder];\n    };\n    \n    self.constructHolder = ^(id<JWTAlgorithmDataHolderProtocol> (^block)(id<JWTAlgorithmDataHolderProtocol> holder)) {\n        if (block) {\n            [weakSelf addHolder:block([JWTAlgorithmBaseDataHolder new])];\n        }\n        return weakSelf;\n    };\n    \n    self.tokenCoder = ^(id<JWTStringCoderProtocol> tokenCoder) {\n        return [weakSelf tokenCoder:tokenCoder];\n    };\n}\n@end\n\n@implementation JWTCodingBuilder\n#pragma mark - Getters\n// Chain always exists\n- (JWTAlgorithmDataHolderChain *)internalChain {\n    return _internalChain ?: (_internalChain = [JWTAlgorithmDataHolderChain new]);\n}\n#pragma mark - Create\n- (instancetype)initWithChain:(JWTAlgorithmDataHolderChain *)chain {\n    if (self = [super init]) {\n        self.internalChain = chain;\n        self.internalTokenCoder = [JWTBase64Coder withBase64String];\n        self.internalHashCoder = [JWTStringCoderForEncoding utf8Encoding];\n        [self setupFluent];\n    }\n    return self;\n}\n+ (instancetype)createWithHolders:(NSArray *)items {\n    return [self createWithChain:[[JWTAlgorithmDataHolderChain alloc] initWithHolders:items]];\n}\n+ (instancetype)createWithChain:(JWTAlgorithmDataHolderChain *)chain {\n    return [[self alloc] initWithChain:chain];\n}\n+ (instancetype)createWithEmptyChain {\n    return [self createWithChain:nil];\n}\n@end\n\n@implementation JWTCodingBuilder (Sugar)\n- (instancetype)and {\n    return self;\n}\n- (instancetype)with {\n    return self;\n}\n@end\n\n@interface JWTEncodingBuilder ()\n#pragma mark - Internal\n@property (copy, nonatomic, readwrite) NSDictionary *internalPayload;\n@property (copy, nonatomic, readwrite) NSDictionary *internalHeaders;\n@property (strong, nonatomic, readwrite) id<JWTClaimsSetCoordinatorProtocol> internalClaimsSetCoordinator;\n@property (copy, nonatomic, readwrite) NSDictionary *internalMixingClaimsPayload;\n\n#pragma mark - Fluent\n@property (copy, nonatomic, readwrite) JWTEncodingBuilder *(^payload)(NSDictionary *payload);\n@property (copy, nonatomic, readwrite) JWTEncodingBuilder *(^headers)(NSDictionary *headers);\n@property (copy, nonatomic, readwrite) JWTEncodingBuilder *(^claimsSetCoordinator)(id<JWTClaimsSetCoordinatorProtocol> claimsSetCoordinator);\n@end\n\n@implementation JWTEncodingBuilder (Setters)\n- (instancetype)payload:(NSDictionary *)payload {\n    self.internalPayload = payload;\n    return self;\n}\n- (instancetype)headers:(NSDictionary *)headers {\n    self.internalHeaders = headers;\n    return self;\n}\n- (instancetype)claimsSetCoordinator:(id<JWTClaimsSetCoordinatorProtocol>)claimsSetCoordinator {\n    self.internalClaimsSetCoordinator = claimsSetCoordinator;\n    return self;\n}\n@end\n\n@implementation JWTEncodingBuilder (Fluent_Setup)\n- (void)setupFluent {\n    [super setupFluent];\n    __weak typeof(self) weakSelf = self;\n    self.payload = ^(NSDictionary *payload) {\n        return [weakSelf payload:payload];\n    };\n    self.headers = ^(NSDictionary *headers) {\n        return [weakSelf headers:headers];\n    };\n    self.claimsSetCoordinator = ^(id<JWTClaimsSetCoordinatorProtocol> claimsSetCoordinator) {\n        return [weakSelf claimsSetCoordinator:claimsSetCoordinator];\n    };\n}\n@end\n\n@implementation JWTEncodingBuilder\n#pragma mark - Getters\n- (NSDictionary *)internalMixingClaimsPayload {\n    NSMutableDictionary *dictionary = [@{} mutableCopy];\n    if (_internalPayload) {\n        [dictionary addEntriesFromDictionary:_internalPayload];\n    }\n    \n    if (_internalClaimsSetCoordinator) {\n        __auto_type claimsDictionary = [_internalClaimsSetCoordinator.claimsSetSerializer dictionaryFromClaimsSet:_internalClaimsSetCoordinator.claimsSetStorage];\n        [dictionary addEntriesFromDictionary:claimsDictionary];\n    }\n    \n    return dictionary;\n}\n\n#pragma mark - Create\n+ (instancetype)encodePayload:(NSDictionary *)payload {\n    return ((JWTEncodingBuilder *)[self createWithEmptyChain]).payload(payload);\n}\n+ (instancetype)encodeClaimsSetWithCoordinator:(id<JWTClaimsSetCoordinatorProtocol>)coordinator {\n    return ((JWTEncodingBuilder *)[self createWithEmptyChain]).claimsSetCoordinator(coordinator);\n}\n@end\n\n@implementation JWTEncodingBuilder (Coding)\n- (JWTCodingResultType *)encode {\n    \n    NSDictionary *headers = self.internalHeaders;\n    NSDictionary *payload = self.internalMixingClaimsPayload;\n    \n    NSString *encodedMessage = nil;\n    NSError *error = nil;\n    \n    NSArray *holders = self.internalChain.holders;\n    // ERROR: HOLDERS ARE EMPTY.\n    if (holders.count == 0) {\n        error = [JWTErrorDescription errorWithCode:JWTDecodingHoldersChainEmptyError];\n    }\n    \n    for (id <JWTAlgorithmDataHolderProtocol>holder in holders) {\n        id <JWTAlgorithm>algorithm = holder.internalAlgorithm;\n        NSData *secretData = holder.internalSecretData;\n        \n        // BUG:\n        // Read about it in\n//        if ([holder isKindOfClass:JWTAlgorithmRSFamilyDataHolder.class]) {\n//            JWTAlgorithmRSFamilyDataHolder *theHolder = (JWTAlgorithmRSFamilyDataHolder *)holder;\n//            BOOL bugExists = (theHolder.internalSignKey != nil || theHolder.internalVerifyKey != nil ) && secretData == nil;\n//            if (bugExists) {\n//                return [[JWTCodingResultType alloc] initWithErrorResult:[[JWTCodingResultTypeError alloc] initWithError:[JWTErrorDescription errorWithCode:JWTHolderSecretDataNotSetError]]];\n//                return nil;\n//            }\n//        }\n        \n        encodedMessage = [self encodeWithAlgorithm:algorithm withHeaders:headers withPayload:payload withSecretData:secretData withError:&error];\n        if (encodedMessage && (error == nil)) {\n            break;\n        }\n    }\n    \n    JWTCodingResultType *result = nil;\n    \n    if (error) {\n        result = [[JWTCodingResultType alloc] initWithErrorResult:[[JWTCodingResultTypeError alloc] initWithError:error]];\n    }\n    else if (encodedMessage) {\n        result = [[JWTCodingResultType alloc] initWithSuccessResult:[[JWTCodingResultTypeSuccess alloc] initWithEncoded:encodedMessage]];\n    }\n    else {\n        NSLog(@\"%@ something went wrong! result is nil!\", self.debugDescription);\n    }\n    \n    return result;\n}\n- (NSString *)encodeWithAlgorithm:(id<JWTAlgorithm>)theAlgorithm withHeaders:(NSDictionary *)theHeaders withPayload:(NSDictionary *)thePayload withSecretData:(NSData *)theSecretData withError:(NSError *__autoreleasing *)theError {\n    // do it!\n    \n    if (!theAlgorithm) {\n        setError(theError, [JWTErrorDescription errorWithCode:JWTUnspecifiedAlgorithmError]);\n        return nil;\n    }\n\n    NSString *theAlgorithmName = [theAlgorithm name];\n    \n    if (!theAlgorithmName) {\n        setError(theError, [JWTErrorDescription errorWithCode:JWTUnsupportedAlgorithmError]);\n        return nil;\n    }\n    \n    NSDictionary *header = @{\n                             @\"alg\": theAlgorithmName,\n                             @\"typ\": @\"JWT\"\n                             };\n    NSMutableDictionary *allHeaders = [header mutableCopy];\n\n    if (theHeaders.allKeys.count > 0) {\n        [allHeaders addEntriesFromDictionary:theHeaders];\n    }\n    \n    NSString *headerSegment = [self.internalTokenCoder stringWithData:[self encodeSegment:[allHeaders copy] withError:nil]];\n    \n    if (!headerSegment) {\n        // encode header segment error\n        setError(theError, [JWTErrorDescription errorWithCode:JWTEncodingHeaderError]);\n        return nil;\n    }\n    \n    NSString *payloadSegment = [self.internalTokenCoder stringWithData:[self encodeSegment:thePayload withError:nil]];\n    \n    if (!payloadSegment) {\n        // encode payment segment error\n        setError(theError, [JWTErrorDescription errorWithCode:JWTEncodingPayloadError]);\n        return nil;\n    }\n\n    NSString *signingInput = [@[headerSegment, payloadSegment] componentsJoinedByString:@\".\"];\n\n    NSString *signedOutput = nil;\n\n    // this happens somewhere outside.\n\n    NSError *algorithmError = nil;\n    if ([theAlgorithm conformsToProtocol:@protocol(JWTRSAlgorithm)]) {\n        theSecretData = theSecretData ?: [NSData data];\n    }\n    if (theSecretData && [theAlgorithm respondsToSelector:@selector(signHash:key:error:)]) {\n        __auto_type hash = [self.internalHashCoder dataWithString:signingInput];\n        __auto_type signedOutputData = [theAlgorithm signHash:hash key:theSecretData error:&algorithmError];\n        signedOutput = [self.internalTokenCoder stringWithData:signedOutputData];\n    }\n\n    if (algorithmError) {\n        // algorithmError\n        setError(theError, algorithmError);\n        return nil;\n    }\n    if (!signedOutput) {\n        // Make sure signing worked (e.g. we may have issues extracting the key from the PKCS12 bundle if passphrase is incorrect)\n        setError(theError, [JWTErrorDescription errorWithCode:JWTEncodingSigningError]);\n        return nil;\n    }\n    \n    return [@[headerSegment, payloadSegment, signedOutput] componentsJoinedByString:@\".\"];\n}\n\n- (NSData *)encodeSegment:(id)theSegment withError:(NSError *__autoreleasing*)error {\n    NSData *encodedSegmentData = nil;\n    \n    if (theSegment) {\n        encodedSegmentData = [NSJSONSerialization dataWithJSONObject:theSegment options:0 error:error];\n    }\n    else {\n        // error!\n        NSError *generatedError = [JWTErrorDescription errorWithCode:JWTInvalidSegmentSerializationError];\n        if (error) {\n            *error = generatedError;\n        }\n        NSLog(@\"%@ Could not encode segment: %@\", self.class, generatedError.localizedDescription);\n        return nil;\n    }\n        \n    return encodedSegmentData;\n}\n\n- (JWTCodingResultType *)result {\n    return self.encode;\n}\n@end\n\n@interface JWTDecodingBuilder ()\n#pragma mark - Internal\n@property (copy, nonatomic, readwrite) NSString *internalMessage;\n@property (strong, nonatomic, readwrite) id<JWTClaimsSetCoordinatorProtocol> internalClaimsSetCoordinator;\n\n#pragma mark - Fluent\n@property (copy, nonatomic, readwrite) JWTDecodingBuilder *(^message)(NSString *message);\n@property (copy, nonatomic, readwrite) JWTDecodingBuilder *(^claimsSetCoordinator)(id<JWTClaimsSetCoordinatorProtocol> claimsSetCoordinator);\n\n@end\n\n@implementation JWTDecodingBuilder (Setters)\n- (instancetype)message:(NSString *)message {\n    self.internalMessage = message;\n    return self;\n}\n- (instancetype)claimsSetCoordinator:(id<JWTClaimsSetCoordinatorProtocol>)claimsSetCoordinator {\n    self.internalClaimsSetCoordinator = claimsSetCoordinator;\n    return self;\n}\n@end\n\n@implementation JWTDecodingBuilder (Fluent_Setup)\n- (void)setupFluent {\n    [super setupFluent];\n    __weak typeof(self) weakSelf = self;\n    self.message = ^(NSString *message) {\n        return [weakSelf message:message];\n    };\n    self.claimsSetCoordinator = ^(id<JWTClaimsSetCoordinatorProtocol> claimsSetCoordinator) {\n        return [weakSelf claimsSetCoordinator:claimsSetCoordinator];\n    };\n}\n@end\n\n@implementation JWTDecodingBuilder\n#pragma mark - Create\n+ (instancetype)decodeMessage:(NSString *)message {\n    return ((JWTDecodingBuilder *)[self createWithEmptyChain]).message(message);\n}\n@end\n\n@implementation JWTDecodingBuilder (Coding)\n- (JWTCodingResultType *)decode {\n    // do!\n    // iterate over items in chain!\n    // and return if everything ok!\n    // or return error!\n    __auto_type error = (NSError *)nil;\n    __auto_type decodedDictionary = (NSDictionary *)nil;\n    __auto_type message = self.internalMessage;\n    __auto_type options = self.internalOptions;\n    __auto_type holders = self.internalChain.holders;\n    __auto_type claimsSetCoordinator = self.internalClaimsSetCoordinator;\n    \n    // ERROR: HOLDERS ARE EMPTY.\n    if (holders.count == 0) {\n        error = [JWTErrorDescription errorWithCode:JWTDecodingHoldersChainEmptyError];\n    }\n    \n    for (id <JWTAlgorithmDataHolderProtocol>holder in self.internalChain.holders) {\n        // try decode!\n        id <JWTAlgorithm> algorithm = holder.internalAlgorithm;\n        NSData *secretData = holder.internalSecretData;\n        // try to retrieve passphrase.\n        decodedDictionary = [self decodeMessage:message secretData:secretData algorithm:algorithm options:options error:&error];\n        if (decodedDictionary && (error == nil)) {\n            break;\n        }\n    }\n    \n    // TODO: claimsSet could be removed.\n    // The claimsSet verification should be computed from payload dictionary.\n    // claimsSet verification.\n    JWTCodingResultType *result = nil;\n    if (error) {\n        return [[JWTCodingResultType alloc] initWithErrorResult:[[JWTCodingResultTypeError alloc] initWithError:error]];\n    }\n    \n    if (claimsSetCoordinator) {\n        __auto_type untrustedClaimsSet = [claimsSetCoordinator.claimsSetSerializer claimsSetFromDictionary:decodedDictionary[JWTCodingResultComponents.payload]];\n        __auto_type trustedClaimsSet = claimsSetCoordinator.claimsSetStorage;\n        __auto_type claimsVerified = [claimsSetCoordinator.claimsSetVerifier verifyClaimsSet:untrustedClaimsSet withTrustedClaimsSet:trustedClaimsSet];\n        if (!claimsVerified) {\n            error = [JWTErrorDescription errorWithCode:JWTClaimsSetVerificationFailed];\n            return [[JWTCodingResultType alloc] initWithErrorResult:[[JWTCodingResultTypeError alloc] initWithError:error]];\n        }\n    }\n    \n    if (decodedDictionary) {\n        NSDictionary *headers = decodedDictionary[JWTCodingResultComponents.headers];\n        NSDictionary *payload = decodedDictionary[JWTCodingResultComponents.payload];\n        id<JWTClaimsSetProtocol> claimsSetStorage = nil;\n        \n        // extract claims from payload.\n        BOOL shouldExtractClaimsSetCoordinator = YES; // add option later.\n        BOOL extractClaimsSetCoordinator = claimsSetCoordinator != nil || shouldExtractClaimsSetCoordinator;\n        if (extractClaimsSetCoordinator) {\n            claimsSetStorage = [self.internalClaimsSetCoordinator.claimsSetSerializer claimsSetFromDictionary:payload];\n        }\n        result = [[JWTCodingResultType alloc] initWithSuccessResult:[[[JWTCodingResultTypeSuccess alloc] initWithHeaders:headers withPayload:payload] initWithClaimsSetStorage:claimsSetStorage]];\n    }\n    else {\n        NSLog(@\"%@ something went wrong! result is nil!\", self.debugDescription);\n    }\n    \n    return result;\n}\n\n// Maybe later add algorithmName\n- (NSDictionary *)decodeMessage:(NSString *)theMessage secretData:(NSData *)theSecretData algorithm:(id<JWTAlgorithm>)theAlgorithm options:(NSNumber *)theOptions error:(NSError *__autoreleasing *)theError {\n    \n    BOOL skipVerification = [theOptions boolValue];\n    NSString *theAlgorithmName = [theAlgorithm name];\n    \n    NSArray *parts = [theMessage componentsSeparatedByString:@\".\"];\n    \n    if (parts.count < 3) {\n        // generate error?\n        setError(theError, [JWTErrorDescription errorWithCode:JWTInvalidFormatError]);\n        return nil;\n    }\n    \n    NSString *headerPart = parts[0];\n    NSString *payloadPart = parts[1];\n    NSString *signaturePart = parts[2];\n    \n    // decode headerPart\n    NSError *jsonError = nil;\n    NSData *headerData = [self.internalTokenCoder dataWithString:headerPart];\n    id headerJSON = [NSJSONSerialization JSONObjectWithData:headerData\n                                                    options:0\n                                                      error:&jsonError];\n    if (jsonError) {\n        setError(theError, [JWTErrorDescription errorWithCode:JWTDecodingHeaderError]);\n        return nil;\n    }\n    NSDictionary *header = (NSDictionary *)headerJSON;\n    if (!header) {\n        setError(theError, [JWTErrorDescription errorWithCode:JWTNoHeaderError]);\n        return nil;\n    }\n    \n    if (!skipVerification) {\n        // find algorithm\n        \n        //It is insecure to trust the header's value for the algorithm, since\n        //the signature hasn't been verified yet, so an algorithm must be provided\n        if (!theAlgorithmName) {\n            setError(theError, [JWTErrorDescription errorWithCode:JWTUnspecifiedAlgorithmError]);\n            return nil;\n        }\n        \n        NSString *headerAlgorithmName = header[@\"alg\"];\n        \n        //If the algorithm in the header doesn't match what's expected, verification fails\n        if (![theAlgorithmName isEqualToString:headerAlgorithmName]) {\n            setError(theError, [JWTErrorDescription errorWithCode:JWTAlgorithmNameMismatchError]);\n            return nil;\n        }\n        \n        // A shit logic, but...\n        // You should copy algorithm if this algorithm conforms to RSAlgorithm (NSCopying).\n        // Now RS Algorithm holds too much. ( All data about keys :/ )\n        // Need further investigation.\n        id<JWTAlgorithm> algorithm = nil;\n        if ([theAlgorithm conformsToProtocol:@protocol(JWTRSAlgorithm)]) {\n            algorithm = [(id<JWTRSAlgorithm>)theAlgorithm copyWithZone:nil];\n            theSecretData = theSecretData ?: [NSData data];\n        }\n        else {\n            algorithm = [JWTAlgorithmFactory algorithmByName:theAlgorithmName];\n        }\n        \n        if (!algorithm) {\n            setError(theError, [JWTErrorDescription errorWithCode:JWTUnsupportedAlgorithmError]);\n            return nil;\n        }\n        \n        // Verify the signed part\n        NSString *signingInput = [@[headerPart, payloadPart] componentsJoinedByString:@\".\"];\n        BOOL signatureValid = NO;\n\n        NSError *algorithmError = nil;\n        if (theSecretData && [algorithm respondsToSelector:@selector(verifyHash:signature:key:error:)]) {\n            __auto_type hash = [self.internalHashCoder dataWithString:signingInput];\n            __auto_type signedInputData = [self.internalTokenCoder dataWithString:signaturePart];\n            signatureValid = [algorithm verifyHash:hash signature:signedInputData key:theSecretData error:&algorithmError];\n        }\n        \n        if (algorithmError) {\n            setError(theError, algorithmError);\n            return nil;\n        }\n        if (!signatureValid) {\n            setError(theError, [JWTErrorDescription errorWithCode:JWTInvalidSignatureError]);\n            return nil;\n        }\n    }\n    \n    // and decode payload\n    jsonError = nil;\n    NSData *payloadData = [self.internalTokenCoder dataWithString:payloadPart];\n    id payloadJSON = [NSJSONSerialization JSONObjectWithData:payloadData\n                                                     options:0\n                                                       error:&jsonError];\n    if (jsonError) {\n        setError(theError, [JWTErrorDescription errorWithCode:JWTDecodingPayloadError]);\n        return nil;\n    }\n    \n    NSDictionary *payload = (NSDictionary *)payloadJSON;\n    \n    if (!payload) {\n        setError(theError, [JWTErrorDescription errorWithCode:JWTNoPayloadError]);\n        return nil;\n    }\n    \n    NSDictionary *result = @{\n                             JWTCodingResultComponents.headers : header,\n                             JWTCodingResultComponents.payload : payload\n                             };\n    \n    setError(theError, nil);\n    \n    return result;\n}\n\n- (JWTCodingResultType *)result {\n    return self.decode;\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/Coding/JWTCoding+VersionTwo.m",
    "content": "//\n//  JWTCoding+VersionTwo.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 27.11.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\n#import \"JWTCoding+VersionTwo.h\"\n#import \"JWTBase64Coder.h\"\n\n#import \"JWTRSAlgorithm.h\"\n\n#import \"JWTAlgorithmFactory.h\"\n\n#import \"JWTAlgorithmDataHolder.h\"\n\n#import \"JWTClaimsSetSerializer.h\"\n#import \"JWTClaimsSetVerifier.h\"\n\n#import \"JWTErrorDescription.h\"\n\nstatic inline void setError(NSError **error, NSError* value) {\n    if (error) {\n        *error = value;\n    }\n}\n\n@implementation JWT (VersionTwo)\n#pragma mark - Builder\n\n+ (JWTBuilder *)encodePayload:(NSDictionary *)payload {\n    return [JWTBuilder encodePayload:payload];\n}\n\n+ (JWTBuilder *)encodeClaimsSet:(JWTClaimsSet *)claimsSet {\n    return [JWTBuilder encodeClaimsSet:claimsSet];\n}\n\n+ (JWTBuilder *)decodeMessage:(NSString *)message {\n    return [JWTBuilder decodeMessage:message];\n}\n@end\n\n@interface JWTBuilder()\n\n@property (copy, nonatomic, readwrite) NSString *jwtMessage;\n@property (copy, nonatomic, readwrite) NSDictionary *jwtPayload;\n@property (copy, nonatomic, readwrite) NSDictionary *jwtHeaders;\n@property (copy, nonatomic, readwrite) JWTClaimsSet *jwtClaimsSet;\n@property (copy, nonatomic, readwrite) NSArray *jwtDataHolders;\n\n@property (copy, nonatomic, readwrite) NSString *jwtSecret;\n@property (copy, nonatomic, readwrite) NSData *jwtSecretData;\n@property (copy, nonatomic, readwrite) NSString *jwtPrivateKeyCertificatePassphrase;\n@property (copy, nonatomic, readwrite) NSError *jwtError;\n@property (strong, nonatomic, readwrite) id<JWTAlgorithm> jwtAlgorithm;\n@property (copy, nonatomic, readwrite) NSString *jwtAlgorithmName;\n@property (copy, nonatomic, readwrite) NSNumber *jwtOptions;\n@property (copy, nonatomic, readwrite) NSSet *algorithmWhitelist;\n\n@property (copy, nonatomic, readwrite) JWTBuilder *(^message)(NSString *message);\n@property (copy, nonatomic, readwrite) JWTBuilder *(^payload)(NSDictionary *payload);\n@property (copy, nonatomic, readwrite) JWTBuilder *(^headers)(NSDictionary *headers);\n@property (copy, nonatomic, readwrite) JWTBuilder *(^claimsSet)(JWTClaimsSet *claimsSet);\n@property (copy, nonatomic, readwrite) JWTBuilder *(^secret)(NSString *secret);\n@property (copy, nonatomic, readwrite) JWTBuilder *(^secretData)(NSData *secretData);\n@property (copy, nonatomic, readwrite) JWTBuilder *(^privateKeyCertificatePassphrase)(NSString *privateKeyCertificatePassphrase);\n@property (copy, nonatomic, readwrite) JWTBuilder *(^algorithm)(id<JWTAlgorithm>algorithm);\n@property (copy, nonatomic, readwrite) JWTBuilder *(^algorithmName)(NSString *algorithmName);\n@property (copy, nonatomic, readwrite) JWTBuilder *(^options)(NSNumber *options);\n@property (copy, nonatomic, readwrite) JWTBuilder *(^whitelist)(NSArray *whitelist);\n@property (copy, nonatomic, readwrite) JWTBuilder * (^addDataHolder)(JWTAlgorithmBaseDataHolder *dataHolder);\n@property (copy, nonatomic, readwrite) JWTBuilder * (^constructDataHolder)(id<JWTAlgorithmDataHolderProtocol> (^block)(void));\n@end\n\n@implementation JWTBuilder (Setters)\n- (instancetype)message:(NSString *)message {\n    self.jwtMessage = message;\n    return self;\n}\n\n- (instancetype)payload:(NSDictionary *)payload {\n    self.jwtPayload = payload;\n    return self;\n}\n\n- (instancetype)headers:(NSDictionary *)headers {\n    self.jwtHeaders = headers;\n    return self;\n}\n\n- (instancetype)claimSet:(JWTClaimsSet *)claimSet {\n    self.jwtClaimsSet = claimSet;\n    return self;\n}\n\n- (instancetype)secret:(NSString *)secret {\n    self.jwtSecret = secret;\n    return self;\n}\n\n- (instancetype)secretData:(NSData *)secretData {\n    self.jwtSecretData = secretData;\n    return self;\n}\n\n- (instancetype)privateKeyCertificatePassphrase:(NSString *)privateKeyCertificatePassphrase {\n    self.jwtPrivateKeyCertificatePassphrase = privateKeyCertificatePassphrase;\n    return self;\n}\n\n- (instancetype)algorithm:(id<JWTAlgorithm>)algorithm {\n    self.jwtAlgorithm = algorithm;\n    return self;\n}\n\n- (instancetype)algorithmName:(NSString *)algorithmName {\n    self.jwtAlgorithmName = algorithmName;\n    return self;\n}\n\n- (instancetype)options:(NSNumber *)options {\n    self.jwtOptions = options;\n    return self;\n}\n\n- (instancetype)whitelist:(NSArray *)whitelist {\n    if (whitelist) {\n        self.algorithmWhitelist = [NSSet setWithArray:whitelist];\n    } else {\n        self.algorithmWhitelist = nil;\n    }\n    return self;\n}\n\n- (instancetype)addDataHolder:(JWTAlgorithmBaseDataHolder *)dataHolder {\n    if (dataHolder) {\n\n    }\n    return self;\n}\n@end\n\n@implementation JWTBuilder\n\n#pragma mark - Getters\n- (id<JWTAlgorithm>)jwtAlgorithm {\n    if (!_jwtAlgorithm) {\n        _jwtAlgorithm = [JWTAlgorithmFactory algorithmByName:_jwtAlgorithmName];\n    }\n    return _jwtAlgorithm;\n}\n\n- (NSDictionary *)jwtPayload {\n    return _jwtClaimsSet ? [JWTClaimsSetSerializer dictionaryWithClaimsSet:_jwtClaimsSet] : _jwtPayload;\n}\n\n#pragma mark - Fluent\n\n- (void)setupFluent {\n    __weak typeof(self) weakSelf = self;\n    self.message = ^(NSString *message) {\n        return [weakSelf message:message];\n    };\n\n    self.payload = ^(NSDictionary *payload) {\n        return [weakSelf payload:payload];\n    };\n\n    self.headers = ^(NSDictionary *headers) {\n        return [weakSelf headers:headers];\n    };\n\n    self.claimsSet = ^(JWTClaimsSet *claimSet) {\n        return [weakSelf claimSet:claimSet];\n    };\n\n    self.secret = ^(NSString *secret) {\n        return [weakSelf secret:secret];\n    };\n\n    self.secretData = ^(NSData *secretData) {\n        return [weakSelf secretData:secretData];\n    };\n\n    self.privateKeyCertificatePassphrase = ^(NSString *privateKeyCertificatePassphrase) {\n        return [weakSelf privateKeyCertificatePassphrase:privateKeyCertificatePassphrase];\n    };\n\n    self.algorithm = ^(id<JWTAlgorithm> algorithm) {\n        return [weakSelf algorithm:algorithm];\n    };\n\n    self.algorithmName = ^(NSString *algorithmName) {\n        return [weakSelf algorithmName:algorithmName];\n    };\n\n    self.options = ^(NSNumber *options) {\n        return [weakSelf options:options];\n    };\n\n    self.whitelist = ^(NSArray *whitelist) {\n        return [weakSelf whitelist:whitelist];\n    };\n\n    self.addDataHolder = ^(JWTAlgorithmBaseDataHolder *holder) {\n        return [weakSelf addDataHolder:holder];\n    };\n\n    self.constructDataHolder = ^(id<JWTAlgorithmDataHolderProtocol> (^block)(void)) {\n        if (block) {\n            return [weakSelf addDataHolder:block()];\n        }\n        return weakSelf;\n    };\n}\n\n#pragma mark - Initialization\n+ (JWTBuilder *)encodePayload:(NSDictionary *)payload {\n    return [[JWTBuilder alloc] init].payload(payload);\n}\n\n+ (JWTBuilder *)encodeClaimsSet:(JWTClaimsSet *)claimsSet {\n    return [[JWTBuilder alloc] init].claimsSet(claimsSet);\n}\n\n+ (JWTBuilder *)decodeMessage:(NSString *)message {\n    return [[JWTBuilder alloc] init].message(message);\n}\n\n- (instancetype)init {\n    if (self = [super init]) {\n        [self setupFluent];\n    }\n    return self;\n}\n\n#pragma mark - Encoding/Decoding\n\n- (NSString *)encode {\n    NSString *result = nil;\n    self.jwtError = nil;\n    result = [self encodeHelper];\n    return result;\n}\n\n- (NSDictionary *)decode {\n    NSDictionary *result = nil;\n    self.jwtError = nil;\n    result = [self decodeHelper];\n\n    return result;\n}\n\n#pragma mark - Private\n\n#pragma mark - Encode Helpers\n\n- (NSString *)encodeHelper\n{\n    if (!self.jwtAlgorithm) {\n        self.jwtError = [JWTErrorDescription errorWithCode:JWTUnspecifiedAlgorithmError];\n        return nil;\n    }\n\n    NSDictionary *header = @{@\"typ\": @\"JWT\", @\"alg\": self.jwtAlgorithm.name};\n    NSMutableDictionary *allHeaders = [header mutableCopy];\n\n    if (self.jwtHeaders.allKeys.count > 0) {\n        [allHeaders addEntriesFromDictionary:self.jwtHeaders];\n    }\n\n    NSString *headerSegment = [self encodeSegment:[allHeaders copy] withError:nil];\n\n    if (!headerSegment) {\n        // encode header segment error\n        self.jwtError = [JWTErrorDescription errorWithCode:JWTEncodingHeaderError];\n        return nil;\n    }\n\n    NSString *payloadSegment = [self encodeSegment:self.jwtPayload withError:nil];\n\n    if (!payloadSegment) {\n        // encode payment segment error\n        self.jwtError = [JWTErrorDescription errorWithCode:JWTEncodingPayloadError];\n        return nil;\n    }\n\n    NSString *signingInput = [@[headerSegment, payloadSegment] componentsJoinedByString:@\".\"];\n\n    NSString *signedOutput;\n\n    if ([self.jwtAlgorithm conformsToProtocol:@protocol(JWTRSAlgorithm)]) {\n        id<JWTRSAlgorithm> jwtRsAlgorithm = (id <JWTRSAlgorithm>) self.jwtAlgorithm;\n        jwtRsAlgorithm.privateKeyCertificatePassphrase = self.jwtPrivateKeyCertificatePassphrase;\n    }\n    __auto_type theAlgorithmHolder = [[JWTAlgorithmHolder alloc] initWithAlgorithm:self.jwtAlgorithm];\n    if (self.jwtSecretData && [theAlgorithmHolder respondsToSelector:@selector(encodePayloadData:withSecret:)]) {\n        NSData *signedOutputData = [theAlgorithmHolder encodePayloadData:[signingInput dataUsingEncoding:NSUTF8StringEncoding] withSecret:self.jwtSecretData];\n\n        signedOutput = [JWTBase64Coder base64UrlEncodedStringWithData:signedOutputData];\n    } else {\n        NSData *signedOutputData = [theAlgorithmHolder encodePayload:signingInput withSecret:self.jwtSecret];\n        signedOutput = [JWTBase64Coder base64UrlEncodedStringWithData:signedOutputData];\n    }\n\n    if (signedOutput) { // Make sure signing worked (e.g. we may have issues extracting the key from the PKCS12 bundle if passphrase is incorrect)\n        return [@[headerSegment, payloadSegment, signedOutput] componentsJoinedByString:@\".\"];\n    } else {\n        self.jwtError = [JWTErrorDescription errorWithCode:JWTEncodingSigningError];\n        return nil;\n    }\n}\n\n- (NSString *)encodeSegment:(id)theSegment withError:(NSError **)error\n{\n    NSData *encodedSegmentData = nil;\n\n    if (theSegment) {\n        encodedSegmentData = [NSJSONSerialization dataWithJSONObject:theSegment options:0 error:error];\n    }\n    else {\n        // error!\n        NSError *generatedError = [JWTErrorDescription errorWithCode:JWTInvalidSegmentSerializationError];\n        if (error) {\n            *error = generatedError;\n        }\n        NSLog(@\"%@ Could not encode segment: %@\", self.class, generatedError.localizedDescription);\n        return nil;\n    }\n\n    NSString *encodedSegment = nil;\n\n    if (encodedSegmentData) {\n        encodedSegment = [JWTBase64Coder base64UrlEncodedStringWithData:encodedSegmentData];\n    }\n\n    return encodedSegment;\n}\n\n#pragma mark - Decode Helpers\n\n- (NSDictionary *)decodeHelper\n{\n    NSError *error = nil;\n    NSDictionary *dictionary = [self decodeMessage:self.jwtMessage withSecret:self.jwtSecret withSecretData:self.jwtSecretData withError:&error withForcedAlgorithmByName:self.jwtAlgorithmName skipVerification:[self.jwtOptions boolValue] whitelist:self.algorithmWhitelist];\n\n    if (error) {\n        self.jwtError = error;\n        return nil;\n    }\n\n    if (self.jwtClaimsSet) {\n        BOOL claimVerified = [JWTClaimsSetVerifier verifyClaimsSet:[JWTClaimsSetSerializer claimsSetWithDictionary:dictionary[@\"payload\"]] withTrustedClaimsSet:self.jwtClaimsSet];\n        if (claimVerified) {\n            return dictionary;\n        }\n        else {\n            self.jwtError = [JWTErrorDescription errorWithCode:JWTClaimsSetVerificationFailed];\n            return nil;\n        }\n    }\n\n    return dictionary;\n}\n\n- (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withSecretData:(NSData *)secretData withError:(NSError *__autoreleasing *)theError withForcedAlgorithmByName:(NSString *)theAlgorithmName skipVerification:(BOOL)skipVerification {\n    NSArray *parts = [theMessage componentsSeparatedByString:@\".\"];\n\n    if (parts.count < 3) {\n        // generate error?\n        setError(theError, [JWTErrorDescription errorWithCode:JWTInvalidFormatError]);\n        return nil;\n    }\n\n    NSString *headerPart = parts[0];\n    NSString *payloadPart = parts[1];\n    NSString *signedPart = parts[2];\n\n    // decode headerPart\n    NSError *jsonError = nil;\n    NSData *headerData = [JWTBase64Coder dataWithBase64UrlEncodedString:headerPart];\n    id headerJSON = [NSJSONSerialization JSONObjectWithData:headerData\n                                                    options:0\n                                                      error:&jsonError];\n    if (jsonError) {\n        setError(theError, [JWTErrorDescription errorWithCode:JWTDecodingHeaderError]);\n        return nil;\n    }\n    NSDictionary *header = (NSDictionary *)headerJSON;\n    if (!header) {\n        setError(theError, [JWTErrorDescription errorWithCode:JWTNoHeaderError]);\n        return nil;\n    }\n\n    if (!skipVerification) {\n        // find algorithm\n\n        //It is insecure to trust the header's value for the algorithm, since\n        //the signature hasn't been verified yet, so an algorithm must be provided\n        if (!theAlgorithmName) {\n            setError(theError, [JWTErrorDescription errorWithCode:JWTUnspecifiedAlgorithmError]);\n            return nil;\n        }\n\n        NSString *headerAlgorithmName = header[@\"alg\"];\n\n        //If the algorithm in the header doesn't match what's expected, verification fails\n        if (![theAlgorithmName isEqualToString:headerAlgorithmName]) {\n            setError(theError, [JWTErrorDescription errorWithCode:JWTAlgorithmNameMismatchError]);\n            return nil;\n        }\n\n        id<JWTAlgorithm> algorithm = [JWTAlgorithmFactory algorithmByName:theAlgorithmName];\n\n        if (!algorithm) {\n            setError(theError, [JWTErrorDescription errorWithCode:JWTUnsupportedAlgorithmError]);\n            return nil;\n            //    NSAssert(!algorithm, @\"Can't decode segment!, %@\", header);\n        }\n\n        // Verify the signed part\n        NSString *signingInput = [@[headerPart, payloadPart] componentsJoinedByString:@\".\"];\n        BOOL signatureValid = NO;\n\n        __auto_type theAlgorithmHolder = [[JWTAlgorithmHolder alloc] initWithAlgorithm:algorithm];\n        if (secretData && [theAlgorithmHolder respondsToSelector:@selector(verifySignedInput:withSignature:verificationKeyData:)]) {\n            signatureValid = [theAlgorithmHolder verifySignedInput:signingInput withSignature:signedPart verificationKeyData:secretData];\n        } else {\n            signatureValid = [theAlgorithmHolder verifySignedInput:signingInput withSignature:signedPart verificationKey:theSecret];\n        }\n\n        if (!signatureValid) {\n            setError(theError, [JWTErrorDescription errorWithCode:JWTInvalidSignatureError]);\n            return nil;\n        }\n    }\n\n    // and decode payload\n    jsonError = nil;\n    NSData *payloadData = [JWTBase64Coder dataWithBase64UrlEncodedString:payloadPart];\n    id payloadJSON = [NSJSONSerialization JSONObjectWithData:payloadData\n                                                     options:0\n                                                       error:&jsonError];\n    if (jsonError) {\n        setError(theError, [JWTErrorDescription errorWithCode:JWTDecodingPayloadError]);\n        return nil;\n    }\n    NSDictionary *payload = (NSDictionary *)payloadJSON;\n\n    if (!payload) {\n        setError(theError, [JWTErrorDescription errorWithCode:JWTNoPayloadError]);\n        return nil;\n    }\n\n    NSDictionary *result = @{\n                             @\"header\" : header,\n                             @\"payload\" : payload\n                             };\n\n    return result;\n}\n\n- (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withSecretData:(NSData *)secretData withError:(NSError *__autoreleasing *)theError withForcedAlgorithmByName:(NSString *)theAlgorithmName skipVerification:(BOOL)skipVerification whitelist:(NSSet *)theWhitelist\n{\n    /*\n     many cases:\n     1. whitelist 1, algorithm 1, match 1\n     everything fine, match exists. just decode by algorithm name.\n     2. whitelist 1, algorithm 0 // match not needed.\n     use every algorithm and try to decode.\n     3. whitelist 1, algorithm 1, match 0\n     throw black list error.\n     4. whitelist 0\n     normal decode by algorithm.\n     */\n    if (theWhitelist) {\n        if (!theAlgorithmName) {\n            // name -> decoding\n            NSMutableArray *tries = [@[] mutableCopy];\n            NSMutableDictionary *result = nil;\n            for (NSString *name in theWhitelist) {\n                // special case for none algorithm.\n                // none algorithm uses\n                // maybe remove later?\n                NSDictionary *try = nil;\n                if ([name isEqualToString:@\"none\"]) {\n                    try = [self decodeMessage:theMessage withSecret:nil withSecretData:nil withError:theError withForcedAlgorithmByName:name skipVerification:skipVerification];\n                }\n                else {\n                    try = [self decodeMessage:theMessage withSecret:theSecret withSecretData:secretData withError:theError withForcedAlgorithmByName:name skipVerification:skipVerification];\n                }\n                if (try) {\n                    result = [try mutableCopy];\n                    result[@\"tries\"] = [tries copy];\n                    setError(theError, nil);\n                    break;\n                }\n                else {\n                    if (theError && *theError) {\n                        [tries addObject:*theError];\n                    }\n                }\n            }\n            return [result copy];\n        }\n        else {\n            //If a whitelist is passed in, ensure the chosen algorithm is allowed\n            if (![theWhitelist containsObject:theAlgorithmName]) {\n                setError(theError, [JWTErrorDescription errorWithCode:JWTBlacklistedAlgorithmError]);\n                return nil;\n            }\n        }\n    }\n\n    return [self decodeMessage:theMessage withSecret:theSecret withSecretData:secretData withError:theError withForcedAlgorithmByName:theAlgorithmName skipVerification:skipVerification];\n}\n\n@end\n"
  },
  {
    "path": "Sources/JWT/Coding/JWTCoding.m",
    "content": "//\n//  JWT.m\n//  JWT\n//\n//  Created by Klaas Pieter Annema on 31-05-13.\n//  Copyright (c) 2013 Karma. All rights reserved.\n//\n\n#import \"JWTCoding.h\"\n\n@implementation JWT @end\n"
  },
  {
    "path": "Sources/JWT/Coding/JWTCodingBuilder+FluentStyle.m",
    "content": "//\n//  JWTCodingBuilder+FluentStyle.m\n//  JWT\n//\n//  Created by Dmitry Lobanov on 07/06/2019.\n//  Copyright © 2019 JWTIO. All rights reserved.\n//\n\n#import \"JWTCodingBuilder+FluentStyle.h\"\n\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wobjc-property-implementation\"\n@implementation JWTCodingBuilder (FluentStyle) \n@end\n\n@implementation JWTEncodingBuilder (FluentStyle)\n@end\n\n@implementation JWTDecodingBuilder (FluentStyle)\n@end\n#pragma clang diagnostic pop\n"
  },
  {
    "path": "Sources/JWT/Supplement/JWTBase64Coder.m",
    "content": "//\n//  JWTBase64Coder.m\n//  Pods\n//\n//  Created by Lobanov Dmitry on 05.10.16.\n//\n//\n\n#import \"JWTBase64Coder.h\"\n\n#ifndef HAS_INCLUDE_MF_Base64Additions_AS_FRAMEWORK\n#define HAS_INCLUDE_MF_Base64Additions_AS_FRAMEWORK (__has_include(<Base64/MF_Base64Additions.h>))\n#endif\n\n#ifndef HAS_INCLUDE_MF_Base64Additions_AS_PLAIN_LIBRARY\n#define HAS_INCLUDE_MF_Base64Additions_AS_PLAIN_LIBRARY (__has_include(\"MF_Base64Additions.h\"))\n#endif\n\n#ifndef HAS_INCLUDE_MF_Base64Additions\n#define HAS_INCLUDE_MF_Base64Additions (HAS_INCLUDE_MF_Base64Additions_AS_FRAMEWORK || HAS_INCLUDE_MF_Base64Additions_AS_PLAIN_LIBRARY)\n#endif\n\n#if HAS_INCLUDE_MF_Base64Additions_AS_FRAMEWORK\n#import <Base64/MF_Base64Additions.h>\n#elif HAS_INCLUDE_MF_Base64Additions_AS_PLAIN_LIBRARY\n#import \"MF_Base64Additions.h\"\n#endif\n\n@interface JWTBase64Coder ()\n@property (assign, nonatomic, readwrite) BOOL isBase64String;\n@end\n\n@implementation JWTBase64Coder\n+ (instancetype)withBase64String {\n    JWTBase64Coder* coder = [[self alloc] init];\n    coder.isBase64String = YES;\n    return coder;\n}\n\n+ (instancetype)withPlainString {\n    JWTBase64Coder* coder = [[self alloc] init];\n    coder.isBase64String = NO;\n    return coder;\n}\n+ (NSString *)base64UrlEncodedStringWithData:(NSData *)data {\n#if HAS_INCLUDE_MF_Base64Additions\n    if ([data respondsToSelector:@selector(base64UrlEncodedString)]) {\n        return [data performSelector:@selector(base64UrlEncodedString)];\n    }\n#endif\n    return [data base64EncodedStringWithOptions:0];\n}\n\n+ (NSData *)dataWithBase64UrlEncodedString:(NSString *)urlEncodedString {\n#if HAS_INCLUDE_MF_Base64Additions\n    if ([[NSData class] respondsToSelector:@selector(dataWithBase64UrlEncodedString:)]) {\n        return [[NSData class] performSelector:@selector(dataWithBase64UrlEncodedString:) withObject:urlEncodedString];\n    }\n#endif\n    return [[NSData alloc] initWithBase64EncodedString:urlEncodedString options:0];\n}\n\n@end\n\n@implementation JWTBase64Coder (JWTStringCoderProtocol)\n- (NSString *)stringWithData:(NSData *)data {\n    NSString *result = nil;\n    if (self.isBase64String) {\n        result = [self.class base64UrlEncodedStringWithData:data];\n    }\n    else {\n        result = [self.class base64UrlEncodedStringWithData:data];\n    }\n    return result;\n}\n- (NSData *)dataWithString:(NSString *)string {\n    NSData *result = nil;\n    if (self.isBase64String) {\n        result = [self.class dataWithBase64UrlEncodedString:string];\n    }\n    else {\n        result = [self.class dataWithBase64UrlEncodedString:[[string dataUsingEncoding:NSUTF8StringEncoding] base64EncodedStringWithOptions:0]];\n    }\n    return result;\n}\n@end\n\n@implementation JWTStringCoderForEncoding\n+ (instancetype)utf8Encoding {\n    __auto_type coding = (JWTStringCoderForEncoding *)[self new];\n    coding.stringEncoding = NSUTF8StringEncoding;\n    return coding;\n}\n@end\n@implementation JWTStringCoderForEncoding (JWTStringCoderProtocol)\n- (NSString *)stringWithData:(NSData *)data {\n    return [[NSString alloc] initWithData:data encoding:self.stringEncoding];\n}\n- (NSData *)dataWithString:(NSString *)string {\n    return [string dataUsingEncoding:self.stringEncoding];\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/Supplement/JWTErrorDescription.m",
    "content": "//\n//  JWTErrorDescription.m\n//  JWT\n//\n//  Created by Lobanov Dmitry on 27.11.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\n#import \"JWTErrorDescription.h\"\nNSString *JWTErrorDomain = @\"io.jwt\";\n@implementation JWTErrorDescription\n+ (NSDictionary *)userDescriptionsAndCodes {\n    static NSDictionary *userDescriptionsAndCodes = nil;\n    return userDescriptionsAndCodes ?: (userDescriptionsAndCodes = @{\n        @(JWTUnexpectedError): @\"JWT unexpected error\",\n        @(JWTInvalidFormatError): @\"Invalid format! Try to check your encoding algorithm. Maybe you put too many dots as delimiters?\",\n        @(JWTUnsupportedAlgorithmError): @\"Unsupported algorithm! You could implement it by yourself\",\n        @(JWTAlgorithmNameMismatchError): @\"Algorithm doesn't match name in header.\",\n        @(JWTInvalidSignatureError): @\"Invalid signature! It seems that signed part of jwt mismatch generated part by algorithm provided in header.\",\n        @(JWTNoPayloadError): @\"No payload! Hey, forget payload?\",\n        @(JWTNoHeaderError): @\"No header! Hmm\",\n        @(JWTEncodingHeaderError): @\"It seems that header encoding failed\",\n        @(JWTEncodingPayloadError): @\"It seems that payload encoding failed\",\n        @(JWTEncodingSigningError): @\"It seems that signing output corrupted. Make sure signing worked (e.g. we may have issues extracting the key from the PKCS12 bundle if passphrase is incorrect).\",\n        @(JWTClaimsSetVerificationFailed): @\"It seems that claims verification failed\",\n        @(JWTInvalidSegmentSerializationError): @\"It seems that json serialization failed for segment\",\n        @(JWTUnspecifiedAlgorithmError): @\"Unspecified algorithm! You must explicitly choose an algorithm to decode with.\",\n        @(JWTBlacklistedAlgorithmError): @\"Algorithm in blacklist? Try to check whitelist parameter\",\n        @(JWTDecodingHeaderError): @\"Error decoding the JWT Header segment.\",\n        @(JWTDecodingPayloadError): @\"Error decoding the JWT Payload segment.\",\n        @(JWTDecodingHoldersChainEmptyError): @\"Error decoding the JWT algorithm and data holders chain is empty!\",\n        @(JWTHolderSecretDataNotSetError): @\"Error encoding/decoding .secretData not set when using sign/verify keys. Bug. Workaround is simple. Set secretData: { holder.secretData([NSData data]); }\"\n    });\n}\n\n+ (NSDictionary *)errorDescriptionsAndCodes {\n    static NSDictionary *errorDescriptionsAndCodes = nil;\n    return errorDescriptionsAndCodes ?: (errorDescriptionsAndCodes = @{\n        @(JWTUnexpectedError): @\"JWTUnexpectedError\",\n        @(JWTInvalidFormatError): @\"JWTInvalidFormatError\",\n        @(JWTUnsupportedAlgorithmError): @\"JWTUnsupportedAlgorithmError\",\n        @(JWTAlgorithmNameMismatchError): @\"JWTAlgorithmNameMismatchError\",\n        @(JWTInvalidSignatureError): @\"JWTInvalidSignatureError\",\n        @(JWTNoPayloadError): @\"JWTNoPayloadError\",\n        @(JWTNoHeaderError): @\"JWTNoHeaderError\",\n        @(JWTEncodingHeaderError): @\"JWTEncodingHeaderError\",\n        @(JWTEncodingPayloadError): @\"JWTEncodingPayloadError\",\n        @(JWTEncodingSigningError): @\"JWTEncodingSigningError\",\n        @(JWTClaimsSetVerificationFailed): @\"JWTClaimsSetVerificationFailed\",\n        @(JWTInvalidSegmentSerializationError): @\"JWTInvalidSegmentSerializationError\",\n        @(JWTUnspecifiedAlgorithmError): @\"JWTUnspecifiedAlgorithmError\",\n        @(JWTBlacklistedAlgorithmError): @\"JWTBlacklistedAlgorithmError\",\n        @(JWTDecodingHeaderError): @\"JWTDecodingHeaderError\",\n        @(JWTDecodingPayloadError): @\"JWTDecodingPayloadError\",\n        @(JWTDecodingHoldersChainEmptyError): @\"JWTDecodingHoldersChainEmptyError\",\n        @(JWTHolderSecretDataNotSetError): @\"JWTHolderSecretDataNotSetError\"\n    });\n}\n\n+ (NSString *)userDescriptionForCode:(JWTError)code {\n    NSString *resultString = [self userDescriptionsAndCodes][@(code)];\n    return resultString ?: @\"Unexpected error\";\n}\n\n+ (NSString *)errorDescriptionForCode:(JWTError)code {\n    NSString *resultString = [self errorDescriptionsAndCodes][@(code)];\n    return resultString ?: @\"JWTUnexpectedError\";\n}\n\n+ (NSError *)errorWithCode:(JWTError)code {\n    return [self errorWithCode:code withUserDescription:[self userDescriptionForCode:code] withErrorDescription:[self errorDescriptionForCode:code]];\n}\n\n+ (NSError *)errorWithCode:(NSInteger)code withUserDescription:(NSString *)userDescription withErrorDescription:(NSString *)errorDescription {\n    return [NSError errorWithDomain:JWTErrorDomain code:code userInfo:@{NSLocalizedDescriptionKey: userDescription, @\"errorDescription\": errorDescription}];\n}\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTAlgorithm.h",
    "content": "//\n//  JWTAlgorithm.h\n//  JWT\n//\n//  Created by Klaas Pieter Annema on 31-05-13.\n//  Copyright (c) 2013 Karma. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTDeprecations.h\"\n\n@protocol JWTAlgorithm <NSObject>\n\n@required\n/**\n Signs data using provided secret data.\n @param hash The data to sign.\n @param key The secret to use for signing.\n @param error The error.\n */\n- (NSData *)signHash:(NSData *)hash key:(NSData *)key error:(NSError *__autoreleasing*)error;\n/**\n Verifies data using key.\n @param hash The data to verify.\n @param signature The secret to use for verifying.\n @param key The key to verify data.\n @param error The error.\n */\n- (BOOL)verifyHash:(NSData *)hash signature:(NSData *)signature key:(NSData *)key error:(NSError *__autoreleasing*)error;\n\n//@required\n\n@property (nonatomic, readonly, copy) NSString *name;\n\n@optional\n/**\n Encodes and encrypts the provided payload using the provided secret key\n @param theString The string to encode\n @param theSecret The secret to use for encryption\n @return An NSData object containing the encrypted payload, or nil if something went wrong.\n */\n- (NSData *)encodePayload:(NSString *)theString withSecret:(NSString *)theSecret __deprecated_and_will_be_removed_in_release_version(JWTVersion_3_0_0);\n\n/**\n Verifies the provided signature using the signed input and verification key\n @param input The header and payload encoded string\n @param signature The JWT provided signature\n @param verificationKey The key to use for verifying the signature\n @return YES if the provided signature is valid, NO otherwise\n */\n- (BOOL)verifySignedInput:(NSString *)input withSignature:(NSString *)signature verificationKey:(NSString *)verificationKey __deprecated_and_will_be_removed_in_release_version(JWTVersion_3_0_0);\n\n@optional\n\n/**\n Encodes and encrypts the provided payload using the provided secret key\n @param theStringData The data to encode\n @param theSecretData The secret data to use for encryption\n @return An NSData object containing the encrypted payload, or nil if something went wrong.\n */\n- (NSData *)encodePayloadData:(NSData *)theStringData withSecret:(NSData *)theSecretData __deprecated_and_will_be_removed_in_release_version(JWTVersion_3_0_0);\n\n/**\n Verifies the provided signature using the signed input and verification key (as data)\n @param input The header and payload encoded string\n @param signature The JWT provided signature\n @param verificationKeyData The key data to use for verifying the signature\n @return YES if the provided signature is valid, NO otherwise\n */\n- (BOOL)verifySignedInput:(NSString *)input withSignature:(NSString *)signature verificationKeyData:(NSData *)verificationKeyData __deprecated_and_will_be_removed_in_release_version(JWTVersion_3_0_0);\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTAlgorithmAsymmetricBase.h",
    "content": "//\n//  JWTAlgorithmAsymmetricBase.h\n//  Base64\n//\n//  Created by Lobanov Dmitry on 12.03.2018.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTRSAlgorithm.h\"\n#import \"JWTAlgorithmErrorDescription.h\"\n\nextern NSString *const JWTAlgorithmAsymmetricFamilyErrorDomain;\ntypedef NS_ENUM(NSInteger, JWTAlgorithmAsymmetricFamilyError) {\n    JWTAlgorithmAsymmetricFamilyErrorInternalSecurityAPI = -98,\n    JWTAlgorithmAsymmetricFamilyErrorAlgorithmIsNotSupported = -50,\n    JWTAlgorithmAsymmetricFamilyErrorUnexpected = -20\n};\n\n@interface JWTAlgorithmAsymmetricFamilyErrorDescription : JWTAlgorithmErrorDescription @end\n\n@interface JWTAlgorithmAsymmetricBase : NSObject @end\n\n@interface JWTAlgorithmAsymmetricBase (JWTAsymmetricKeysAlgorithm) <JWTRSAlgorithm> @end\n\n@interface JWTAlgorithmAsymmetricBase (Create)\n\n// default.\n+ (instancetype)withRS;\n+ (instancetype)withES;\n+ (instancetype)withPS API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));\n- (instancetype)with256;\n- (instancetype)with384;\n- (instancetype)with512;\n\n@end\n\n"
  },
  {
    "path": "Sources/JWT/include/JWTAlgorithmDataHolder+FluentStyle.h",
    "content": "//\n//  JWTAlgorithmDataHolder+FluentStyle.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 07/06/2019.\n//  Copyright © 2019 JWTIO. All rights reserved.\n//\n\n#import \"JWTAlgorithmDataHolder.h\"\n#import \"JWTDeprecations.h\"\n\n#if DEPLOYMENT_RUNTIME_SWIFT\n#else\nNS_ASSUME_NONNULL_BEGIN\n\n// Fluent ( Objective-C exclusive ).\n@interface JWTAlgorithmBaseDataHolder (FluentStyle)\n/**\n Sets jwtSecret and returns the JWTAlgorithmBaseDataHolder to allow for method chaining\n */\n @property (copy, nonatomic, readonly) JWTAlgorithmBaseDataHolder *(^secret)(NSString *secret) NS_SWIFT_UNAVAILABLE(\"\");\n\n/**\n Sets jwtSecretData and returns the JWTAlgorithmBaseDataHolder to allow for method chaining\n */\n@property (copy, nonatomic, readonly) JWTAlgorithmBaseDataHolder *(^secretData)(NSData *secretData) NS_SWIFT_UNAVAILABLE(\"\");\n\n/**\n Sets jwtAlgorithm and returns the JWTAlgorithmBaseDataHolder to allow for method chaining\n */\n@property (copy, nonatomic, readonly) JWTAlgorithmBaseDataHolder *(^algorithm)(id<JWTAlgorithm>algorithm) NS_SWIFT_UNAVAILABLE(\"\");\n\n/**\n Sets jwtAlgorithmName and returns the JWTAlgorithmBaseDataHolder to allow for method chaining. See list of names in appropriate headers.\n */\n@property (copy, nonatomic, readonly) JWTAlgorithmBaseDataHolder *(^algorithmName)(NSString *algorithmName) NS_SWIFT_UNAVAILABLE(\"\");\n\n/**\n Sets stringCoder and returns the JWTAlgorithmBaseDataHolder to allow for method chaining. See list of names in appropriate headers.\n */\n@property (copy, nonatomic, readonly) JWTAlgorithmBaseDataHolder *(^stringCoder)(id<JWTStringCoderProtocol> stringCoder) NS_SWIFT_UNAVAILABLE(\"\");\n@end\n\n@interface JWTAlgorithmRSFamilyDataHolder (FluentStyle)\n/**\n Sets jwtPrivateKeyCertificatePassphrase and returns the JWTAlgorithmRSFamilyDataHolder to allow for method chaining\n */\n@property (copy, nonatomic, readonly) JWTAlgorithmRSFamilyDataHolder *(^privateKeyCertificatePassphrase)(NSString *privateKeyCertificatePassphrase) NS_SWIFT_UNAVAILABLE(\"\");\n@property (copy, nonatomic, readonly) JWTAlgorithmRSFamilyDataHolder *(^keyExtractorType)(NSString *keyExtractorType) NS_SWIFT_UNAVAILABLE(\"\");\n\n// BUG:\n// If you set sign/verify keys, you should also set .secretData([NSData data]);\n// Yes, this is a bug.\n// Please, set it.\n@property (copy, nonatomic, readonly) JWTAlgorithmRSFamilyDataHolder *(^signKey)(id<JWTCryptoKeyProtocol> signKey) NS_SWIFT_UNAVAILABLE(\"\");\n@property (copy, nonatomic, readonly) JWTAlgorithmRSFamilyDataHolder *(^verifyKey)(id<JWTCryptoKeyProtocol> verifyKey) NS_SWIFT_UNAVAILABLE(\"\");\n@end\n\nNS_ASSUME_NONNULL_END\n#endif\n"
  },
  {
    "path": "Sources/JWT/include/JWTAlgorithmDataHolder.h",
    "content": "//\n//  JWTAlgorithmDataHolder.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 31.08.16.\n//  Copyright © 2016 Karma. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTAlgorithm.h\"\n#import \"JWTDeprecations.h\"\n#import \"JWTBase64Coder.h\"\n\n// TODO: available in 3.0\n// All methods with secret as NSString in algorithms will be deprecated or removed.\n\n@protocol JWTAlgorithmDataHolderProtocol <NSObject, NSCopying>\n/**\n The verification key to use when encoding/decoding a JWT in data form\n */\n@property (copy, nonatomic, readwrite) NSData *internalSecretData;\n\n/**\n The <JWTAlgorithm> to use for encoding a JWT\n */\n@property (strong, nonatomic, readwrite) id <JWTAlgorithm> internalAlgorithm;\n\n/**\n The <JWTStringCoderProtocol> string coder. It converts data to string and vice versa.\n Used only for secret <-> secretData conversions.\n */\n@property (strong, nonatomic, readwrite) id <JWTStringCoderProtocol> internalStringCoder;\n@end\n\n@interface JWTAlgorithmBaseDataHolder : NSObject <JWTAlgorithmDataHolderProtocol>\n\n#pragma mark - Getters\n/**\n The verification key to use when encoding/decoding a JWT\n */\n@property (copy, nonatomic, readonly) NSString *internalSecret;\n\n/**\n The algorithm name to use for decoding the JWT. Required unless force decode is true\n */\n@property (copy, nonatomic, readonly) NSString *internalAlgorithmName;\n\n@end\n\n// Available in Swift and Objective-C.\n@interface JWTAlgorithmBaseDataHolder (Setters)\n- (instancetype)secretData:(NSData *)secretData;\n- (instancetype)secret:(NSString *)secret;\n- (instancetype)algorithm:(id<JWTAlgorithm>)algorithm;\n- (instancetype)algorithmName:(NSString *)algorithmName;\n- (instancetype)stringCoder:(id<JWTStringCoderProtocol>)stringCoder;\n@end\n\n@protocol JWTAlgorithmDataHolderCreateProtocol <NSObject>\n\n+ (instancetype)createWithAlgorithm256;\n+ (instancetype)createWithAlgorithm384;\n+ (instancetype)createWithAlgorithm512;\n\n@end\n\n@interface JWTAlgorithmNoneDataHolder : JWTAlgorithmBaseDataHolder @end\n/*\n Default stringCoder is [JWTBase64Coder withPlainString].\n You could set secretData by secret setter ( holder.secret(secretString) ) in plain format e.g. \"secret\".\n */\n@interface JWTAlgorithmHSFamilyDataHolder : JWTAlgorithmBaseDataHolder <JWTAlgorithmDataHolderCreateProtocol>\n@end\n\n@protocol JWTCryptoKeyProtocol;\n\n/*\n JWTAlgorithmRSFamilyDataHolder actually is JWTAlgorithmAsymmetricTypeDataHolder.\n It will be renamed later.\n */\n@interface JWTAlgorithmRSFamilyDataHolder : JWTAlgorithmBaseDataHolder <JWTAlgorithmDataHolderCreateProtocol>\n/*\n Default stringCoder is [JWTBase64Coder withBase64String].\n You could set secretData by secret setter ( holder.secret(secretString) ) in base64 format e.g. put pem file content in it (ugly string with equal sign at the end for example).\n */\n@end\n\n@interface JWTAlgorithmRSFamilyDataHolder (Getters)\n/**\n The passphrase for the PKCS12 blob, which represents the certificate containing the private key for the RS algorithms.\n */\n@property (copy, nonatomic, readonly) NSString *internalPrivateKeyCertificatePassphrase;\n@property (copy, nonatomic, readonly) NSString *internalKeyExtractorType;\n@property (strong, nonatomic, readonly) id<JWTCryptoKeyProtocol> internalSignKey;\n@property (strong, nonatomic, readonly) id<JWTCryptoKeyProtocol> internalVerifyKey;\n@end\n\n// Available in Swift and Objective-C.\n@interface JWTAlgorithmRSFamilyDataHolder (Setters)\n- (instancetype)privateKeyCertificatePassphrase:(NSString *)passphrase;\n- (instancetype)keyExtractorType:(NSString *)type;\n- (instancetype)signKey:(id<JWTCryptoKeyProtocol>)key;\n- (instancetype)verifyKey:(id<JWTCryptoKeyProtocol>)key;\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTAlgorithmDataHolderChain.h",
    "content": "//\n//  JWTAlgorithmDataHolderChain.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 02.10.16.\n//  Copyright © 2016 Karma. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTAlgorithmDataHolder.h\"\n\n@interface JWTAlgorithmDataHolderChain : NSObject\n\n@property (strong, nonatomic, readonly) NSArray *holders;\n\n#pragma mark - Initialization\n- (instancetype)initWithHolders:(NSArray *)holders;\n- (instancetype)initWithHolder:(id<JWTAlgorithmDataHolderProtocol>)holder;\n\n#pragma mark - Appending\n- (instancetype)chainByAppendingChain:(JWTAlgorithmDataHolderChain *)chain;\n- (instancetype)chainByAppendingHolders:(NSArray *)holders;\n- (instancetype)chainByAppendingHolder:(id<JWTAlgorithmDataHolderProtocol>)holder;\n\n#pragma mark - Create\n+ (instancetype)chainWithHolders:(NSArray *)holders;\n+ (instancetype)chainWithHolder:(id<JWTAlgorithmDataHolderProtocol>)holder;\n@end\n\n@interface JWTAlgorithmDataHolderChain (HoldersPopulation)\n- (NSArray *)singleAlgorithm:(id<JWTAlgorithm>)algorithm withManySecretData:(NSArray *)secretsData;\n- (NSArray *)singleSecretData:(NSData *)secretData withManyAlgorithms:(NSArray *)algorithms;\n\n- (instancetype)chainByPopulatingAlgorithm:(id<JWTAlgorithm>)algorithm withManySecretData:(NSArray *)secretsData;\n- (instancetype)chainByPopulatingSecretData:(NSData *)secretData withManyAlgorithms:(NSArray *)algorithms;\n\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTAlgorithmESBase.h",
    "content": "//\n//  JWTAlgorithmESBase.h\n//  Pods\n//\n//  Created by Lobanov Dmitry on 12.02.17.\n//\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTRSAlgorithm.h\"\n\nextern NSString *const JWTAlgorithmNameES256;\nextern NSString *const JWTAlgorithmNameES384;\nextern NSString *const JWTAlgorithmNameES512;\n@interface JWTAlgorithmESBase : NSObject @end\n\n@interface JWTAlgorithmESBase (JWTAsymmetricKeysAlgorithm) <JWTAsymmetricKeysAlgorithm> @end\n\n@interface JWTAlgorithmESBase (Create)\n\n+ (instancetype)algorithm256;\n+ (instancetype)algorithm384;\n+ (instancetype)algorithm512;\n\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTAlgorithmErrorDescription+Subclass.h",
    "content": "//\n//  JWTAlgorithmErrorDescription+Subclass.h\n//  JWT\n//\n//  Created by Dmitry on 7/29/18.\n//  Copyright © 2018 JWTIO. All rights reserved.\n//\n\n#import \"JWTAlgorithmErrorDescription.h\"\n\n@interface JWTAlgorithmErrorDescription (Subclass)\n+ (NSString *)errorDomain;\n\n// Default error code.\n// UnexpectedError for example.\n+ (NSInteger)defaultErrorCode;\n\n// Well, the code for internal error wrapper.\n// in Swift equivalent is:\n// case .internalError(let internalError):\n+ (NSInteger)externalCodeForInternalError;\n\n// Mapping errorCode -> NSLocalizedDescriptionKey\n+ (NSDictionary *)codesAndUserDescriptions;\n\n// Mapping errorCode -> Description.\n// in Swift equivalent is:\n// StringConvertable or enum with String value.\n+ (NSDictionary *)codesAndDescriptions;\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTAlgorithmErrorDescription.h",
    "content": "//\n//  JWTAlgorithmErrorDescription.h\n//  JWT\n//\n//  Created by Dmitry on 7/29/18.\n//  Copyright © 2018 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\n@interface JWTAlgorithmErrorDescription : NSObject\n+ (NSError *)errorWithCode:(NSInteger)code;\n+ (NSError *)errorWithExternalError:(NSError *)error;\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTAlgorithmFactory.h",
    "content": "//\n//  JWTAlgorithmFactory.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 07.10.15.\n//  Copyright © 2015 Karma. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTAlgorithm.h\"\n\n\n@interface JWTAlgorithmHolder : NSObject <JWTAlgorithm>\n@property (strong, nonatomic, readwrite) id <JWTAlgorithm> algorithm;\n- (instancetype)initWithAlgorithm:(id<JWTAlgorithm>)algorithm;\n\n// For backward compatibilty\n- (NSData *)encodePayload:(NSString *)theString withSecret:(NSString *)theSecret;\n- (BOOL)verifySignedInput:(NSString *)input withSignature:(NSString *)signature verificationKey:(NSString *)verificationKey;\n- (NSData *)encodePayloadData:(NSData *)theStringData withSecret:(NSData *)theSecretData;\n- (BOOL)verifySignedInput:(NSString *)input withSignature:(NSString *)signature verificationKeyData:(NSData *)verificationKeyData;\n@end\n\n@interface JWTAlgorithmFactory : NSObject\n@property (nonatomic, readonly, class) NSArray <id<JWTAlgorithm>> *algorithms;\n+ (id<JWTAlgorithm>)algorithmByName:(NSString *)name;\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTAlgorithmHSBase.h",
    "content": "//\n//  JWTAlgorithmHSBase.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 13.03.16.\n//  Copyright © 2016 Karma. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTAlgorithm.h\"\n\nextern NSString *const JWTAlgorithmNameHS256;\nextern NSString *const JWTAlgorithmNameHS384;\nextern NSString *const JWTAlgorithmNameHS512;\n\n@interface JWTAlgorithmHSBase : NSObject <JWTAlgorithm>\n\n@property (assign, nonatomic, readonly) size_t ccSHANumberDigestLength;\n@property (assign, nonatomic, readonly) uint32_t ccHmacAlgSHANumber;\n\n@end\n\n@interface JWTAlgorithmHSBase (Create)\n\n+ (instancetype)algorithm256;\n+ (instancetype)algorithm384;\n+ (instancetype)algorithm512;\n\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTAlgorithmNone.h",
    "content": "//\n//  JWTAlgorithmNone.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 16.10.15.\n//  Copyright © 2015 Karma. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTAlgorithm.h\"\n\nextern NSString *const JWTAlgorithmNameNone;\n\n@interface JWTAlgorithmNone : NSObject <JWTAlgorithm>\n\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTAlgorithmRSBase.h",
    "content": "//\n//  JWTAlgorithmRSBase.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 13.03.16.\n//  Copyright © 2016 Karma. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTRSAlgorithm.h\"\n#import \"JWTAlgorithmErrorDescription.h\"\n\nextern NSString *const JWTAlgorithmRSFamilyErrorDomain;\ntypedef NS_ENUM(NSInteger, JWTAlgorithmRSFamilyError) {\n    JWTAlgorithmRSFamilyErrorIncorrectHashComputation = -100,\n    JWTAlgorithmRSFamilyErrorIncorrectKeySize,\n    JWTAlgorithmRSFamilyErrorInternalSecurityAPI = -98,\n    JWTAlgorithmRSFamilyErrorUnexpected = -20\n};\n\n// Deprecated.\n@interface JWTAlgorithmRSFamilyErrorDescription : JWTAlgorithmErrorDescription @end\n\nextern NSString *const JWTAlgorithmNameRS256;\nextern NSString *const JWTAlgorithmNameRS384;\nextern NSString *const JWTAlgorithmNameRS512;\n\n@interface JWTAlgorithmRSBase : NSObject <JWTRSAlgorithm>\n\n@property (assign, nonatomic, readonly) size_t ccSHANumberDigestLength;\n@property (assign, nonatomic, readonly) uint32_t secPaddingPKCS1SHANumber;\n- (unsigned char *)CC_SHANumberWithData:(const void *)data withLength:(uint32_t)len withHashBytes:(unsigned char *)hashBytes;\n\n@end\n\n@interface JWTAlgorithmRSBase (Create)\n\n+ (instancetype)algorithm256;\n+ (instancetype)algorithm384;\n+ (instancetype)algorithm512;\n+ (instancetype)mutableAlgorithm __deprecated;\n\n@end\n\n/*\n // when you can't live without mutability, uncomment.\n @class JWTAlgorithmRSFamilyMemberMutable;\n*/\n"
  },
  {
    "path": "Sources/JWT/include/JWTBase64Coder.h",
    "content": "//\n//  JWTBase64Coder.h\n//  Pods\n//\n//  Created by Lobanov Dmitry on 05.10.16.\n//\n//\n\n#import <Foundation/Foundation.h>\n\n@protocol JWTStringCoderProtocol <NSObject>\n- (NSString *)stringWithData:(NSData *)data;\n- (NSData *)dataWithString:(NSString *)string;\n@end\n\n@interface JWTBase64Coder : NSObject\n+ (instancetype)withBase64String;\n+ (instancetype)withPlainString;\n+ (NSString *)base64UrlEncodedStringWithData:(NSData *)data;\n+ (NSData *)dataWithBase64UrlEncodedString:(NSString *)urlEncodedString;\n@end\n\n@interface JWTBase64Coder (JWTStringCoderProtocol) <JWTStringCoderProtocol> @end\n\n\n@interface JWTStringCoderForEncoding : NSObject\n@property (assign, nonatomic, readwrite) NSStringEncoding stringEncoding;\n+ (instancetype)utf8Encoding;\n@end\n@interface JWTStringCoderForEncoding (JWTStringCoderProtocol) <JWTStringCoderProtocol> @end\n"
  },
  {
    "path": "Sources/JWT/include/JWTBuilder+FluentStyle.h",
    "content": "//\n//  JWTBuilder+FluentStyle.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 15/06/2019.\n//  Copyright © 2019 JWTIO. All rights reserved.\n//\n\n#import \"JWTCoding+VersionTwo.h\"\n#import \"JWTDeprecations.h\"\n\n#if DEPLOYMENT_RUNTIME_SWIFT\n#else\nNS_ASSUME_NONNULL_BEGIN\n\n// Fluent ( Objective-C exclusive ).\n@interface JWTBuilder (FluentStyle)\n/**\n Sets jwtMessage and returns the JWTBuilder to allow for method chaining\n */\n@property (copy, nonatomic, readonly) JWTBuilder *(^message)(NSString *message) NS_SWIFT_UNAVAILABLE(\"\");\n\n/**\n Sets jwtPayload and returns the JWTBuilder to allow for method chaining\n */\n@property (copy, nonatomic, readonly) JWTBuilder *(^payload)(NSDictionary *payload) NS_SWIFT_UNAVAILABLE(\"\");\n\n/**\n Sets jwtHeaders and returns the JWTBuilder to allow for method chaining\n */\n@property (copy, nonatomic, readonly) JWTBuilder *(^headers)(NSDictionary *headers) NS_SWIFT_UNAVAILABLE(\"\");\n\n/**\n Sets jwtClaimsSet and returns the JWTBuilder to allow for method chaining\n */\n@property (copy, nonatomic, readonly) JWTBuilder *(^claimsSet)(JWTClaimsSet *claimsSet) NS_SWIFT_UNAVAILABLE(\"\");\n\n/**\n Sets jwtSecret and returns the JWTBuilder to allow for method chaining\n */\n@property (copy, nonatomic, readonly) JWTBuilder *(^secret)(NSString *secret) NS_SWIFT_UNAVAILABLE(\"\");\n\n/**\n Sets jwtSecretData and returns the JWTBuilder to allow for method chaining\n */\n@property (copy, nonatomic, readonly) JWTBuilder *(^secretData)(NSData *secretData) NS_SWIFT_UNAVAILABLE(\"\");\n\n/**\n Sets jwtPrivateKeyCertificatePassphrase and returns the JWTBuilder to allow for method chaining\n */\n@property (copy, nonatomic, readonly) JWTBuilder *(^privateKeyCertificatePassphrase)(NSString *privateKeyCertificatePassphrase) NS_SWIFT_UNAVAILABLE(\"\");\n\n/**\n Sets jwtAlgorithm and returns the JWTBuilder to allow for method chaining\n */\n@property (copy, nonatomic, readonly) JWTBuilder *(^algorithm)(id<JWTAlgorithm>algorithm) NS_SWIFT_UNAVAILABLE(\"\");\n\n/**\n Sets jwtAlgorithmName and returns the JWTBuilder to allow for method chaining. See list of names in appropriate headers.\n */\n@property (copy, nonatomic, readonly) JWTBuilder *(^algorithmName)(NSString *algorithmName) NS_SWIFT_UNAVAILABLE(\"\");\n\n/**\n Sets jwtOptions and returns the JWTBuilder to allow for method chaining\n */\n@property (copy, nonatomic, readonly) JWTBuilder *(^options)(NSNumber *options) NS_SWIFT_UNAVAILABLE(\"\");\n\n/**\n Sets algorithmWhitelist and returns the JWTBuilder to allow for method chaining\n */\n@property (copy, nonatomic, readonly) JWTBuilder *(^whitelist)(NSArray *whitelist) NS_SWIFT_UNAVAILABLE(\"\");\n@end\n\nNS_ASSUME_NONNULL_END\n#endif\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaim.h",
    "content": "//\n//  JWTClaim.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 13.02.16.\n//  Copyright © 2016 Karma. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\n@interface JWTClaim : NSObject\n\n+ (NSString *)name;\n+ (instancetype)claimByName:(NSString *)name;\n+ (BOOL)verifyValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue;\n- (BOOL)verifyValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue;\n\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimBase.h",
    "content": "//\n//  JWTClaimBase.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 10.08.2020.\n//  Copyright © 2020 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTClaimsSetsProtocols.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface JWTClaimBase : NSObject <JWTClaimProtocol>\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimSerializerBase.h",
    "content": "//\n//  JWTClaimSerializerBase.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 30.05.2021.\n//  Copyright © 2021 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTClaimsSetsProtocols.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface JWTClaimSerializerBase : NSObject <JWTClaimSerializerProtocol>\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimSerializerVariations.h",
    "content": "//\n//  JWTClaimSerializerVariations.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 30.05.2021.\n//  Copyright © 2021 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTClaimSerializerBase.h\"\nNS_ASSUME_NONNULL_BEGIN\n\n@interface JWTClaimSerializerVariations : NSObject\n\n/// Discussion\n/// @return JWTClaimSerializerBaseConcreteDateAndTimestamp\n///\n+ (id<JWTClaimSerializerProtocol>)dateAndTimestampTransform;\n\n/// Discussion\n/// @return JWTClaimSerializerBase\n///\n+ (id<JWTClaimSerializerProtocol>)identityTransform;\n@end\n\n/// Discussion\n/// This serializer converts NSDate to a json value via timeIntervalSince1970.\n///\n/// Conversion\n///\n/// JSON Timestamp\n/// Claim NSDate\n///\n/// Encoding and Decoding\n///     Decode JSON -> Claim `dateWithTimeIntervalSince1970`\n///     Encode Claim -> JSON `timeIntervalSince1970`\n///\n/// Examples\n///\n/// JSON\n/// {\n/// ... \"time\": 12362387432,\n/// }\n///\n/// Date\n/// NSDate *date = [NSDate dateWithTimeIntervalSince1970:12362387432];\n///\n@interface JWTClaimSerializerBaseConcreteDateAndTimestamp : JWTClaimSerializerBase\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimVariations.h",
    "content": "//\n//  JWTClaimVariations.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 10.08.2020.\n//  Copyright © 2020 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTClaimBase.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\nextern NSString *JWTRegisteredClaimNameIssuer;\nextern NSString *JWTRegisteredClaimNameSubject;\nextern NSString *JWTRegisteredClaimNameAudience;\nextern NSString *JWTRegisteredClaimNameExpirationTime;\nextern NSString *JWTRegisteredClaimNameNotBefore;\nextern NSString *JWTRegisteredClaimNameIssuedAt;\nextern NSString *JWTRegisteredClaimNameJWTID;\nextern NSString *JWTRegisteredClaimNameType;\nextern NSString *JWTRegisteredClaimNameScope;\n\n@interface JWTClaimVariations : NSObject\n+ (id<JWTClaimProtocol>)issuer;\n+ (id<JWTClaimProtocol>)subject;\n+ (id<JWTClaimProtocol>)audience;\n+ (id<JWTClaimProtocol>)expirationTime;\n+ (id<JWTClaimProtocol>)notBefore;\n+ (id<JWTClaimProtocol>)issuedAt;\n+ (id<JWTClaimProtocol>)jwtID;\n+ (id<JWTClaimProtocol>)type;\n+ (id<JWTClaimProtocol>)scope;\n@end\n\n@interface JWTClaimsNames : NSObject\n@property(copy, nonatomic, readonly, class) NSString *issuer;\n@property(copy, nonatomic, readonly, class) NSString *subject;\n@property(copy, nonatomic, readonly, class) NSString *audience;\n@property(copy, nonatomic, readonly, class) NSString *expirationTime;\n@property(copy, nonatomic, readonly, class) NSString *notBefore;\n@property(copy, nonatomic, readonly, class) NSString *issuedAt;\n@property(copy, nonatomic, readonly, class) NSString *jwtID;\n@property(copy, nonatomic, readonly, class) NSString *type;\n@property(copy, nonatomic, readonly, class) NSString *scope;\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimVerifierBase.h",
    "content": "//\n//  JWTClaimVerifierBase.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 30.05.2021.\n//  Copyright © 2021 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTClaimsSetsProtocols.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface JWTClaimVerifierBase : NSObject <JWTClaimVerifierProtocol>\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimVerifierVariations.h",
    "content": "//\n//  JWTClaimVerifierVariations.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 30.05.2021.\n//  Copyright © 2021 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTClaimVerifierBase.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface JWTClaimVerifierVariations : NSObject\n+ (id<JWTClaimVerifierProtocol>)issuer;\n+ (id<JWTClaimVerifierProtocol>)subject;\n+ (id<JWTClaimVerifierProtocol>)audienceEqualSingle;\n+ (id<JWTClaimVerifierProtocol>)audienceInSet;\n+ (id<JWTClaimVerifierProtocol>)expirationTime;\n+ (id<JWTClaimVerifierProtocol>)notBefore;\n+ (id<JWTClaimVerifierProtocol>)issuedAt;\n+ (id<JWTClaimVerifierProtocol>)jwtID;\n+ (id<JWTClaimVerifierProtocol>)type;\n+ (id<JWTClaimVerifierProtocol>)scope;\n@end\n\n@interface JWTClaimVerifierBaseConcreteEquality : JWTClaimVerifierBase\n@property (assign, nonatomic, readwrite) BOOL equal;\n@end\n\n@interface JWTClaimVerifierBaseConcreteComparison : JWTClaimVerifierBase\n@property (assign, nonatomic, readwrite) NSComparisonResult expectedComparison;\n@property (assign, nonatomic, readwrite) BOOL trustedValueAtLeft;\n@property (assign, nonatomic, readwrite) BOOL notEqual;\n@end\n\n@interface JWTClaimVerifierBaseConcreteEqualityForString : JWTClaimVerifierBaseConcreteEquality\n@end\n\n@interface JWTClaimVerifierBaseConcreteInclusionInSet : JWTClaimVerifierBase\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimsProviderBase.h",
    "content": "//\n//  JWTClaimsProviderBase.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 22.05.2021.\n//  Copyright © 2021 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTClaimsSetsProtocols.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface JWTClaimsProviderBase : NSObject <JWTClaimsProviderProtocol>\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimsSet.h",
    "content": "//\n//  JWTClaimsSet.h\n//  JWT\n//\n//  Created by Klaas Pieter Annema on 31-05-13.\n//  Copyright (c) 2013 Karma. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\n@interface JWTClaimsSet : NSObject<NSCopying>\n\n@property (nonatomic, readwrite, copy) NSString *issuer;\n@property (nonatomic, readwrite, copy) NSString *subject;\n@property (nonatomic, readwrite, copy) NSString *audience;\n@property (nonatomic, readwrite, copy) NSDate *expirationDate;\n@property (nonatomic, readwrite, copy) NSDate *notBeforeDate;\n@property (nonatomic, readwrite, copy) NSDate *issuedAt;\n@property (nonatomic, readwrite, copy) NSString *identifier;\n@property (nonatomic, readwrite, copy) NSString *type;\n@property (nonatomic, readwrite, copy) NSString *scope;\n\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimsSetBase.h",
    "content": "//\n//  JWTClaimsSetBase.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 10.08.2020.\n//  Copyright © 2020 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTClaimsSetsProtocols.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface JWTClaimsSetBase : NSObject <JWTClaimsSetProtocol>\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimsSetCoordinatorBase.h",
    "content": "//\n//  JWTClaimsSetCoordinatorBase.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 31.05.2021.\n//  Copyright © 2021 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTClaimsSetsProtocols.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface JWTClaimsSetCoordinatorBase : NSObject <JWTClaimsSetCoordinatorProtocol>\n@property (strong, nonatomic, readwrite) id <JWTClaimsProviderProtocol> claimsProvider;\n@property (copy, nonatomic, readwrite) id <JWTClaimsSetProtocol> claimsSetStorage;\n@property (strong, nonatomic, readwrite) id <JWTClaimsSetSerializerProtocol> claimsSetSerializer;\n@property (strong, nonatomic, readwrite) id <JWTClaimsSetVerifierProtocol> claimsSetVerifier;\n- (instancetype)configureClaimsSet:(JWTClaimsSetDSLBase *(^)(JWTClaimsSetDSLBase *claimsSetDSL))claimsSet;\n#if DEPLOYMENT_RUNTIME_SWIFT\n#else\n@property (copy, nonatomic, readonly) id <JWTClaimsSetCoordinatorProtocol> (^configureClaimsSet)(JWTClaimsSetDSLBase *(^)(JWTClaimsSetDSLBase *claimsSetDSL)) NS_SWIFT_UNAVAILABLE(\"\");\n#endif\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimsSetDSLBase.h",
    "content": "//\n//  JWTClaimsSetDSLBase.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 31.05.2021.\n//  Copyright © 2021 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTClaimsSetsProtocols.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface JWTClaimsSetDSLBase : NSObject\n@property (strong, nonatomic, readonly) id <JWTClaimsProviderProtocol> claimsProvider;\n@property (copy, nonatomic, readonly) id <JWTClaimsSetProtocol> claimsSetStorage;\n- (instancetype)initWithClaimsProvider:(id <JWTClaimsProviderProtocol>)claimsProvider claimsSetStorage:(id <JWTClaimsSetProtocol>)claimsSetStorage;\n@end\n\n@interface JWTClaimsSetDSLBase (DSL)\n- (nullable NSObject *)dslValueForName:(NSString *)name;\n- (void)dslSetValue:(NSObject *)value forName:(NSString *)name;\n@property (copy, nonatomic, readwrite) NSString *issuer;\n@property (copy, nonatomic, readwrite) NSString *subject;\n@property (copy, nonatomic, readwrite) NSString *audience;\n@property (copy, nonatomic, readwrite) NSDate *expirationDate;\n@property (copy, nonatomic, readwrite) NSDate *notBeforeDate;\n@property (copy, nonatomic, readwrite) NSDate *issuedAt;\n@property (copy, nonatomic, readwrite) NSString *identifier;\n@property (copy, nonatomic, readwrite) NSString *type;\n@property (copy, nonatomic, readwrite) NSString *scope;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimsSetSerializer.h",
    "content": "//\n//  JWTClaimsSetSerializer.h\n//  JWT\n//\n//  Created by Klaas Pieter Annema on 31-05-13.\n//  Copyright (c) 2013 Karma. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\n#import \"JWTClaimsSet.h\"\n\n@interface JWTClaimsSetSerializer : NSObject\n\n+ (NSArray *)claimsSetKeys;\n+ (NSDictionary *)dictionaryWithClaimsSet:(JWTClaimsSet *)theClaimsSet;\n+ (JWTClaimsSet *)claimsSetWithDictionary:(NSDictionary *)theDictionary;\n\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimsSetSerializerBase.h",
    "content": "//\n//  JWTClaimsSetSerializerBase.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 10.08.2020.\n//  Copyright © 2020 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTClaimsSetsProtocols.h\"\n#import \"JWTClaimSerializerBase.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface JWTClaimsSetSerializerBase : NSObject <JWTClaimsSetSerializerProtocol>\n@property (strong, nonatomic, readwrite) id <JWTClaimsProviderProtocol> claimsProvider;\n@property (copy, nonatomic, readwrite) id <JWTClaimsSetProtocol> claimsSetStorage;\n@property (assign, nonatomic, readwrite) BOOL skipClaimsProviderLookupCheck;\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimsSetVerifier.h",
    "content": "//\n//  JWTClaimsSetVerifier.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 13.02.16.\n//  Copyright © 2016 Karma. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTClaimsSet.h\"\n\n@interface JWTClaimsSetVerifier : NSObject\n\n+ (BOOL)verifyClaimsSet:(JWTClaimsSet *)theClaimsSet withTrustedClaimsSet:(JWTClaimsSet *)trustedClaimsSet;\n\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimsSetVerifierBase.h",
    "content": "//\n//  JWTClaimsSetVerifierBase.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 10.08.2020.\n//  Copyright © 2020 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTClaimsSetsProtocols.h\"\n#import \"JWTClaimVerifierBase.h\"\nNS_ASSUME_NONNULL_BEGIN\n\n@interface JWTClaimsSetVerifierBase : NSObject <JWTClaimsSetVerifierProtocol>\n@property (strong, nonatomic, readwrite) id <JWTClaimsProviderProtocol> claimsProvider;\n@property (nonatomic, readwrite) id <JWTClaimsSetSerializerProtocol> serializer;\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Sources/JWT/include/JWTClaimsSetsProtocols.h",
    "content": "//\n//  JWTClaimsSetsProtocols.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 09.08.2020.\n//  Copyright © 2020 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\n@class JWTClaimsSetDSLBase;\n\nNS_ASSUME_NONNULL_BEGIN\n\n@protocol JWTClaimProtocol <NSCopying>\n@property (copy, nonatomic, readonly, class) NSString *name;\n@property (copy, nonatomic, readonly) NSString *name;\n@property (nonatomic, readonly) NSObject *value;\n- (instancetype)copyWithValue:(NSObject *)value;\n- (instancetype)copyWithName:(NSString *)name;\n@end\n\n@protocol JWTClaimVerifierProtocol\n- (BOOL)verifyValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue;\n@end\n\n@protocol JWTClaimSerializerProtocol\n- (NSObject *)serializedClaimValue:(id<JWTClaimProtocol>)claim;\n- (NSObject *)deserializedClaimValue:(NSObject *)value forName:(NSString *)name;\n@end\n\n@protocol JWTClaimsSetProtocol <NSCopying>\n@property (copy, nonatomic, readonly) NSArray <id<JWTClaimProtocol>>* claims;\n- (instancetype)copyWithClaims:(NSArray <id<JWTClaimProtocol>>*)claims;\n- (id<JWTClaimProtocol>)claimByName:(NSString *)name;\n- (void)appendClaim:(id<JWTClaimProtocol>)claim;\n- (void)removeClaimByName:(NSString *)name;\n@property (assign, nonatomic, readonly) BOOL isEmpty;\n@end\n\n@protocol JWTClaimsProviderProtocol\n@property (copy, nonatomic, readonly) NSArray <NSString *> *availableClaimsNames;\n- (id<JWTClaimProtocol>)claimByName:(NSString *)name;\n- (void)registerClaim:(id<JWTClaimProtocol>)claim forClaimName:(NSString *)name;\n- (void)unregisterClaimForClaimName:(NSString *)name;\n@end\n\n@protocol JWTClaimsSetSerializerProtocol\n@property (strong, nonatomic, readwrite) id <JWTClaimsProviderProtocol> claimsProvider;\n@property (copy, nonatomic, readwrite) id <JWTClaimsSetProtocol> claimsSetStorage;\n- (void)registerSerializer:(id<JWTClaimSerializerProtocol>)serializer forClaimName:(NSString *)name;\n- (void)unregisterSerializerForClaimName:(NSString *)name;\n- (nullable NSDictionary *)dictionaryFromClaimsSet:(id<JWTClaimsSetProtocol>)claimsSet;\n- (nullable id<JWTClaimsSetProtocol>)claimsSetFromDictionary:(NSDictionary *)dictionary;\n@end\n\n@protocol JWTClaimsSetVerifierProtocol\n@property (strong, nonatomic, readwrite) id <JWTClaimsProviderProtocol> claimsProvider;\n- (void)registerVerifier:(id<JWTClaimVerifierProtocol>)verifier forClaimName:(NSString *)name;\n- (void)unregisterVerifierForClaimName:(NSString *)name;\n- (BOOL)verifyClaimsSet:(id<JWTClaimsSetProtocol>)theClaimsSet withTrustedClaimsSet:(id<JWTClaimsSetProtocol>)trustedClaimsSet;\n@end\n\n@protocol JWTClaimsSetCoordinatorProtocol\n@property (strong, nonatomic, readwrite) id <JWTClaimsProviderProtocol> claimsProvider;\n@property (copy, nonatomic, readwrite) id <JWTClaimsSetProtocol> claimsSetStorage;\n@property (strong, nonatomic, readwrite) id <JWTClaimsSetSerializerProtocol> claimsSetSerializer;\n@property (strong, nonatomic, readwrite) id <JWTClaimsSetVerifierProtocol> claimsSetVerifier;\n\n@property (strong, nonatomic, readonly) JWTClaimsSetDSLBase *dslDesrciption;\n\n- (instancetype)configureClaimsSet:(JWTClaimsSetDSLBase *(^)(JWTClaimsSetDSLBase *claimsSetDSL))claimsSet;\n\n#if DEPLOYMENT_RUNTIME_SWIFT\n#else\n@property (copy, nonatomic, readonly) id <JWTClaimsSetCoordinatorProtocol> (^configureClaimsSet)(JWTClaimsSetDSLBase *(^)(JWTClaimsSetDSLBase *claimsSetDSL)) NS_SWIFT_UNAVAILABLE(\"\");\n#endif\n\n- (void)registerClaim:(id<JWTClaimProtocol>)claim serializer:(id<JWTClaimSerializerProtocol>)serializer verifier:(id<JWTClaimVerifierProtocol>)verifier forClaimName:(NSString *)name;\n- (void)unregisterClaimWithSerializerAndVerifierForClaimName:(NSString *)name;\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "Sources/JWT/include/JWTCoding+ResultTypes.h",
    "content": "//\n//  JWTCoding+ResultTypes.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 30.11.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\n#import \"JWTCoding.h\"\n#import \"JWTDeprecations.h\"\n@protocol JWTClaimsSetProtocol;\n\n@interface JWTCodingResultComponents : NSObject\n@property (copy, nonatomic, readonly, class) NSString *headers;\n@property (copy, nonatomic, readonly, class) NSString *payload;\n@end\n\n@interface JWT (ResultTypes) @end\n\n/*\n            ResultType\n                /\\\n               /  \\\n              /    \\\n          Success  Error\n \n    Protocols: Mutable and Immutable (?!?)\n */\n\n// Public\n@protocol JWTCodingResultTypeSuccessEncodedProtocol <NSObject>\n@property (copy, nonatomic, readonly) NSString *encoded;\n- (instancetype)initWithEncoded:(NSString *)encoded;\n@property (copy, nonatomic, readonly) NSString *token;\n- (instancetype)initWithToken:(NSString *)token;\n@end\n\n// Public\n@protocol JWTCodingResultTypeSuccessDecodedProtocol <NSObject>\n@property (copy, nonatomic, readonly) NSDictionary *headers;\n@property (copy, nonatomic, readonly) NSDictionary *payload;\n\n/// This is a dictionary that contains header and payload.\n///\n/// @discussion\n/// You may access to its guts via `JWTCodingResultComponents`.\n///\n/// dictionary = {\n///   JWTCodingResultComponents.headers : headers,\n///   JWTCodingResultComponents.payload : payload\n/// }\n///\n@property (copy, nonatomic, readonly) NSDictionary *headerAndPayloadDictionary;\n@property (copy, nonatomic, readonly) id<JWTClaimsSetProtocol> claimsSetStorage;\n\n- (instancetype)initWithHeadersAndPayload:(NSDictionary *)headersAndPayloadDictionary;\n- (instancetype)initWithHeaders:(NSDictionary *)headers withPayload:(NSDictionary *)payload;\n- (instancetype)initWithClaimsSetStorage:(id<JWTClaimsSetProtocol>)claimsSetStorage;\n@end\n\n// Public\n@interface JWTCodingResultTypeSuccess : NSObject <JWTCodingResultTypeSuccessEncodedProtocol,JWTCodingResultTypeSuccessDecodedProtocol> @end\n\n// Public\n@protocol JWTCodingResultTypeErrorProtocol <NSObject>\n@property (copy, nonatomic, readonly) NSError *error;\n- (instancetype)initWithError:(NSError *)error;\n@end\n\n@interface JWTCodingResultTypeError : NSObject <JWTCodingResultTypeErrorProtocol> @end\n\n@interface JWTCodingResultType : NSObject\n- (instancetype)initWithSuccessResult:(JWTCodingResultTypeSuccess *)success;\n- (instancetype)initWithErrorResult:(JWTCodingResultTypeError *)error;\n@property (strong, nonatomic, readonly) JWTCodingResultTypeSuccess *successResult;\n@property (strong, nonatomic, readonly) JWTCodingResultTypeError *errorResult;\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTCoding+VersionOne.h",
    "content": "//\n//  JWTCoding+VersionOne.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 27.11.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\n#import \"JWTCoding.h\"\n\n@protocol JWTAlgorithm;\n@class JWTClaimsSet;\n\n@interface JWT (VersionOne)\n#pragma mark - Encode\n+ (NSString *)encodeClaimsSet:(JWTClaimsSet *)theClaimsSet withSecret:(NSString *)theSecret;\n+ (NSString *)encodeClaimsSet:(JWTClaimsSet *)theClaimsSet withSecret:(NSString *)theSecret algorithm:(id<JWTAlgorithm>)theAlgorithm;\n\n+ (NSString *)encodePayload:(NSDictionary *)thePayload withSecret:(NSString *)theSecret;\n+ (NSString *)encodePayload:(NSDictionary *)thePayload withSecret:(NSString *)theSecret algorithm:(id<JWTAlgorithm>)theAlgorithm;\n\n+ (NSString *)encodePayload:(NSDictionary *)thePayload withSecret:(NSString *)theSecret withHeaders:(NSDictionary *)theHeaders algorithm:(id<JWTAlgorithm>)theAlgorithm;\n\n+ (NSString *)encodePayload:(NSDictionary *)thePayload withSecret:(NSString *)theSecret withHeaders:(NSDictionary *)theHeaders algorithm:(id<JWTAlgorithm>)theAlgorithm withError:(NSError * __autoreleasing *)theError;\n\n//Will be deprecated in later releases\n#pragma mark - Decode\n\n/**\n Decodes a JWT and returns the decoded Header and Payload\n @param theMessage The encoded JWT\n @param theSecret The verification key to use for validating the JWT signature\n @param theTrustedClaimsSet The JWTClaimsSet to use for verifying the JWT values\n @param theError Error pointer, if there is an error decoding the message, upon return contains an NSError object that describes the problem.\n @param theAlgorithmName The name of the algorithm to use for verifying the signature. Required, unless skipping verification\n @param theForcedOption BOOL indicating if verifying the JWT signature should be skipped. Should only be used for debugging\n @return A dictionary containing the header and payload dictionaries. Keyed to \"header\" and \"payload\", respectively. Or nil if an error occurs.\n */\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withTrustedClaimsSet:(JWTClaimsSet *)theTrustedClaimsSet withError:(NSError *__autoreleasing *)theError withForcedAlgorithmByName:(NSString *)theAlgorithmName withForcedOption:(BOOL)theForcedOption;\n\n/**\n Decodes a JWT and returns the decoded Header and Payload\n @param theMessage The encoded JWT\n @param theSecret The verification key to use for validating the JWT signature\n @param theTrustedClaimsSet The JWTClaimsSet to use for verifying the JWT values\n @param theError Error pointer, if there is an error decoding the message, upon return contains an NSError object that describes the problem.\n @param theAlgorithmName The name of the algorithm to use for verifying the signature. Required.\n @return A dictionary containing the header and payload dictionaries. Keyed to \"header\" and \"payload\", respectively. Or nil if an error occurs.\n */\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withTrustedClaimsSet:(JWTClaimsSet *)theTrustedClaimsSet withError:(NSError *__autoreleasing *)theError withForcedAlgorithmByName:(NSString *)theAlgorithmName;\n\n/**\n Decodes a JWT and returns the decoded Header and Payload.\n\n Uses the JWTAlgorithmHS512 for decoding\n\n @param theMessage The encoded JWT\n @param theSecret The verification key to use for validating the JWT signature\n @param theTrustedClaimsSet The JWTClaimsSet to use for verifying the JWT values\n @param theError Error pointer, if there is an error decoding the message, upon return contains an NSError object that describes the problem.\n @param theForcedOption BOOL indicating if verifying the JWT signature should be skipped. Should only be used for debugging\n @return A dictionary containing the header and payload dictionaries. Keyed to \"header\" and \"payload\", respectively. Or nil if an error occurs.\n */\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withTrustedClaimsSet:(JWTClaimsSet *)theTrustedClaimsSet withError:(NSError *__autoreleasing *)theError withForcedOption:(BOOL)theForcedOption;\n\n/**\n Decodes a JWT and returns the decoded Header and Payload\n @param theMessage The encoded JWT\n @param theSecret The verification key to use for validating the JWT signature\n @param theError Error pointer, if there is an error decoding the message, upon return contains an NSError object that describes the problem.\n @param theAlgorithmName The name of the algorithm to use for verifying the signature. Required, unless skipping verification\n @param skipVerification BOOL indicating if verifying the JWT signature should be skipped. Should only be used for debugging\n @return A dictionary containing the header and payload dictionaries. Keyed to \"header\" and \"payload\", respectively. Or nil if an error occurs.\n */\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withError:(NSError *__autoreleasing *)theError withForcedAlgorithmByName:(NSString *)theAlgorithmName skipVerification:(BOOL)skipVerification;\n\n/**\n Decodes a JWT and returns the decoded Header and Payload\n @param theMessage The encoded JWT\n @param theSecret The verification key to use for validating the JWT signature\n @param theError Error pointer, if there is an error decoding the message, upon return contains an NSError object that describes the problem.\n @param theAlgorithmName The name of the algorithm to use for verifying the signature. Required.\n @return A dictionary containing the header and payload dictionaries. Keyed to \"header\" and \"payload\", respectively. Or nil if an error occurs.\n */\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withError:(NSError *__autoreleasing *)theError withForcedAlgorithmByName:(NSString *)theAlgorithmName;\n\n/**\n Decodes a JWT and returns the decoded Header and Payload\n\n Uses the JWTAlgorithmHS512 for decoding\n\n @param theMessage The encoded JWT\n @param theSecret The verification key to use for validating the JWT signature\n @param theError Error pointer, if there is an error decoding the message, upon return contains an NSError object that describes the problem.\n @param theForcedOption BOOL indicating if verifying the JWT signature should be skipped.\n @return A dictionary containing the header and payload dictionaries. Keyed to \"header\" and \"payload\", respectively. Or nil if an error occurs.\n */\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withError:(NSError *__autoreleasing *)theError withForcedOption:(BOOL)theForcedOption;\n\n/**\n Decodes a JWT and returns the decoded Header and Payload.\n Uses the JWTAlgorithmHS512 for decoding\n @param theMessage The encoded JWT\n @param theSecret The verification key to use for validating the JWT signature\n @param theError Error pointer, if there is an error decoding the message, upon return contains an NSError object that describes the problem.\n @return A dictionary containing the header and payload dictionaries. Keyed to \"header\" and \"payload\", respectively. Or nil if an error occurs.\n */\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret withError:(NSError * __autoreleasing *)theError;\n\n/**\n Decodes a JWT and returns the decoded Header and Payload.\n Uses the JWTAlgorithmHS512 for decoding\n @param theMessage The encoded JWT\n @param theSecret The verification key to use for validating the JWT signature\n @return A dictionary containing the header and payload dictionaries. Keyed to \"header\" and \"payload\", respectively. Or nil if an error occurs.\n */\n+ (NSDictionary *)decodeMessage:(NSString *)theMessage withSecret:(NSString *)theSecret;\n\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTCoding+VersionThree.h",
    "content": "//\n//  JWTCoding+VersionThree.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 27.11.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\n#import \"JWTCoding.h\"\n\n// encode and decode options\n@protocol JWTAlgorithm;\n@class JWTCodingBuilder;\n@class JWTEncodingBuilder;\n@class JWTDecodingBuilder;\n@class JWTAlgorithmDataHolderChain;\n@protocol JWTAlgorithmDataHolderProtocol;\n@class JWTCodingResultType;\n@protocol JWTClaimsSetCoordinatorProtocol;\n@protocol JWTStringCoderProtocol;\n\n@interface JWT (VersionThree)\n+ (JWTEncodingBuilder *)encodeWithHolders:(NSArray *)holders;\n+ (JWTEncodingBuilder *)encodeWithChain:(JWTAlgorithmDataHolderChain *)chain;\n+ (JWTDecodingBuilder *)decodeWithHolders:(NSArray *)holders;\n+ (JWTDecodingBuilder *)decodeWithChain:(JWTAlgorithmDataHolderChain *)chain;\n@end\n\n@interface JWTCodingBuilder : NSObject\n#pragma mark - Create\n// each element should conform to JWTAlgorithmDataHolderProtocol\n+ (instancetype)createWithHolders:(NSArray *)holders;\n+ (instancetype)createWithChain:(JWTAlgorithmDataHolderChain *)chain;\n+ (instancetype)createWithEmptyChain;\n\n#pragma mark - Internal\n@property (nonatomic, readonly) JWTAlgorithmDataHolderChain *internalChain;\n@property (copy, nonatomic, readonly) NSNumber *internalOptions;\n@property (strong, nonatomic, readonly) id <JWTStringCoderProtocol> internalTokenCoder;\n@end\n\n@interface JWTCodingBuilder (Sugar)\n- (instancetype)and;\n- (instancetype)with;\n@end\n\n@interface JWTCodingBuilder (Coding)\n@property (nonatomic, readonly) JWTCodingResultType *result;\n@end\n\n@interface JWTEncodingBuilder : JWTCodingBuilder\n#pragma mark - Create\n+ (instancetype)encodePayload:(NSDictionary *)payload;\n+ (instancetype)encodeClaimsSetWithCoordinator:(id<JWTClaimsSetCoordinatorProtocol>)coordinator;\n\n#pragma mark - Internal\n@property (copy, nonatomic, readonly) NSDictionary *internalPayload;\n@property (copy, nonatomic, readonly) NSDictionary *internalHeaders;\n@property (nonatomic, readonly) id<JWTClaimsSetCoordinatorProtocol> internalClaimsSetCoordinator;\n@end\n\n@interface JWTEncodingBuilder (Coding)\n@property (nonatomic, readonly) JWTCodingResultType *encode;\n@end\n\n@interface JWTDecodingBuilder : JWTCodingBuilder\n#pragma mark - Create\n+ (instancetype)decodeMessage:(NSString *)message;\n\n#pragma mark - Internal\n@property (copy, nonatomic, readonly) NSString *internalMessage;\n@property (nonatomic, readonly) id<JWTClaimsSetCoordinatorProtocol> internalClaimsSetCoordinator;\n@end\n\n@interface JWTDecodingBuilder (Coding)\n@property (nonatomic, readonly) JWTCodingResultType *decode;\n@end\n\n#pragma mark - Setters\n@interface JWTCodingBuilder (Setters)\n- (instancetype)chain:(JWTAlgorithmDataHolderChain *)chain;\n- (instancetype)options:(NSNumber *)options;\n- (instancetype)addHolder:(id<JWTAlgorithmDataHolderProtocol>)holder;\n- (instancetype)tokenCoder:(id<JWTStringCoderProtocol>)tokenCoder;\n@end\n\n@interface JWTEncodingBuilder (Setters)\n- (instancetype)payload:(NSDictionary *)payload;\n- (instancetype)headers:(NSDictionary *)headers;\n- (instancetype)claimsSetCoordinator:(id<JWTClaimsSetCoordinatorProtocol>)claimsSetCoordinator;\n@end\n\n@interface JWTDecodingBuilder (Setters)\n- (instancetype)message:(NSString *)message;\n- (instancetype)claimsSetCoordinator:(id<JWTClaimsSetCoordinatorProtocol>)claimsSetCoordinator;\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTCoding+VersionTwo.h",
    "content": "//\n//  JWTCoding+VersionTwo.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 27.11.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\n#import \"JWTCoding.h\"\n\n@protocol JWTAlgorithm;\n@class JWTClaimsSet;\n@class JWTBuilder;\n\n@interface JWT (VersionTwo)\n#pragma mark - Builder\n+ (JWTBuilder *)encodePayload:(NSDictionary *)payload;\n+ (JWTBuilder *)encodeClaimsSet:(JWTClaimsSet *)claimsSet;\n+ (JWTBuilder *)decodeMessage:(NSString *)message;\n@end\n\n@interface JWTBuilder : NSObject\n\n+ (JWTBuilder *)encodePayload:(NSDictionary *)payload;\n+ (JWTBuilder *)encodeClaimsSet:(JWTClaimsSet *)claimsSet;\n+ (JWTBuilder *)decodeMessage:(NSString *)message;\n\n/**\n The JWT in it's encoded form. Will be decoded and verified\n */\n@property (copy, nonatomic, readonly) NSString *jwtMessage;\n\n/**\n The payload dictionary to encode\n */\n@property (copy, nonatomic, readonly) NSDictionary *jwtPayload;\n\n/**\n The header dictionary to encode\n */\n@property (copy, nonatomic, readonly) NSDictionary *jwtHeaders;\n\n/**\n The expected JWTClaimsSet to compare against a decoded JWT\n */\n@property (copy, nonatomic, readonly) JWTClaimsSet *jwtClaimsSet;\n\n/**\n The algorithm data holders. They contain necessary information about algorithms.\n */\n@property (copy, nonatomic, readonly) NSArray *jwtDataHolders;\n\n/**\n The verification key to use when encoding/decoding a JWT\n */\n@property (copy, nonatomic, readonly) NSString *jwtSecret;\n\n/**\n The verification key to use when encoding/decoding a JWT in data form\n */\n@property (copy, nonatomic, readonly) NSData *jwtSecretData;\n\n/**\n The passphrase for the PKCS12 blob, which represents the certificate containing the private key for the RS algorithms.\n */\n@property (copy, nonatomic, readonly) NSString *jwtPrivateKeyCertificatePassphrase;\n\n/**\n Contains the error that occured during an operation, or nil if no error occured\n */\n@property (copy, nonatomic, readonly) NSError *jwtError;\n\n/**\n The <JWTAlgorithm> to use for encoding a JWT\n */\n@property (strong, nonatomic, readonly) id<JWTAlgorithm> jwtAlgorithm;\n\n/**\n The algorithm name to use for decoding the JWT. Required unless force decode is true\n */\n@property (copy, nonatomic, readonly) NSString *jwtAlgorithmName;\n\n/**\n The force decode option. If set to true, a JWT won't be validated before decoding.\n Should only be used for debugging\n */\n@property (copy, nonatomic, readonly) NSNumber *jwtOptions;\n\n/*\n Optional algorithm name whitelist. If non-null, a JWT can only be decoded using an algorithm\n specified on this list.\n */\n@property (copy, nonatomic, readonly) NSSet *algorithmWhitelist;\n\n/**\n Creates the encoded JWT string based on the currently set properties, or nil if an\n error occured\n */\n@property (copy, nonatomic, readonly) NSString *encode;\n\n/**\n Decodes and returns the JWT as a dictionary, based on the JWTBuilder's currently set\n properties, or nil, if an error occured.\n */\n@property (copy, nonatomic, readonly) NSDictionary *decode;\n\n//@property (copy, nonatomic, readonly) JWTBuilder * (^addDataHolder)(JWTAlgorithmBaseDataHolder *dataHolder) __available_in_release_version(JWTVersion_3_0_0);\n//@property (copy, nonatomic, readonly) JWTBuilder * (^constructDataHolder)(id<JWTAlgorithmDataHolderProtocol> (^block)()) __available_in_release_version(JWTVersion_3_0_0);\n@end\n\n@interface JWTBuilder (Setters)\n- (instancetype)message:(NSString *)message;\n- (instancetype)payload:(NSDictionary *)payload;\n- (instancetype)headers:(NSDictionary *)headers;\n- (instancetype)claimSet:(JWTClaimsSet *)claimSet;\n- (instancetype)secret:(NSString *)secret;\n- (instancetype)secretData:(NSData *)secretData;\n- (instancetype)privateKeyCertificatePassphrase:(NSString *)privateKeyCertificatePassphrase;\n- (instancetype)algorithm:(id<JWTAlgorithm>)algorithm;\n- (instancetype)algorithmName:(NSString *)algorithmName;\n- (instancetype)options:(NSNumber *)options;\n- (instancetype)whitelist:(NSArray *)whitelist;\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTCoding.h",
    "content": "//\n//  JWT.h\n//  JWT\n//\n//  Created by Klaas Pieter Annema on 31-05-13.\n//  Copyright (c) 2013 Karma. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n/**\n @discussion JWT is a general interface for decoding and encoding.\n Now it is too complex and fat to support.\n Possible solution: split interface into several pieces.\n \n JWT_1_0 -> JWT with plain old functions.\n JWT_2_0 -> JWT with builder usage.\n JWT_3_0 -> JWT with splitted apart algorithm data and payload data.\n */\n@interface JWT : NSObject @end\n\ntypedef NS_OPTIONS(NSInteger, JWTCodingDecodingOptions) {\n    JWTCodingDecodingOptionsNone = 0,\n    JWTCodingDecodingOptionsSkipVerification = 1\n};\n"
  },
  {
    "path": "Sources/JWT/include/JWTCodingBuilder+FluentStyle.h",
    "content": "//\n//  JWTCodingBuilder+FluentStyle.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 07/06/2019.\n//  Copyright © 2019 JWTIO. All rights reserved.\n//\n\n#import <CoreFoundation/CoreFoundation.h>\n#import \"JWTCoding+VersionThree.h\"\n#import \"JWTDeprecations.h\"\n\n#if DEPLOYMENT_RUNTIME_SWIFT\n#else\nNS_ASSUME_NONNULL_BEGIN\n\n// Fluent ( Objective-C exclusive ).\n@interface JWTCodingBuilder (FluentStyle)\n@property (copy, nonatomic, readonly) JWTCodingBuilder *(^chain)(JWTAlgorithmDataHolderChain *chain) NS_SWIFT_UNAVAILABLE(\"\");\n@property (copy, nonatomic, readonly) JWTCodingBuilder *(^constructChain)(JWTAlgorithmDataHolderChain *(^block)(void)) NS_SWIFT_UNAVAILABLE(\"\");\n@property (copy, nonatomic, readonly) JWTCodingBuilder *(^modifyChain)(JWTAlgorithmDataHolderChain *(^block)(JWTAlgorithmDataHolderChain * chain)) NS_SWIFT_UNAVAILABLE(\"\");\n@property (copy, nonatomic, readonly) JWTCodingBuilder *(^options)(NSNumber *options) NS_SWIFT_UNAVAILABLE(\"\");\n@property (copy, nonatomic, readonly) JWTCodingBuilder *(^addHolder)(id<JWTAlgorithmDataHolderProtocol> holder) NS_SWIFT_UNAVAILABLE(\"\");\n@property (copy, nonatomic, readonly) JWTCodingBuilder *(^tokenCoder)(id<JWTStringCoderProtocol> tokenCoder) NS_SWIFT_UNAVAILABLE(\"\");\n@end\n\n@interface JWTEncodingBuilder (FluentStyle)\n@property (copy, nonatomic, readonly) JWTEncodingBuilder *(^payload)(NSDictionary *payload) NS_SWIFT_UNAVAILABLE(\"\");\n@property (copy, nonatomic, readonly) JWTEncodingBuilder *(^headers)(NSDictionary *headers) NS_SWIFT_UNAVAILABLE(\"\");\n@property (copy, nonatomic, readonly) JWTEncodingBuilder *(^claimsSetCoordinator)(id<JWTClaimsSetCoordinatorProtocol> claimsSetCoordinator) NS_SWIFT_UNAVAILABLE(\"\");\n@end\n\n@interface JWTDecodingBuilder (FluentStyle)\n@property (copy, nonatomic, readonly) JWTDecodingBuilder *(^message)(NSString *message) NS_SWIFT_UNAVAILABLE(\"\");\n@property (copy, nonatomic, readonly) JWTDecodingBuilder *(^claimsSetCoordinator)(id<JWTClaimsSetCoordinatorProtocol> claimsSetCoordinator) NS_SWIFT_UNAVAILABLE(\"\");\n@end\n\nNS_ASSUME_NONNULL_END\n#endif\n"
  },
  {
    "path": "Sources/JWT/include/JWTCryptoKey.h",
    "content": "//\n//  JWTCryptoKey.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 04.02.17.\n//  Copyright © 2017 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import <Security/Security.h>\n\n@protocol JWTCryptoKeyProtocol <NSObject>\n@property (copy, nonatomic, readonly) NSString *tag;\n@property (assign, nonatomic, readonly) SecKeyRef key;\n@property (copy, nonatomic, readonly) NSData *rawKey;\n@end\n\n@protocol JWTCryptoKey__Generator__Protocol\n- (instancetype)initWithData:(NSData *)data parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error; //NS_DESIGNATED_INITIALIZER\n- (instancetype)initWithBase64String:(NSString *)base64String parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error;\n- (instancetype)initWithPemEncoded:(NSString *)encoded parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error;\n- (instancetype)initWithPemAtURL:(NSURL *)url parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error;\n@end\n\n@protocol JWTCryptoKey__Raw__Generator__Protocol\n- (instancetype)initWithSecKeyRef:(SecKeyRef)key;\n@end\n\n@interface JWTCryptoKeyBuilder : NSObject\n@property (assign, nonatomic, readonly) NSString *keyType;\n- (instancetype)keyTypeRSA;\n- (instancetype)keyTypeEC;\n@end\n\n/*\n Don't use it directly, use subclasses instead!\n */\n@interface JWTCryptoKey : NSObject<JWTCryptoKeyProtocol> @end\n\n// Check that Security key is retrieved.\n// Could be used as additional step in key data verification.\n@interface JWTCryptoKey (Check)\n- (instancetype)checkedWithError:(NSError *__autoreleasing*)error;\n@end\n\n@interface JWTCryptoKey (Parameters)\n+ (NSString *)parametersKeyBuilder;\n@end\n\n@class JWTBase64Coder;\n@interface JWTCryptoKey (ExternalRepresentation)\n- (NSString *)externalRepresentationForCoder:(JWTBase64Coder *)coder error:(NSError *__autoreleasing *)error;\n@end\n\n@interface JWTCryptoKeyPublic : JWTCryptoKey <JWTCryptoKey__Generator__Protocol, JWTCryptoKey__Raw__Generator__Protocol>\n- (instancetype)initWithCertificateData:(NSData *)certificateData parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error; //NS_DESIGNATED_INITIALIZER;\n- (instancetype)initWithCertificateBase64String:(NSString *)certificateString parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error;\n@end\n\n@interface JWTCryptoKeyPrivate : JWTCryptoKey <JWTCryptoKey__Generator__Protocol, JWTCryptoKey__Raw__Generator__Protocol>\n- (instancetype)initWithP12Data:(NSData *)p12Data withPassphrase:(NSString *)passphrase parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error; //NS_DESIGNATED_INITIALIZER;\n- (instancetype)initWithP12AtURL:(NSURL *)url withPassphrase:(NSString *)passphrase parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error;\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTCryptoKeyExtractor+FluentStyle.h",
    "content": "//\n//  JWTCryptoKeyExtractor+FluentStyle.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 07/06/2019.\n//  Copyright © 2019 JWTIO. All rights reserved.\n//\n\n#import \"JWTCryptoKeyExtractor.h\"\n#import \"JWTDeprecations.h\"\n\n#if DEPLOYMENT_RUNTIME_SWIFT\n#else\nNS_ASSUME_NONNULL_BEGIN\n\n// Fluent ( Objective-C exclusive ).\n@interface JWTCryptoKeyExtractor (FluentStyle)\n@property (copy, nonatomic, readonly) JWTCryptoKeyExtractor * (^keyBuilder)(JWTCryptoKeyBuilder *keyBuilder) NS_SWIFT_UNAVAILABLE(\"\");\n@end\n\nNS_ASSUME_NONNULL_END\n#endif\n"
  },
  {
    "path": "Sources/JWT/include/JWTCryptoKeyExtractor.h",
    "content": "//\n//  JWTCryptoKeyExtractor.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 04.02.17.\n//  Copyright © 2017 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import <Security/Security.h>\n\n@protocol JWTCryptoKeyProtocol;\n@class JWTCryptoKeyBuilder;\n@protocol JWTCryptoKeyExtractorProtocol <NSObject>\n@optional\n- (id<JWTCryptoKeyProtocol>)keyFromString:(NSString *)string parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error;\n- (id<JWTCryptoKeyProtocol>)keyFromData:(NSData *)data parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error;\n@end\n\n@interface JWTCryptoKeyExtractor : NSObject <JWTCryptoKeyExtractorProtocol>\n@property (copy, nonatomic, readonly) NSString *type;\n@property (copy, nonatomic, readonly, class) NSString *type;\n@property (copy, nonatomic, readonly, class) NSString *parametersKeyCertificatePassphrase;\n\n#pragma mark - Getters\n@property (strong, nonatomic, readonly) JWTCryptoKeyBuilder *internalKeyBuilder;\n@end\n\n@interface JWTCryptoKeyExtractor (Setters)\n- (instancetype)configuredByKeyBuilder:(JWTCryptoKeyBuilder *)keyBuilder;\n@end\n\n@interface JWTCryptoKeyExtractor (ClassCluster)\n+ (instancetype)publicKeyWithCertificate;\n+ (instancetype)privateKeyInP12;\n+ (instancetype)publicKeyWithPEMBase64;\n+ (instancetype)privateKeyWithPEMBase64;\n+ (instancetype)createWithType:(NSString *)type;\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTCryptoSecurity+ErrorHandling.h",
    "content": "//\n//  JWTCryptoSecurity+ErrorHandling.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 08.08.2018.\n//  Copyright © 2018 JWTIO. All rights reserved.\n//\n\n#import <Security/Security.h>\n#import \"JWTCryptoSecurity.h\"\n\n@interface JWTCryptoSecurity (ErrorHandling)\n+ (NSError *)securityErrorWithOSStatus:(OSStatus)status;\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTCryptoSecurity+ExternalRepresentation.h",
    "content": "//\n//  JWTCryptoSecurity+ExternalRepresentation.h\n//  JWT\n//\n//  Created by Dmitry Lobanov on 08.08.2018.\n//  Copyright © 2018 JWTIO. All rights reserved.\n//\n\n#import <Security/Security.h>\n#import \"JWTCryptoSecurity.h\"\n\n@interface JWTCryptoSecurity (ExternalRepresentation)\n+ (NSData *)externalRepresentationForKey:(SecKeyRef)key error:(NSError *__autoreleasing*)error;\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTCryptoSecurity+Extraction.h",
    "content": "//\n//  JWTCryptoSecurity+Extraction.h\n//  JWT\n//\n//  Created by Dmitry on 7/31/18.\n//  Copyright © 2018 JWTIO. All rights reserved.\n//\n\n#import \"JWTCryptoSecurity.h\"\n\n// content is Base64 string, all '\\n' are removed.\n@interface JWTCryptoSecurityComponent : NSObject\n@property (copy, nonatomic, readwrite) NSString *content;\n@property (copy, nonatomic, readwrite) NSString *type;\n- (instancetype)initWithContent:(NSString *)content type:(NSString *)type;\n@end\n\n@interface JWTCryptoSecurityComponents : NSObject\n@property (copy, nonatomic, readonly, class) NSString *Certificate;\n@property (copy, nonatomic, readonly, class) NSString *PrivateKey;\n@property (copy, nonatomic, readonly, class) NSString *PublicKey;\n@property (copy, nonatomic, readonly, class) NSString *Key; // Public or Private\n\n@property (copy, nonatomic, readonly) NSArray *components;\n\n+ (NSArray *)components:(NSArray *)components ofType:(NSString *)type;\n- (NSArray *)componentsOfType:(NSString *)type;\n@end\n\n@interface JWTCryptoSecurity (Extraction)\n+ (JWTCryptoSecurityComponents *)componentsFromFile:(NSURL *)url;\n+ (JWTCryptoSecurityComponents *)componentsFromFileContent:(NSString *)content;\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTCryptoSecurity.h",
    "content": "//\n//  JWTCryptoSecurity.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 04.02.17.\n//  Copyright © 2017 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import <Security/Security.h>\n#import \"JWTDeprecations.h\"\n\n// Thanks for https://github.com/TakeScoop/SwiftyRSA!\n@interface JWTCryptoSecurityKeysTypes : NSObject\n+ (NSString *)RSA;\n+ (NSString *)EC;\n@end\n\n@interface JWTCryptoSecurity : NSObject\n+ (NSString *)keyTypeRSA __deprecated_with_replacement(\"JWTCryptoSecurityKeysTypes.RSA\");\n+ (NSString *)keyTypeEC __deprecated_with_replacement(\"JWTCryptoSecurityKeysTypes.EC\");\n@end\n\n@interface JWTCryptoSecurity (KeysManipulation)\n+ (SecKeyRef)addKeyWithData:(NSData *)data asPublic:(BOOL)public tag:(NSString *)tag type:(NSString *)type error:(NSError *__autoreleasing*)error;\n+ (SecKeyRef)addKeyWithData:(NSData *)data asPublic:(BOOL)public tag:(NSString *)tag error:(NSError *__autoreleasing*)error;\n+ (SecKeyRef)keyByTag:(NSString *)tag error:(NSError *__autoreleasing*)error;\n+ (BOOL)removeKeyByTag:(NSString *)tag error:(NSError *__autoreleasing*)error;\n@end\n\n@interface JWTCryptoSecurity (Certificates)\n+ (OSStatus)extractIdentityAndTrustFromPKCS12:(CFDataRef)inPKCS12Data password:(CFStringRef)password identity:(SecIdentityRef *)outIdentity trust:(SecTrustRef *)outTrust __deprecated_with_replacement(\"[JWTCryptoSecurity extractIdentityAndTrustFromPKCS12:(CFDataRef)inPKCS12Data password:(CFStringRef)password identity:(SecIdentityRef *)outIdentity trust:(SecTrustRef *)outTrust error:(CFErrorRef *)error]\");\n+ (OSStatus)extractIdentityAndTrustFromPKCS12:(CFDataRef)inPKCS12Data password:(CFStringRef)password identity:(SecIdentityRef *)outIdentity trust:(SecTrustRef *)outTrust error:(CFErrorRef *)error;\n+ (SecKeyRef)publicKeyFromCertificate:(NSData *)certificateData;\n@end\n\n@interface JWTCryptoSecurity (PublicKey)\n+ (NSData *)dataByRemovingPublicKeyHeader:(NSData *)data error:(NSError *__autoreleasing*)error;\n+ (NSData *)dataByExtractingKeyFromANS1:(NSData *)data error:(NSError *__autoreleasing*)error;\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTDeprecations.h",
    "content": "//\n//  JWTDeprecations.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 31.08.16.\n//  Copyright © 2016 Karma. All rights reserved.\n//\n\n#ifndef JWTDeprecations_h\n#define JWTDeprecations_h\n#import <Availability.h>\n\n#define JWT_STR(str) #str\n#define JWTVersion_2_1_0 2.1\n#define JWTVersion_2_2_0 2.2\n#define JWTVersion_3_0_0 3.0\n#define __first_deprecated_in_release_version(version) __deprecated_msg(\"first deprecated in release version: \" JWT_STR(version))\n#define __deprecated_and_will_be_removed_in_release_version(version) __deprecated_msg(\"deprecated. will be removed in release version: \"JWT_STR(version))\n#define __available_in_release_version(version) __deprecated_msg(\"will be introduced in release version: \" JWT_STR(version))\n#define __jwt_technical_debt(debt) __deprecated_msg(\"Don't forget to inspect it later.\" JWT_STR(debt))\n#define __deprecated_with_replacement(msg) __deprecated_msg(\"Use \" JWT_STR(msg))\n#endif /* JWTDeprecations_h */\n\n#ifndef JWT_macOS\n#define JWT_macOS(VALUE) VALUE\n#endif\n\n#ifndef JWT_iOS\n#define JWT_iOS(VALUE) VALUE\n#endif\n\n#ifndef JWT_tvOS\n#define JWT_tvOS(VALUE) VALUE\n#endif\n\n#ifndef JWT_watchOS\n#define JWT_watchOS(VALUE) VALUE\n#endif\n\n#ifndef JWT_COMPILE_TIME_AVAILABILITY\n#define JWT_COMPILE_TIME_AVAILABILITY(macOS, iOS, tvOS, watchOS) defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (__MAC_OS_X_VERSION_MIN_REQUIRED >= macOS) \\\n|| defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= iOS) \\\n|| defined(__TV_OS_VERSION_MIN_REQUIRED) && (__TV_OS_VERSION_MIN_REQUIRED >= tvOS) \\\n|| defined(__WATCH_OS_VERSION_MIN_REQUIRED) && (__WATCH_OS_VERSION_MIN_REQUIRED >= watchOS)\n#endif\n"
  },
  {
    "path": "Sources/JWT/include/JWTErrorDescription.h",
    "content": "//\n//  JWTErrorDescription.h\n//  JWT\n//\n//  Created by Lobanov Dmitry on 27.11.16.\n//  Copyright © 2016 JWTIO. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\nextern NSString *JWTErrorDomain;\n\ntypedef NS_ENUM(NSInteger, JWTError) {\n    JWTUnexpectedError = -99,\n    JWTInvalidFormatError,\n    JWTUnsupportedAlgorithmError,\n    JWTAlgorithmNameMismatchError,\n    JWTInvalidSignatureError,\n    JWTNoPayloadError,\n    JWTNoHeaderError,\n    JWTEncodingHeaderError,\n    JWTEncodingPayloadError,\n    JWTEncodingSigningError,\n    JWTClaimsSetVerificationFailed,\n    JWTInvalidSegmentSerializationError,\n    JWTUnspecifiedAlgorithmError,\n    JWTBlacklistedAlgorithmError,\n    JWTDecodingHeaderError,\n    JWTDecodingPayloadError,\n    JWTDecodingHoldersChainEmptyError,\n    JWTHolderSecretDataNotSetError\n};\n\n@interface JWTErrorDescription : NSObject\n+ (NSError *)errorWithCode:(JWTError)code;\n@end\n"
  },
  {
    "path": "Sources/JWT/include/JWTRSAlgorithm.h",
    "content": "//\n// Created by Marcelo Schroeder on 12/03/2016.\n// Copyright (c) 2016 Karma. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"JWTAlgorithm.h\"\n@protocol JWTCryptoKeyProtocol;\n\n@protocol JWTAsymmetricKeysAlgorithm <JWTAlgorithm>\n\n@optional\n@property(nonatomic, readwrite, copy) NSString *keyExtractorType;\n@property(nonatomic, readwrite, strong) id<JWTCryptoKeyProtocol> signKey;\n@property(nonatomic, readwrite, strong) id<JWTCryptoKeyProtocol> verifyKey;\n\n@end\n\n@protocol JWTRSAlgorithm <JWTAsymmetricKeysAlgorithm, NSCopying>\n\n@required\n@property(nonatomic, readwrite, copy) NSString *privateKeyCertificatePassphrase;\n@end\n"
  },
  {
    "path": "Tests/JWTTests/Helpers/JWTAssetAccessor.m",
    "content": "//\n//  JWTAssetAccessor.m\n//  Tests\n//\n//  Created by Dmitry Lobanov on 05.01.2022.\n//\n\n#import \"JWTAssetAccessor.h\"\n#import \"resource_bundle_accessor.h\"\n\n@implementation JWTAssetAccessor (FolderAccess)\n- (NSString *)stringFromFileWithName:(NSString *)name {\n    __auto_type data = [self dataFromFileWithName:name];\n    return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];\n}\n\n- (NSData *)dataFromFileWithName:(NSString *)name {\n    __auto_type asset = [self assetFromFileWithName:name];\n    __auto_type data = asset.data;\n    return data;\n}\n\n- (NSDataAsset *)assetFromFileWithName:(NSString *)name {\n    __auto_type path = [self.folder stringByAppendingPathComponent:name];\n    __auto_type bundle = SWIFTPM_MODULE_BUNDLE;\n    __auto_type asset = [[NSDataAsset alloc] initWithName:path bundle:bundle];\n    return asset;\n}\n@end\n\n@implementation JWTAssetAccessor (Getters)\n- (NSString *)privateKeyBase64 {\n    return [self stringFromFileWithName:@\"private.pem\"];\n}\n- (NSString *)publicKeyBase64 {\n    return [self stringFromFileWithName:@\"public.pem\"];\n}\n- (NSString *)certificateBase64 {\n    return [self stringFromFileWithName:@\"certificate.cer\"];\n}\n- (NSData *)p12Data {\n    return [self dataFromFileWithName:@\"private.p12\"];\n}\n- (NSString *)p12Password {\n    return [self stringFromFileWithName:@\"p12_password.txt\"];\n}\n@end\n\n@implementation JWTAssetAccessor\n- (instancetype)initWithFolder:(NSString *)folder {\n    if (self = [super init]) {\n        self.folder = folder;\n        // check that data exists!\n        if (!self.check) {\n            return nil;\n        }\n    }\n    return self;\n}\n\n- (instancetype)initWithAlgorithmType:(NSString *)type shaSize:(NSNumber *)size {\n    return [self initWithFolder:[type stringByAppendingPathComponent:size.description]];\n}\n\n+ (NSArray *)typeAndSizeFromAlgorithmName:(NSString *)name {\n    if (name.length < 3) {\n        return nil;\n    }\n    __auto_type type = [name substringToIndex:2];\n    __auto_type size = [name substringFromIndex:2];\n    if (type == nil || size == nil) {\n        return nil;\n    }\n    return @[type, size];\n}\n\n- (instancetype)initWithAlgorithName:(NSString *)name {\n    // split name into type and size.\n    // just lowercase everything.\n    return [self initWithFolder:name.lowercaseString];\n}\n@end\n\n@implementation JWTAssetAccessor (Validation)\n- (nullable instancetype)checked {\n    return self.check ? self : nil;\n}\n- (BOOL)check {\n    return [self assetFromFileWithName:@\"private.pem\"] != nil;\n}\n@end\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es256/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"properties\" : {\n    \"provides-namespace\" : true\n  }\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es256/certificate.cer.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-prime256v1.cer\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es256/certificate.cer.dataset/ec-prime256v1.cer",
    "content": "-----BEGIN CERTIFICATE-----\nMIIB3TCCAYQCCQDhm7YZ2lZMCDAKBggqhkjOPQQDAjB3MQswCQYDVQQGEwJHQjEP\nMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xGDAWBgNVBAoMD0dsb2Jh\nbCBTZWN1cml0eTEWMBQGA1UECwwNSVQgRGVwYXJ0bWVudDEUMBIGA1UEAwwLZXhh\nbXBsZS5jb20wHhcNMTgwNzMxMjA1NTQ2WhcNMTgwODMwMjA1NTQ2WjB3MQswCQYD\nVQQGEwJHQjEPMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xGDAWBgNV\nBAoMD0dsb2JhbCBTZWN1cml0eTEWMBQGA1UECwwNSVQgRGVwYXJ0bWVudDEUMBIG\nA1UEAwwLZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAS6NgwU\nXdcx1suUaVt7tBcFmLy0Q5QX74rS+xzFbmNjvnTuP4EF/f4G8GVxWIAD+DGMee5T\n3wrFvX/eIkO2cvNEMAoGCCqGSM49BAMCA0cAMEQCIEz5wCyBUEHwSR5WTzHoPNIU\n20aaAVscEX04QyA5nuyJAiBSYB04ZDmuqwk0NWFN8vXyCo1dKlHFIyg+txfLMyag\n0w==\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es256/original.private.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-prime256v1-private.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es256/original.private.pem.dataset/ec-prime256v1-private.pem",
    "content": "-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIPeN6twH/ywfgaKRjU4RRTJG9TzVWF9ZHvjQXCpukBD8oAoGCCqGSM49\nAwEHoUQDQgAEujYMFF3XMdbLlGlbe7QXBZi8tEOUF++K0vscxW5jY7507j+BBf3+\nBvBlcViAA/gxjHnuU98Kxb1/3iJDtnLzRA==\n-----END EC PRIVATE KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es256/original.public.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-prime256v1-public.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es256/original.public.pem.dataset/ec-prime256v1-public.pem",
    "content": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEujYMFF3XMdbLlGlbe7QXBZi8tEOU\nF++K0vscxW5jY7507j+BBf3+BvBlcViAA/gxjHnuU98Kxb1/3iJDtnLzRA==\n-----END PUBLIC KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es256/p12_password.txt.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-prime256v1-p12-password.txt\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es256/p12_password.txt.dataset/ec-prime256v1-p12-password.txt",
    "content": "password"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es256/private.p12.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-prime256v1-private.p12\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es256/private.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-prime256v1-private.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es256/private.pem.dataset/ec-prime256v1-private.pem",
    "content": "-----BEGIN EC PRIVATE KEY-----\nBLo2DBRd1zHWy5RpW3u0FwWYvLRDlBfvitL7HMVuY2O-dO4_gQX9_gbwZXFYgAP4MYx57lPfCsW9f94iQ7Zy80T3jercB_8sH4GikY1OEUUyRvU81VhfWR740FwqbpAQ_A\n-----END EC PRIVATE KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es256/public.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-prime256v1-public.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es256/public.pem.dataset/ec-prime256v1-public.pem",
    "content": "-----BEGIN PUBLIC KEY-----\nBLo2DBRd1zHWy5RpW3u0FwWYvLRDlBfvitL7HMVuY2O-dO4_gQX9_gbwZXFYgAP4MYx57lPfCsW9f94iQ7Zy80Q\n-----END PUBLIC KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es384/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"properties\" : {\n    \"provides-namespace\" : true\n  }\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es384/certificate.cer.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-secp384r1.cer\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es384/certificate.cer.dataset/ec-secp384r1.cer",
    "content": "-----BEGIN CERTIFICATE-----\nMIICGzCCAaECCQC4+VxcfXk0UTAKBggqhkjOPQQDAjB3MQswCQYDVQQGEwJHQjEP\nMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xGDAWBgNVBAoMD0dsb2Jh\nbCBTZWN1cml0eTEWMBQGA1UECwwNSVQgRGVwYXJ0bWVudDEUMBIGA1UEAwwLZXhh\nbXBsZS5jb20wHhcNMTgwNzMxMjA1NTU3WhcNMTgwODMwMjA1NTU3WjB3MQswCQYD\nVQQGEwJHQjEPMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xGDAWBgNV\nBAoMD0dsb2JhbCBTZWN1cml0eTEWMBQGA1UECwwNSVQgRGVwYXJ0bWVudDEUMBIG\nA1UEAwwLZXhhbXBsZS5jb20wdjAQBgcqhkjOPQIBBgUrgQQAIgNiAATFBX/XSrL3\nBb94PKHu/CyrtkXgyeCnbWUltmG0/qomAdlpa9XMHk/gp5Cf7tKEa8Fp5c7LKAr7\n6U702QPDg2N/Y5sv8CwzgYM4L3eqGBTAK0aHYty1nh39YyYG6Hrw46EwCgYIKoZI\nzj0EAwIDaAAwZQIwRj8hKXv27JaAarWAT8Kp9qtV+XODUwdg61seaaJtW9rUgAmg\nVL8TzqvucbG1JlxcAjEA+Ygwp2l6sPAPelZDVnhyET260PDQp0vCKf/kq9OHceIg\nAaxGeQF/bzaEfVdB66U7\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es384/original.private.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-secp384r1-private.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es384/original.private.pem.dataset/ec-secp384r1-private.pem",
    "content": "-----BEGIN EC PRIVATE KEY-----\nMIGkAgEBBDA4MOBnImNGKyrmWrpm+zJJYdzylhvpAGaCXAQK7gNpLIGkkK+t/E5J\nMEPP2F/rFM6gBwYFK4EEACKhZANiAATFBX/XSrL3Bb94PKHu/CyrtkXgyeCnbWUl\ntmG0/qomAdlpa9XMHk/gp5Cf7tKEa8Fp5c7LKAr76U702QPDg2N/Y5sv8CwzgYM4\nL3eqGBTAK0aHYty1nh39YyYG6Hrw46E=\n-----END EC PRIVATE KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es384/original.public.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-secp384r1-public.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es384/original.public.pem.dataset/ec-secp384r1-public.pem",
    "content": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAExQV/10qy9wW/eDyh7vwsq7ZF4Mngp21l\nJbZhtP6qJgHZaWvVzB5P4KeQn+7ShGvBaeXOyygK++lO9NkDw4Njf2ObL/AsM4GD\nOC93qhgUwCtGh2LctZ4d/WMmBuh68OOh\n-----END PUBLIC KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es384/p12_password.txt.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-secp384r1-p12-password.txt\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es384/p12_password.txt.dataset/ec-secp384r1-p12-password.txt",
    "content": "password"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es384/private.p12.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-secp384r1-private.p12\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es384/private.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-secp384r1-private.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es384/private.pem.dataset/ec-secp384r1-private.pem",
    "content": "-----BEGIN EC PRIVATE KEY-----\nBMUFf9dKsvcFv3g8oe78LKu2ReDJ4KdtZSW2YbT-qiYB2Wlr1cweT-CnkJ_u0oRrwWnlzssoCvvpTvTZA8ODY39jmy_wLDOBgzgvd6oYFMArRodi3LWeHf1jJgboevDjoTgw4GciY0YrKuZaumb7Mklh3PKWG-kAZoJcBAruA2ksgaSQr638TkkwQ8_YX-sUzg\n-----END EC PRIVATE KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es384/public.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-secp384r1-public.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es384/public.pem.dataset/ec-secp384r1-public.pem",
    "content": "-----BEGIN PUBLIC KEY-----\nBMUFf9dKsvcFv3g8oe78LKu2ReDJ4KdtZSW2YbT-qiYB2Wlr1cweT-CnkJ_u0oRrwWnlzssoCvvpTvTZA8ODY39jmy_wLDOBgzgvd6oYFMArRodi3LWeHf1jJgboevDjoQ\n-----END PUBLIC KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es512/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"properties\" : {\n    \"provides-namespace\" : true\n  }\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es512/certificate.cer.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-secp521r1.cer\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es512/certificate.cer.dataset/ec-secp521r1.cer",
    "content": "-----BEGIN CERTIFICATE-----\nMIICZjCCAccCCQChvb7gSTjeHjAKBggqhkjOPQQDAjB3MQswCQYDVQQGEwJHQjEP\nMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xGDAWBgNVBAoMD0dsb2Jh\nbCBTZWN1cml0eTEWMBQGA1UECwwNSVQgRGVwYXJ0bWVudDEUMBIGA1UEAwwLZXhh\nbXBsZS5jb20wHhcNMTgwNzMxMjA1NzA3WhcNMTgwODMwMjA1NzA3WjB3MQswCQYD\nVQQGEwJHQjEPMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xGDAWBgNV\nBAoMD0dsb2JhbCBTZWN1cml0eTEWMBQGA1UECwwNSVQgRGVwYXJ0bWVudDEUMBIG\nA1UEAwwLZXhhbXBsZS5jb20wgZswEAYHKoZIzj0CAQYFK4EEACMDgYYABABV4DpG\npq38eStMgLV7g80lhF07JABVu/1fp+FvCIodZYd1xdHnYIBfN3h7jSRR5atRlMw+\nEBVUBMLwy99yAGokdQFM91nnYnLGefYeRV/mF/QLQ+BUp0tLcydJ0N9BLPQUJG/F\ndl+GjZqConuRy/Q7wDhEFYJCnjPJO89BoNSdNUEpZjAKBggqhkjOPQQDAgOBjAAw\ngYgCQgErm1sEymoMYg3KSoQAuNvpPyO/Qe+F7TJJWVmLlKkEeqe0WanqMEgN1KP0\nETICemzCaYZ+o/TUEKVNLXfFuGRr3AJCAelJBXK2+CcLAS/A69TGOOV7YOkUaqHh\nMnnY0SO0Gd0a5/uti1JzFc1PNxnH45yEqjiX82peGAaDQwBtIMYBDUqk\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es512/original.private.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-secp521r1-private.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es512/original.private.pem.dataset/ec-secp521r1-private.pem",
    "content": "-----BEGIN EC PRIVATE KEY-----\nMIHcAgEBBEIByPhQcUtwTm2SGGHwRbp36v53CgXQTG7dNGnjJ6xHmNi67L+hvYhO\nioqRZGGtUgfCZ3IZnSpelkw/HYfAAIjNkbagBwYFK4EEACOhgYkDgYYABABV4DpG\npq38eStMgLV7g80lhF07JABVu/1fp+FvCIodZYd1xdHnYIBfN3h7jSRR5atRlMw+\nEBVUBMLwy99yAGokdQFM91nnYnLGefYeRV/mF/QLQ+BUp0tLcydJ0N9BLPQUJG/F\ndl+GjZqConuRy/Q7wDhEFYJCnjPJO89BoNSdNUEpZg==\n-----END EC PRIVATE KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es512/original.public.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-secp521r1-public.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es512/original.public.pem.dataset/ec-secp521r1-public.pem",
    "content": "-----BEGIN PUBLIC KEY-----\nMIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQAVeA6Rqat/HkrTIC1e4PNJYRdOyQA\nVbv9X6fhbwiKHWWHdcXR52CAXzd4e40kUeWrUZTMPhAVVATC8MvfcgBqJHUBTPdZ\n52Jyxnn2HkVf5hf0C0PgVKdLS3MnSdDfQSz0FCRvxXZfho2agqJ7kcv0O8A4RBWC\nQp4zyTvPQaDUnTVBKWY=\n-----END PUBLIC KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es512/p12_password.txt.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-secp521r1-p12-password.txt\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es512/p12_password.txt.dataset/ec-secp521r1-p12-password.txt",
    "content": "password"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es512/private.p12.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-secp521r1-private.p12\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es512/private.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-secp521r1-private.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es512/private.pem.dataset/ec-secp521r1-private.pem",
    "content": "-----BEGIN EC PRIVATE KEY-----\nBABV4DpGpq38eStMgLV7g80lhF07JABVu_1fp-FvCIodZYd1xdHnYIBfN3h7jSRR5atRlMw-EBVUBMLwy99yAGokdQFM91nnYnLGefYeRV_mF_QLQ-BUp0tLcydJ0N9BLPQUJG_Fdl-GjZqConuRy_Q7wDhEFYJCnjPJO89BoNSdNUEpZgHI-FBxS3BObZIYYfBFunfq_ncKBdBMbt00aeMnrEeY2Lrsv6G9iE6KipFkYa1SB8JnchmdKl6WTD8dh8AAiM2Rtg\n-----END EC PRIVATE KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es512/public.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"ec-secp521r1-public.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/es512/public.pem.dataset/ec-secp521r1-public.pem",
    "content": "-----BEGIN PUBLIC KEY-----\nBABV4DpGpq38eStMgLV7g80lhF07JABVu_1fp-FvCIodZYd1xdHnYIBfN3h7jSRR5atRlMw-EBVUBMLwy99yAGokdQFM91nnYnLGefYeRV_mF_QLQ-BUp0tLcydJ0N9BLPQUJG_Fdl-GjZqConuRy_Q7wDhEFYJCnjPJO89BoNSdNUEpZg\n-----END PUBLIC KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"properties\" : {\n    \"provides-namespace\" : true\n  }\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256/certificate.cer.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-2048.cer\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256/certificate.cer.dataset/rsa-2048.cer",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDajCCAlICCQD6TDhyi4F/+jANBgkqhkiG9w0BAQsFADB3MQswCQYDVQQGEwJH\nQjEPMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xGDAWBgNVBAoMD0ds\nb2JhbCBTZWN1cml0eTEWMBQGA1UECwwNSVQgRGVwYXJ0bWVudDEUMBIGA1UEAwwL\nZXhhbXBsZS5jb20wHhcNMTgwNzMxMjA1MDI1WhcNMTgwODMwMjA1MDI1WjB3MQsw\nCQYDVQQGEwJHQjEPMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xGDAW\nBgNVBAoMD0dsb2JhbCBTZWN1cml0eTEWMBQGA1UECwwNSVQgRGVwYXJ0bWVudDEU\nMBIGA1UEAwwLZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\nAoIBAQDJ0wVVrZjnhEF0F+mx1PRFlPSL04jYv3rwxF6/o3Y8WokL8UzC635Xg0ZE\n0sm7YBbNWN89JRvK4HfzK0odLo+8o8bM/HxrmPRkgbAszZQV72SdVmVjXqfC+Qip\nUVNLE4lvzQz7w6pld3lMUdXljDgtUy96HqN4LzZbOUyFy3C2LaDF7msaE+udWsT0\ncqUyEpxjNyzU8CGYxZ9E+ldHvwXpV0ILJMtCmFLWx4TlQsCOL5J4vKa1xP6s9Cif\nx7D9duXppVozqQar7jJqLLHEfm1v46bACKH4Cx9khxfMBVP6F1aWUhAa/t2G2mlf\nOCrIEheljj/jO708ak5UbDu66hhDAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAIJ5\nhy/iYbtWri1uV+vrSJ/bwCRO7liYcSEAZA1Ao0PK2LDMI6gqZ0/TBJZR0NR8P9Ep\nk+MZ+u7g7t/MF4Pn6fXppnsP7Jie63csg+WLSs+hykLUNAcAbW4wYO5XvTRJ1+4a\nSgoOhWrJODTkIU7fyqDNZhcXqobr+j9DRPd6E+Noj410c/+8ugUKrYJ/SVJbyvmm\noEbrpCMuKzboZZmeOIkYYlCs/xkxi8IjDiqpUVWkxvf7ml/PAXRKAsekE77UXETH\nj82ZwkPk9373cnLbmyJBJoLt5FmuncQsvXDcq+FlLeJ/DvAwGoI4KbtB+SW+e4lC\nXDKyt5fnEF2owfBI3tA=\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256/p12_password.txt.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-2048-p12-password.txt\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256/p12_password.txt.dataset/rsa-2048-p12-password.txt",
    "content": "password"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256/private.p12.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-2048-private.p12\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256/private.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-2048-private.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256/private.pem.dataset/rsa-2048-private.pem",
    "content": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAydMFVa2Y54RBdBfpsdT0RZT0i9OI2L968MRev6N2PFqJC/FM\nwut+V4NGRNLJu2AWzVjfPSUbyuB38ytKHS6PvKPGzPx8a5j0ZIGwLM2UFe9knVZl\nY16nwvkIqVFTSxOJb80M+8OqZXd5TFHV5Yw4LVMveh6jeC82WzlMhctwti2gxe5r\nGhPrnVrE9HKlMhKcYzcs1PAhmMWfRPpXR78F6VdCCyTLQphS1seE5ULAji+SeLym\ntcT+rPQon8ew/Xbl6aVaM6kGq+4yaiyxxH5tb+OmwAih+AsfZIcXzAVT+hdWllIQ\nGv7dhtppXzgqyBIXpY4/4zu9PGpOVGw7uuoYQwIDAQABAoIBAQCxutwazEo3rzc4\ntgo9aWxHjlogfIMpZM4uEq/hkWCA27WOR8uyZ1GWXWtXFk1CbecGpLnKjdBAw5W+\nFaQpuKQpmgxq3fnvgv3NOIvdmJhNDMkM6VVVwbh4sXfYK17vYWAJjYheebunqSOv\neu2jPO0HtRa9Mxf/sYvrn7TsqfAy7MDOkPn8bDFYUPS1gM3rVRDjOk0f9N5mDsPp\nCgB5ji+lo+E4FYjkHwitmB6KQeqpHyZUfGiZWVYW7kuk/FJrdSCgSOSjlf4rLndO\n9rfg8OR2nIK1Ol07VjOnEEv35lPPmAkKvfd3NJRLrBgZkVf4/IsQZpToXIzWIj2S\nzvYpmAdpAoGBAO1Q6+RZHMZ9xNNCXDOJvvaG4/seJjwyRwE8Q3DEJ3dLBwzpzcSl\nNXQkxJaG1hSKVzjrxhluXOtBj/bZUJ5dzaPfL6KXzecLWuwvHPTHbUk9rKrIRE01\nvw9b7O3GuXciOVGacZh2BRvTWYih+9xEIiOzft/ULDI+RFXqcMK5AK0tAoGBANm2\nxCqQYCBzRgZ2NjTaDS5DSoDFZ4pyH9fodUe9FKu2lVbWbQAoaoARvpo0EevjuOlk\n/mg91sSSr5hWVYqKXyHE3XueIhQqHbCDfPgWYx75Gavj+o94xva7H5Gm7dXIKTYb\nNfutkCFqHeUy2Omhv2YoRDL5ZP8jv/DTACXpBaEvAoGBAMslu1i048oSfXuu0ciY\ngKz+WYhsjaR4EYpAMScF8xbOVhG6zxcnqXNryhFlCTt6FSI3ylOYwtfsPrW736RB\nfjhqZJeVxX+jm8iUp//t+2J39igX2UgS2yPluBLvS3JtDI4LXHR7ivH/4SPyLeyn\nMmZHUDOAp/i2jr7ROoel4KtdAoGAOEtr+d2PHZTw/GbAqXXghp/bueRRW5ka5scy\n3DPmDmiNwQB8+td4glkUQedI4wflHmSA7A9hYz7SrL9WKxaQdrji1D4VbcVeG/BD\n9hpD0xRyMOIoPcTrHY1RImZZhTfWgCkVEljUte8sf8FgGTk7tnye9ddK6DYkQW8t\n0J+qVv0CgYEAokrsy0SqGreBRFvvekSOK9jC+rFCkYcvfK6b7/Y30W6ZjP6Q27LL\nWJWpS5UKGiydOejk9vt3AhZ+FzWCmQyaHLWYo1Vha9WgPZXU7GPaPFnGjfBou+Wm\nKx01RnN0AC4C1sqFV2GnbPZXt4sytSTrr0724pzvWm74To2JAzuGsBw=\n-----END RSA PRIVATE KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256/public.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-2048-public.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256/public.pem.dataset/rsa-2048-public.pem",
    "content": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAydMFVa2Y54RBdBfpsdT0\nRZT0i9OI2L968MRev6N2PFqJC/FMwut+V4NGRNLJu2AWzVjfPSUbyuB38ytKHS6P\nvKPGzPx8a5j0ZIGwLM2UFe9knVZlY16nwvkIqVFTSxOJb80M+8OqZXd5TFHV5Yw4\nLVMveh6jeC82WzlMhctwti2gxe5rGhPrnVrE9HKlMhKcYzcs1PAhmMWfRPpXR78F\n6VdCCyTLQphS1seE5ULAji+SeLymtcT+rPQon8ew/Xbl6aVaM6kGq+4yaiyxxH5t\nb+OmwAih+AsfZIcXzAVT+hdWllIQGv7dhtppXzgqyBIXpY4/4zu9PGpOVGw7uuoY\nQwIDAQAB\n-----END PUBLIC KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256old/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"properties\" : {\n    \"provides-namespace\" : true\n  }\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256old/certificate.cer.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rs256-cert.cer\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256old/certificate.cer.dataset/rs256-cert.cer",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQsFADBKMR0wGwYDVQQDDBREaWdp\ndGFsIFNpZ25pbmcgVGVzdDELMAkGA1UEBhMCQVUxHDAaBgkqhkiG9w0BCQEWDXRl\nc3RAdGVzdC5jb20wHhcNMTYwMzEwMjM0ODQ2WhcNMTcwMzEwMjM0ODQ2WjBKMR0w\nGwYDVQQDDBREaWdpdGFsIFNpZ25pbmcgVGVzdDELMAkGA1UEBhMCQVUxHDAaBgkq\nhkiG9w0BCQEWDXRlc3RAdGVzdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\nggEKAoIBAQD2G4yWiZX9H4CsbWWpHT/bfRid7yU569j9f2gSB6kYv9wMsd/Crx2p\nHwIT5uK9gTJ4+5PYaeweB3Tu7uo9ob4EG83k2VF26ruRflzBaSzE4TotxuNoE83B\nVKFoR1oPdg3BmT7qPCRshz6b36zXfxVQgBYU2F2nUQKbjqCiFEs6w2VrbG5RQwHL\nEwmLwDu3WPFOwuO2aPP0dRh1E25DeZlzqNFcYaoAf5wEmwWn79oOmzETWh0uTHTg\ndCrZSp48ZvXf9iFZgqd5HIt0Ub5x5ZYuSZz5FJ8GRRp/0s4q4FG2T0XHsUkvnoMO\nKGkPUmkpFk4CKZa5BnnKIDGQMr2ndjaNAgMBAAGjRDBCMA4GA1UdDwEB/wQEAwIH\ngDAWBgNVHSUBAf8EDDAKBggrBgEFBQcDBDAYBgNVHREEETAPgQ10ZXN0QHRlc3Qu\nY29tMA0GCSqGSIb3DQEBCwUAA4IBAQDcOYflkAlubGJlv5T1G7PdcHzMzu6doah/\n9RmRyHS8wehc0GljYIyBkhbBG/iRumi6nnnU3BARv+JdSHbpIVsRaXmImWv5I/GO\nOfUO6UY7jlsw1mCjQyIIZoOFyUKnbcvrb0bCryD3rcbAflYg8feq3AiQv3CacxOy\nIbYh3khqbs1jKSAzxEdcsuHRB+by5gpwMfF5ByGdMmMl81mFMUuGlcWsfZp2N4Vz\n7MWVRl38OWkwZ0yw/Jpd1kcVwKIrXF3rjA71AN41rzyMvvPaEfdgCyFolixEOoJH\nFdidq1Bf0liKxf+MFJOaxSWKGqrvzPoBfmwCFoPahuaUlVZ4lGvr\n-----END CERTIFICATE-----"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256old/p12_password.txt.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"password.txt\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256old/p12_password.txt.dataset/password.txt",
    "content": "password"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256old/private.p12.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rs256-private.p12\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256old/private.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rs256-private.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256old/private.pem.dataset/rs256-private.pem",
    "content": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEA9huMlomV/R+ArG1lqR0/230Yne8lOevY/X9oEgepGL/cDLHf\nwq8dqR8CE+bivYEyePuT2GnsHgd07u7qPaG+BBvN5NlRduq7kX5cwWksxOE6Lcbj\naBPNwVShaEdaD3YNwZk+6jwkbIc+m9+s138VUIAWFNhdp1ECm46gohRLOsNla2xu\nUUMByxMJi8A7t1jxTsLjtmjz9HUYdRNuQ3mZc6jRXGGqAH+cBJsFp+/aDpsxE1od\nLkx04HQq2UqePGb13/YhWYKneRyLdFG+ceWWLkmc+RSfBkUaf9LOKuBRtk9Fx7FJ\nL56DDihpD1JpKRZOAimWuQZ5yiAxkDK9p3Y2jQIDAQABAoIBAQDEu88Nw5xvxNAS\nhjz/DE+wwHZ+Qd6LR7qlIkTqLM+C5lQcndBWi6/1MsFxcV8NyAq15b4RANNsSd+y\n5K/BZttD44oah5J0sj4Ql2fEgLP2Cml8kIHXAAW5p1KDzo3y0Bc9DKjbjAo963sk\nFZDQj1lViZ6dOTzcdIjWGxTTm89rf5frVPUJxNFB+VRHWuyRGudXzGw6g0EX0vMx\n92PFy3NFFSczgRZS0rx+PEN/kYBThdZoWcBnhfq2YLLW5ID0urs6vs2QqGZK/AQE\nB3DezX6arlHvyjOtb9oYl9QV5YG1faqgE9YWQvmkxKHvitcTTYA6fgn7KhCqZmno\nF2WrtkDNAoGBAP5tDiFPGonvZJB4KEmWITqWiYFdlZ9yJ5r1mIRywuJQJ6NCwADd\nv3qvGnjpI4NUFNHvuPr+PYXGi8wlvKGXO7EkO7DyB5hs7LiKyppUBH/Vb4KopAFo\nceG/2B21g0AeF6RuRshWIQwqAzTmz+T4+Kj8WE6e146a3L7TNOM5yOrjAoGBAPeh\nUd9hciqlr/8OhnUUIRUC67F3CBjBl7xnDy+00MPe0A1SsKODBQOTQRq/mr75AM8F\nIwI7wTo0joj4x8LP43YUeOUHUapQoX1AUzAlaZhd5m2wAUOkip15P0mw/GpN9brl\ns3BRZ7DHNzyIay9htM+8YGzUEPwUdyQmln6js+PPAoGAdx7gKsA6kLJAx1M6qZlc\n3W1129fRIeH0oRyz1+9TR1p39HxgIQexiuNI5atiMS7AwLoYRYubinK3KVHRy2Zf\nUETCncnzvG3jN1PkH/WOVbu8hdQnVXFtQGDt8pr1ZKOyNg5bnZiVyHgzICWg2Hep\nFJVxUv4TtnTTPZTtgiWf6DkCgYEAsAghp2YiPmbiIbI1quzQR5t36QPw4YhdUTUB\n+qvS7CpsQ8xQfSwaWFxJn7YtTyy7gm7oYCISTkomOQCBIN+flsUe29DEIQqIgf1E\nJamy0vmNYNQJUgiZ8S/L6ZrDFN6unFnFoUZ9K5GylnlzmI8gdbw336UxHcF+oFg+\nC3Bb5MkCgYBuPywM9nuF8EbeuHCl/3LRkVaNwRwFjgb7NV47E30+3YoM6qvcDG1q\niAi5KixQfk1oW1GGdvMOzOIK+AseKZNxuYwAjynNr6iGyMnPAvaVfv8ZcbmAe1Dx\neX8OG0k/j128DnQZd6Be3yl9qH8eOqCv7eZpe0xO0uZjeyA7TFAEhg==\n-----END RSA PRIVATE KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256old/public.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rs256-public.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs256old/public.pem.dataset/rs256-public.pem",
    "content": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9huMlomV/R+ArG1lqR0/\n230Yne8lOevY/X9oEgepGL/cDLHfwq8dqR8CE+bivYEyePuT2GnsHgd07u7qPaG+\nBBvN5NlRduq7kX5cwWksxOE6LcbjaBPNwVShaEdaD3YNwZk+6jwkbIc+m9+s138V\nUIAWFNhdp1ECm46gohRLOsNla2xuUUMByxMJi8A7t1jxTsLjtmjz9HUYdRNuQ3mZ\nc6jRXGGqAH+cBJsFp+/aDpsxE1odLkx04HQq2UqePGb13/YhWYKneRyLdFG+ceWW\nLkmc+RSfBkUaf9LOKuBRtk9Fx7FJL56DDihpD1JpKRZOAimWuQZ5yiAxkDK9p3Y2\njQIDAQAB\n-----END PUBLIC KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs384/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"properties\" : {\n    \"provides-namespace\" : true\n  }\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs384/certificate.cer.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-3072.cer\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs384/certificate.cer.dataset/rsa-3072.cer",
    "content": "-----BEGIN CERTIFICATE-----\nMIIEajCCAtICCQDGPcLvAf2Z+DANBgkqhkiG9w0BAQsFADB3MQswCQYDVQQGEwJH\nQjEPMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xGDAWBgNVBAoMD0ds\nb2JhbCBTZWN1cml0eTEWMBQGA1UECwwNSVQgRGVwYXJ0bWVudDEUMBIGA1UEAwwL\nZXhhbXBsZS5jb20wHhcNMTgwNzMxMjA1MTE3WhcNMTgwODMwMjA1MTE3WjB3MQsw\nCQYDVQQGEwJHQjEPMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xGDAW\nBgNVBAoMD0dsb2JhbCBTZWN1cml0eTEWMBQGA1UECwwNSVQgRGVwYXJ0bWVudDEU\nMBIGA1UEAwwLZXhhbXBsZS5jb20wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGK\nAoIBgQC+xNzoFmWqFIOVK27cv0hAoqEMMxjfWygAhn7x9xldQnGbekFsRhwDxdXm\n7mdMyNZNp8cvXwP014WX1RPFyA19LTr7UBfK/z+QbmIpL2ujWqZfQTHkCzfQ1htw\nBkS891IXz8s5nk5iYUPVzgRH78z7OG4BQg5Bg1lREVrZzqNfvKbSzhbK2J3I2kZx\nsevvUIz0vBxNcAmU02ZpoLbSA7LgeMMxCovRwYLrf+QwxI0GhNVVE6Dm80lKxc+t\n5LxLyPVl8Uw3u2gVq0HTkIys3TphRgWrkByrIf7PZVmqsL+Mn6RfmOHRB7l5vszK\nxpg/7iajOKGGVBW5LjLKehOdG+vSDFYIXWTVUb+4r5sUQv3/vHLO3a327OiLPYht\nY+UXbO+5MWHYBYwbfQTk+ilkeR8YkhXUVhjHrwcsLPCiiO3FAQarPUDtA2j33PFL\nshevW63JO1YpjUj1CTcDqkfJHkYjtv65fhD2u4sZS/jRq4yhqMSx0T4bVpIdDgkK\nMBTMxTECAwEAATANBgkqhkiG9w0BAQsFAAOCAYEAhxIaH6QICDQkk9Rv+vh+ysnl\n1o1RPwvk3dAr1cY9RDyiKbIzWJMPPa+quh2xZ+9ks4JDvPjnJb+MsZIYOsFiKzXq\nAPkritHWyHFhK+nddVj7bpkrc7zorwm6csi9Xd0q0rpE3rlHNuMOycWO0/sd9vVE\nwhJfqBO5MbDUqoTaXehnaycXDSN59JhHOze9E+JNu/9a+S7vZjX9qaHo2RIQwhVb\nlrAlHh35c2io5BUJME0ppyE/gVDxn9h60ABDVx1mlr0vr2Baw8rNUbURFhNcSMX1\nEdqBOMMWZc8ui3LzBDFjZx/MWk/nbU7jwRpG4+Bdez6yjVAJvVeKQACCMVysQnWr\nQTRd1suXRVCo1spAF+kD+0YZa7fZVb0+SHAWCAJT5V4Q6aY8GhIZaCH36iuW8xub\njKvBUqUuEbDjQwgHICKNw8/5G5VJJQecZ/NyA501dHsLLCTO+bTJ4jDTR3PKt7Bh\nZsPrWvdf9Nmt0fm/TgQEY0uIE3hKJfxl89715ZFL\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs384/p12_password.txt.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-3072-p12-password.txt\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs384/p12_password.txt.dataset/rsa-3072-p12-password.txt",
    "content": "password"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs384/private.p12.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-3072-private.p12\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs384/private.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-3072-private.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs384/private.pem.dataset/rsa-3072-private.pem",
    "content": "-----BEGIN RSA PRIVATE KEY-----\nMIIG5QIBAAKCAYEAvsTc6BZlqhSDlStu3L9IQKKhDDMY31soAIZ+8fcZXUJxm3pB\nbEYcA8XV5u5nTMjWTafHL18D9NeFl9UTxcgNfS06+1AXyv8/kG5iKS9ro1qmX0Ex\n5As30NYbcAZEvPdSF8/LOZ5OYmFD1c4ER+/M+zhuAUIOQYNZURFa2c6jX7ym0s4W\nytidyNpGcbHr71CM9LwcTXAJlNNmaaC20gOy4HjDMQqL0cGC63/kMMSNBoTVVROg\n5vNJSsXPreS8S8j1ZfFMN7toFatB05CMrN06YUYFq5AcqyH+z2VZqrC/jJ+kX5jh\n0Qe5eb7MysaYP+4mozihhlQVuS4yynoTnRvr0gxWCF1k1VG/uK+bFEL9/7xyzt2t\n9uzoiz2IbWPlF2zvuTFh2AWMG30E5PopZHkfGJIV1FYYx68HLCzwoojtxQEGqz1A\n7QNo99zxS7IXr1utyTtWKY1I9Qk3A6pHyR5GI7b+uX4Q9ruLGUv40auMoajEsdE+\nG1aSHQ4JCjAUzMUxAgMBAAECggGADo3mbK6IwxkdkNvncWAGmyfNMakUVLYXrzKT\nrNI1VTAkisAhDamrqX4Ge7/kka8g6nvKborJOnzW7GaNQ6Gnpc01msbZids/dj11\nr762b5gS6WGH9OYGNCChp0JTLDeSQ87Oqm6xfD//dOhq2zIoaWI8wkvP2p+yyMSS\nMdvaCwvRjnO6uW8dWp2MklAIuBFlL6bKYf4SPRCD17szN4Kguw97lNpBIJeq7Vys\nhCv6tmyb+gmtVPFqvhGpbpLs6rtCG/MGMnk0dAMUmPFfFzIXDg7iUWgSvSx7MhEO\nilr6Xh7Rqr4UpF4pDYxxvodhbV7VwlJUxVojANDvOQ1ANntnr+unS7w6ma2tWB7L\nbzThBoZNViyLr/0RUoYrnizqrioFSskESGUVxVFSQfUa2lE4kTY1NAMYF+wOyq5p\naGbSRvtFOPGLYF14pDK/yfZrO+3W0rZdGVowvDqNZ4tzML1aMBH/wCFvfy7wzwSv\nxRp3PYt3h36i9KgUJhB0Ln/bWguBAoHBAOEg8Mg/Z0l3o+3z2ZBkGjuRsF9wf1xz\naKyw8Uti9fYc0MacvBd0kQxawiR3nIxxBu5LLZ05WsLJCSQ85bTing25JcEYhgDv\nsxCggAKsQP3IEOEPKOx7fPasU7i7J0BUWS6w8mNjlwx/GNVaIquAMUzownoYXejf\nQsuTfwuruyVYGQVPL6V/RpVi2+d6MSqlmoYVkrn0n4s+OAldtkxW6pOxdOWN2KFV\nqfVsKki3t+t3VcF8xiRG+sAID+4VfkPFtQKBwQDY7b0MZE0gMYme2vUHHQ4eBw2a\nPBMA5d0SGl31I8Q09ynxeLKAfzg2ORHexpayPx0wn0QA6sn3bB+3n2sn76tlIHA1\nEO+6+T3r1zfX0bV15+WXSOUQjGL/6Iu6Xb2utu0hUjLDNLAfbCBSbCuduu59fZRd\ngLG0aQX6V7LGxohXsiJFU9Yy/iTBvXaikb8Tm09x/GdKW+8gTmTcWsOnWW9a+Afg\nKmb/DWgAxuIap9Ue6X5aGcU1++Ok4JWhbTuBrw0CgcEAz6BrsKMZBR68J0bQDmTj\n9LBms36zV3ZwwWPnBhncsgDdY29F4XP2GijSCIPv826Cb98R0IEG/cIfFja7u1mN\nXya0dSPC4rYutVTw+oYW4ndTad1rZr50/6LrC+I/Twr7vR4gTh2ZP0MwigQ5GWZ/\nEWlRgv1aDt1pYwtDDmZxkP1xBf6D+OQrGrc0DIYbNjPJEYRv7+R2CBt33tt4t2sp\nqNDu+I8bjZ/NwbTiQnJ9w0Ip6urCas6zj8tftbpI2wRJAoHBAMVYuqScVwHTrzRi\nU4lOKHquxfQrdMpbU5vVeua5zBS3SmQP/qwhkJzbnGND3PJ5sm96ZJ5E+snpho1B\nLXXedtmAAjR0nPNHLcrxNy9S67dA6UCRIzrDzIitIPjBsP9SETZAFkg6FYPwlRMG\nr0NGPRLS/Pd3TbMn3DVcNRraoEzPlJfnZjVruTq7x0KsPt1ybHrxOXKPYmLMjrtc\noyQKm+BxRpDrYlnj81rJlAbV6m+90aHcUeoDppxnaBi8S+d1vQKBwQC4vU66vCvz\nEwJ+p0r1ZU9znSj0HQVo3Z6xdp9FvdWZ5pYvy3WzpkEHZmIyb6m6xyF45b9D4ypd\nPXgrejMHVv4TJ1Z2jFp2rlgKouFwCucWtJ9ujQ38unmBACEp9FlKqjS+FeiYxG0j\nMzCae4JENAjsfSmrZqppRQaENX6KX26XvUVVRT6GbETdr0rb4zFJaiAQX/x4VO3T\nPiut0mT+zeVCteBqZSZ3SAiEIcq1OBJVT7r6HWst40L5wOglK9pBMO0=\n-----END RSA PRIVATE KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs384/public.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-3072-public.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs384/public.pem.dataset/rsa-3072-public.pem",
    "content": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAvsTc6BZlqhSDlStu3L9I\nQKKhDDMY31soAIZ+8fcZXUJxm3pBbEYcA8XV5u5nTMjWTafHL18D9NeFl9UTxcgN\nfS06+1AXyv8/kG5iKS9ro1qmX0Ex5As30NYbcAZEvPdSF8/LOZ5OYmFD1c4ER+/M\n+zhuAUIOQYNZURFa2c6jX7ym0s4WytidyNpGcbHr71CM9LwcTXAJlNNmaaC20gOy\n4HjDMQqL0cGC63/kMMSNBoTVVROg5vNJSsXPreS8S8j1ZfFMN7toFatB05CMrN06\nYUYFq5AcqyH+z2VZqrC/jJ+kX5jh0Qe5eb7MysaYP+4mozihhlQVuS4yynoTnRvr\n0gxWCF1k1VG/uK+bFEL9/7xyzt2t9uzoiz2IbWPlF2zvuTFh2AWMG30E5PopZHkf\nGJIV1FYYx68HLCzwoojtxQEGqz1A7QNo99zxS7IXr1utyTtWKY1I9Qk3A6pHyR5G\nI7b+uX4Q9ruLGUv40auMoajEsdE+G1aSHQ4JCjAUzMUxAgMBAAE=\n-----END PUBLIC KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs512/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"properties\" : {\n    \"provides-namespace\" : true\n  }\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs512/certificate.cer.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-4096.cer\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs512/certificate.cer.dataset/rsa-4096.cer",
    "content": "-----BEGIN CERTIFICATE-----\nMIIFajCCA1ICCQDSbh992qsOpTANBgkqhkiG9w0BAQsFADB3MQswCQYDVQQGEwJH\nQjEPMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xGDAWBgNVBAoMD0ds\nb2JhbCBTZWN1cml0eTEWMBQGA1UECwwNSVQgRGVwYXJ0bWVudDEUMBIGA1UEAwwL\nZXhhbXBsZS5jb20wHhcNMTgwNzMxMjA1MjAwWhcNMTgwODMwMjA1MjAwWjB3MQsw\nCQYDVQQGEwJHQjEPMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xGDAW\nBgNVBAoMD0dsb2JhbCBTZWN1cml0eTEWMBQGA1UECwwNSVQgRGVwYXJ0bWVudDEU\nMBIGA1UEAwwLZXhhbXBsZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK\nAoICAQDXpTSPiTQWTk8VIhS24FCHEEWGEpZltqmZx5e04lNyKOu6pXzXcAhEynkp\nsiGR1/v9stP5CRXh8vu6T+AkiFCWKha8AHFIFOlV2dhMV2RKa0dn1Z7n4E6TAeTA\nh0tFzNJviWB76HwX7+Y8hVUjDohA5QVZ+gIMtsbTJEo3O9BLTGWtlcRNz4NR2qUz\n5s6B4mY/6/UIRuoFLTXWqLMfrpp7nlLGKhMQw3eVTYDX27L9GeS0lQocKdBzr2bP\n5uf5KjohNdNXQAmwdCHebUbm0ScUFrgCXlLcgDsTayrnHPuj7LbQTUiQKdfQ5QbF\nGYxrqNvAZKjfGzzFDsHUp07Ei2BA9L6NdaumnpxrXLJiCgg6ap7vxCWr3gjzC6PV\nvc5lrlXE8UpkcpK93m/J2Srvm/uXZoiQSbFB9IHcByY3eA35uKvQBx1dlwKwxkwt\nC+DloCCsMVBB8P5VOISe1/Gmx5FK7JmMxoICYaAHQFHOncDJbYC+3ERykROtzSnS\n+j5ba7l3fXX3CIVu4p6W2+XHR+p8G6JGVU9YMIISOttBdPaQSsW8qOsnKSKd2cRB\nHQltxIfxzUzy8oDll3u2Vpm8gvNK/wcJ6cK2NWgHeHa7jCJuC3uQWQLpiQSta/Hq\nF16w63eKvXg/Uim1qDrLl2cpRUqUz/XTxz09ORSP942oaIMICwIDAQABMA0GCSqG\nSIb3DQEBCwUAA4ICAQBC+KAKPNbzp2OMlipFxiZCYiclmDK0u6JT8mi23a1JH9oP\nloiO24BDEYbRHityE+ipc71ilG9khnP+h2ZNoGKYUl1AbEvZu6CTMturwhYMunqt\npyCV1OWTl5Eh0mngFA5uqEYetXEZyDQ3q9ZcsYoO7xHkN1Ds76fSm9K3euK3iy3H\nrt2GqKhYbIb6rv8iItk3gYnc/6q3/lIlUIlkRDWijuFE27YJTYBnZJjELFq6hym9\nz9vUbZAiX5vyVjMMQhnHrQBQNQ0IYUa6/Hn+7dPWQM8Dyr56wYKl/GRnSlB0iLAp\nhpdgKfd9Py9NaPhzfaGcxJopod8vn1imivoXMWRzgCMNFkj1zDW++pLIKeHp81qu\ntAZRIv3/H/qlYTs05EDcsD6cIUV/xnjip2OMZVxPSllAqdbwOXzq7N2q9hE62J0L\nSCq7XajPEW5q82zen6CvTWq0UeBfoezNtzmIOK/a3laOT8sFCFyAHnNri23UX5QF\nIACgN5GFDM1aVckkIyna/wIzFsFDSSsEPU0VDehf7vN+1IUgPigxXzwnJ+uhL8SG\nAFuAKs5FmerDLZkIPc3dv2kGuBu4zUxtjap1up+1q7UL3J5EOLi7N8B1YGSwEWQn\nhHWeZ0AnhpANv1zk3zNx9JKgexWvMHB70pqbFiA+SSJky0OUl0Ttv7ea0HVRZw==\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs512/p12_password.txt.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-4096-p12-password.txt\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs512/p12_password.txt.dataset/rsa-4096-p12-password.txt",
    "content": "password"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs512/private.p12.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-4096-private.p12\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs512/private.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-4096-private.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs512/private.pem.dataset/rsa-4096-private.pem",
    "content": "-----BEGIN RSA PRIVATE KEY-----\nMIIJKAIBAAKCAgEA16U0j4k0Fk5PFSIUtuBQhxBFhhKWZbapmceXtOJTcijruqV8\n13AIRMp5KbIhkdf7/bLT+QkV4fL7uk/gJIhQlioWvABxSBTpVdnYTFdkSmtHZ9We\n5+BOkwHkwIdLRczSb4lge+h8F+/mPIVVIw6IQOUFWfoCDLbG0yRKNzvQS0xlrZXE\nTc+DUdqlM+bOgeJmP+v1CEbqBS011qizH66ae55SxioTEMN3lU2A19uy/RnktJUK\nHCnQc69mz+bn+So6ITXTV0AJsHQh3m1G5tEnFBa4Al5S3IA7E2sq5xz7o+y20E1I\nkCnX0OUGxRmMa6jbwGSo3xs8xQ7B1KdOxItgQPS+jXWrpp6ca1yyYgoIOmqe78Ql\nq94I8wuj1b3OZa5VxPFKZHKSvd5vydkq75v7l2aIkEmxQfSB3AcmN3gN+bir0Acd\nXZcCsMZMLQvg5aAgrDFQQfD+VTiEntfxpseRSuyZjMaCAmGgB0BRzp3AyW2AvtxE\ncpETrc0p0vo+W2u5d3119wiFbuKeltvlx0fqfBuiRlVPWDCCEjrbQXT2kErFvKjr\nJykindnEQR0JbcSH8c1M8vKA5Zd7tlaZvILzSv8HCenCtjVoB3h2u4wibgt7kFkC\n6YkErWvx6hdesOt3ir14P1Iptag6y5dnKUVKlM/108c9PTkUj/eNqGiDCAsCAwEA\nAQKCAgEAlHAr1gHj0NbmqO1kxN1zkQUqVjfFPw6VgD1buC9ysUppuXjgjouXpYKa\nFJGBehrqYqAOOYZ/gaD4li8VYxBSKIugSpkjYTLDy0zBDwu5BWEDLf5l+8bzT04m\nYEDBF7L9x7kQqTpG8VM5cL9280K1l7YOEPl/H7FQ+1YnoA2UO8DC3NIS5lzJUDbp\nMOjXjaCCMc4CRUhLHnUYckJ9ynkt7Zn18GJV7VwfnK5U2kFo28BPJd7RrsE5s+gx\nJTsUwvbGPMYITC7QfJ30El+2RnwCIlnhIAA9mXrLL3q9dYkFzrjKvmf0Ywfqfuin\n2FTVy+XYHn8rnyfolNyrn+3q0m/+OHTBkIyjWxaErqXRXciBvh7GlFuVLdhlHz2f\nfJEOXeIlOiQSqh3UmffXHRmyltb9n0aFBsA8KmpEnlQ90RozI+hUpeCSPM70oAOA\npuUc8Ycmi4O3ej57hWbFnM2Mf4cjvYQKSyANnmJKYl8cZd/523BSVpqFKJDXSZKr\n1aFoOJSSeXG1mqXUeoXKNzZLeUB/v86utvj+3VfOGWQ14drqvlnrurJMQlRXbAwF\n8ct6JojOsNkxeO5+HsCeFirhuXL3MVPsxHMQGPorjtkPQ7B/QI2Z3kW2F8DSRPbX\nftGaE/9+G6pI0ApkJ33sdhWrP7aOvO/mDNVlCe6E+tjzP8bqKsECggEBAO3uxaGu\ns3JTuJS+wMDc/M0y33AP3qn0GjJ+oF5oPBtyHyPmkMEoG8KXYOM7J4+8DA+kZCtz\nczRKi9zpjcCq9ChsZVDeHNOiu3N4kT8JP7rIEBiazjEzpIP4URH++PBXPR7/Z1jy\ntlxpUXcajmzF5Z0RkwfXmETsnOtbfVz07CSk8Ua9T3zRI88KPTT44Iv4s6MCDptY\ndV9kKIdGBKFqOy7budT7n7+qRvdKZ70SusRJupwXlUs8UDEBFLKYxSO/L2TkpPZ7\nAryGYugUjOqTg9n0ytyc84H7jHnWypnn0mDsMrEGR4uk2WhNGUT4YHnQ+5mrPwsm\n85kMYX/fxYYRkecCggEBAOgFLx522GxAUNfXR/oiKznKvxlUzlonU3+VAvpH40tq\nOpCHeYeRFiqjlX3cQdePouxFqFfKKd+utPGlurH12ZkwILqPKyWbtUQdI9NboMm+\nYJEWbyFR0YPdOnYKNj3O17CYBGkEBj501WuFZeRwuVrGYxjdPa9wamVia+AIxsct\nJCzrs9/gmY6U3dk2Fez4ADqe0tp7Ul4al5AtMjLbrmFzxKTF32PgTIOsY72BvgQS\nfOEFr41Cmgm/pLjjNLk5cMBTMfgcpAYidy9g4lF1k6MZS2mrY5/s0BXat2LPgANt\ndD0WKODH23dWUQWQ8Efrhya/i4t0fhXNBR8eSbLyHD0CggEAdr1MP63xu8JwQTsY\n8qbWOomC3GfvFR3O3Rg4bCTUqlW/mKj94IdloyzsmznwOlj8I+pEWzLYcWYqemrL\n5TTreCjwPvU5qZxys+OdiLnS5iHldoH7GK7PEVUhEDwQe9DtncSUDN3DiEa+8xN7\ntGjmeAZHPAip4uu6O/KCk5tfJcJy7nyXaJDur+pKNV9moDPTYiwqoff5S0uutiOJ\nOAzN0EqzaMjSJlKR6+Nj9gWc00yAJlnWlZ9Z3brOW3rGF1rYCh/Y+3DUIsVmIq/u\nyzom+OSjQInLNDkXF87LeRcp9Firy5B4sAXqwZSIYdUaQHC8vymo4qXjt6NoHOrN\npmSqTQKCAQBbprCWOBwFpuJIYKHuDNFGYvBZ8UYSFrbFDve+JeeDQtMfhGRdSNKY\nxUWoEflwTSzuaBW3mAQyd7DCQ9UbtyHdgUVsbGF+2aMg5OHh+6/oAWvj5BjB8K/y\nhtExD5edkrdg6qvTT+OniD9F2cwGEQEm+nbqu3pCcwWURuyV8uGSjCJeHD1RkkcW\nK3f29YZztQNiJJrl8xD2W0rDiRbrQBwCItjqvb8glNmkqdQ8Z6PHuAXcXYKbKlPu\nxeUro5SQFkCTuElk2OtyAOtTq9G6m9dV9gf0Fd+krMcF2v/V6GGI+RORjc9X+5qV\n6WLX8Aj6X+9jPwbAb6PeuL3tLOmv5jOBAoIBACnn4nK7ybaG4GHNTti28NDYHTh/\nfLRH+URPir8aaDOjtTxZqVnpXmKJ3D23dMbmxFUd/M0HhCF0ZFvr7QjSR0qUwO8L\n2NGR/e3XNzH4SRycpvD5U62UiQeMUEbNillkm0++aGF/qrYMd52f0DuwrIXG7xu/\nrIi8YeNhIctiX6ufqNF+P0UA262Z26jJ4bJBWht9wyciw+UGTmM/DjOkVDJ3eug+\nJV6yfl0i/+hLmzy+TBZq5vqZnvwwsJP8upTTRIirl8R6YXEXBd83Paoc98XJFnCh\nlV7a0jpqiSf4C0L/pmLBDqhbFJ+zVbaZLbsESYe00fAtVgH4BGWu5v0M7+8=\n-----END RSA PRIVATE KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs512/public.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"rsa-4096-public.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/Certificates.xcassets/rs512/public.pem.dataset/rsa-4096-public.pem",
    "content": "-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA16U0j4k0Fk5PFSIUtuBQ\nhxBFhhKWZbapmceXtOJTcijruqV813AIRMp5KbIhkdf7/bLT+QkV4fL7uk/gJIhQ\nlioWvABxSBTpVdnYTFdkSmtHZ9We5+BOkwHkwIdLRczSb4lge+h8F+/mPIVVIw6I\nQOUFWfoCDLbG0yRKNzvQS0xlrZXETc+DUdqlM+bOgeJmP+v1CEbqBS011qizH66a\ne55SxioTEMN3lU2A19uy/RnktJUKHCnQc69mz+bn+So6ITXTV0AJsHQh3m1G5tEn\nFBa4Al5S3IA7E2sq5xz7o+y20E1IkCnX0OUGxRmMa6jbwGSo3xs8xQ7B1KdOxItg\nQPS+jXWrpp6ca1yyYgoIOmqe78Qlq94I8wuj1b3OZa5VxPFKZHKSvd5vydkq75v7\nl2aIkEmxQfSB3AcmN3gN+bir0AcdXZcCsMZMLQvg5aAgrDFQQfD+VTiEntfxpseR\nSuyZjMaCAmGgB0BRzp3AyW2AvtxEcpETrc0p0vo+W2u5d3119wiFbuKeltvlx0fq\nfBuiRlVPWDCCEjrbQXT2kErFvKjrJykindnEQR0JbcSH8c1M8vKA5Zd7tlaZvILz\nSv8HCenCtjVoB3h2u4wibgt7kFkC6YkErWvx6hdesOt3ir14P1Iptag6y5dnKUVK\nlM/108c9PTkUj/eNqGiDCAsCAwEAAQ==\n-----END PUBLIC KEY-----\n"
  },
  {
    "path": "Tests/JWTTests/Resources/template/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"properties\" : {\n    \"provides-namespace\" : true\n  }\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/template/certificate.cer.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"secp256k1.cer\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/template/p12_password.txt.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"secp256k1.txt\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/template/private.p12.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"secp256k1.p12\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/template/private.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"secp256k1-private.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/template/public.pem.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"secp256k1-public.pem\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Resources/template/request.csr.dataset/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  },\n  \"data\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"secp256k1.csr\"\n    }\n  ]\n}"
  },
  {
    "path": "Tests/JWTTests/Tests/Algorithms/JWTAlgorithmAsymmetricTests.m",
    "content": "//\n//  JWTAlgorithmAsymmetricTests.m\n//  iOS_Tests\n//\n//  Created by Dmitry on 7/29/18.\n//\n\n@import XCTest;\n@import JWT;\n\n#import \"JWTAssetAccessor.h\"\n\n@interface JWTAlgorithmAsymmetricTestsHelper : NSObject\n@property (copy, nonatomic, readwrite) NSDictionary *payloadDictionary;\n@property (copy, nonatomic, readwrite) NSDictionary *headersDictionary;\n@property (copy, nonatomic, readwrite) NSDictionary *fullDictionary;\n@property (copy, nonatomic, readwrite) NSDictionary *cryptoKeyBuilderParameters;\n\n- (instancetype)configuredByName:(NSString *)name;\n@property (copy, nonatomic, readwrite) NSString *name;\n@property (strong, nonatomic, readwrite) id <JWTAlgorithm> algorithm;\n\n- (instancetype)configuredByToken:(NSString *)token;\n@property (copy, nonatomic, readwrite) NSString *token;\n@property (copy, nonatomic, readwrite) NSString *invalidToken;\n\n- (instancetype)configuredByAssetAccessor:(JWTAssetAccessor *)accessor;\n@property (strong, nonatomic, readwrite) JWTAssetAccessor *accessor;\n@end\n\n@interface JWTAlgorithmAsymmetricTestsHelper (Wrong)\n+ (instancetype)wrong;\n- (instancetype)wrong;\n@end\n\n@interface JWTAlgorithmAsymmetricTests__ExtractionKeys : NSObject\n// Container Keys\n@property (copy, nonatomic, readonly, class) NSString *Tokens;\n@property (copy, nonatomic, readonly, class) NSString *Holders;\n\n// Extraction Types\n@property (copy, nonatomic, readonly, class) NSString *PrivateKeyFromP12;\n@property (copy, nonatomic, readonly, class) NSString *PublicKeyFromCertificate;\n@property (copy, nonatomic, readonly, class) NSString *PrivateKeyFromPem;\n@property (copy, nonatomic, readonly, class) NSString *PublicKeyFromPem;\n\n@end\n\n@implementation JWTAlgorithmAsymmetricTests__ExtractionKeys\n\n+ (NSString *)Holders { return NSStringFromSelector(_cmd); }\n+ (NSString *)Tokens { return NSStringFromSelector(_cmd); }\n\n+ (NSString *)PrivateKeyFromPem { return NSStringFromSelector(_cmd); }\n+ (NSString *)PrivateKeyFromP12 { return NSStringFromSelector(_cmd); }\n+ (NSString *)PublicKeyFromPem { return NSStringFromSelector(_cmd); }\n+ (NSString *)PublicKeyFromCertificate { return NSStringFromSelector(_cmd); }\n\n@end\n\n@implementation JWTAlgorithmAsymmetricTestsHelper\n- (NSDictionary <NSString *, void(^)(void)>*)configurations {\n    __weak __auto_type weakSelf = self;\n    return @{\n             JWTAlgorithmNameRS256 : ^{\n                 __auto_type accessor = [[JWTAssetAccessor alloc] initWithAlgorithName:self.name];\n                 [weakSelf configuredByAssetAccessor:accessor];\n             },\n             JWTAlgorithmNameRS384 : ^{\n                 __auto_type accessor = [[JWTAssetAccessor alloc] initWithAlgorithName:self.name];\n                 [weakSelf configuredByAssetAccessor:accessor];\n             },\n             JWTAlgorithmNameRS512 : ^{\n                 __auto_type accessor = [[JWTAssetAccessor alloc] initWithAlgorithName:self.name];\n                 [weakSelf configuredByAssetAccessor:accessor];\n             },\n             JWTAlgorithmNameES256 : ^{\n                 __auto_type accessor = [[JWTAssetAccessor alloc] initWithAlgorithName:self.name];\n                 [weakSelf configuredByAssetAccessor:accessor];\n                 weakSelf.cryptoKeyBuilderParameters = @{JWTCryptoKey.parametersKeyBuilder : JWTCryptoKeyBuilder.new.keyTypeEC };\n             },\n             JWTAlgorithmNameES384 : ^{\n                 __auto_type accessor = [[JWTAssetAccessor alloc] initWithAlgorithName:self.name];\n                 [weakSelf configuredByAssetAccessor:accessor];\n                 weakSelf.cryptoKeyBuilderParameters = @{JWTCryptoKey.parametersKeyBuilder : JWTCryptoKeyBuilder.new.keyTypeEC };\n             },\n             JWTAlgorithmNameES512 : ^{\n                 __auto_type accessor = [[JWTAssetAccessor alloc] initWithAlgorithName:self.name];\n                 [weakSelf configuredByAssetAccessor:accessor];\n                 weakSelf.cryptoKeyBuilderParameters = @{JWTCryptoKey.parametersKeyBuilder : JWTCryptoKeyBuilder.new.keyTypeEC };\n             }\n             };\n}\n- (void)generalConfigure {\n    self.payloadDictionary = @{@\"hello\" : @\"world\"};\n    self.headersDictionary = @{@\"alg\" : self.name, @\"typ\" : @\"JWT\"};\n    self.fullDictionary = @{\n                            JWTCodingResultComponents.headers : self.headersDictionary,\n                            JWTCodingResultComponents.payload : self.payloadDictionary\n                            };\n\n//    self.payload = @\"payload\";\n//    self.secret = @\"secret\";\n//    self.wrongSecret = @\"notTheSecret\";\n}\n- (instancetype)configuredByName:(NSString *)name {\n    __auto_type configured = [self configurations][name];\n    if (configured) {\n        self.name = name;\n        [self generalConfigure];\n        configured();\n    }\n    // choose configuration here?\n    self.algorithm = [JWTAlgorithmFactory algorithmByName:name];\n    return self;\n}\n- (instancetype)configuredByToken:(NSString *)token {\n    if (token != nil) {\n        self.token = token;\n        self.invalidToken = [token stringByReplacingOccurrencesOfString:@\"F\" withString:@\"D\"];\n    }\n    return self;\n}\n- (instancetype)configuredByAssetAccessor:(JWTAssetAccessor *)accessor {\n    if (accessor != nil) {\n        self.accessor = accessor;\n    }\n    return self;\n}\n@end\n\n@interface JWTAlgorithmAsymmetricTests : XCTestCase\n@property (strong, nonatomic, readwrite) JWTAlgorithmAsymmetricTestsHelper *helper;\n@end\n\n@interface JWTAlgorithmAsymmetricTests (Check)\n- (void)assertDecodedDictionary:(NSDictionary *)dictionary andHelper:(JWTAlgorithmAsymmetricTestsHelper *)helper;\n- (void)assertToken:(NSString *)token andHelper:(JWTAlgorithmAsymmetricTestsHelper *)helper;\n@end\n\n@implementation JWTAlgorithmAsymmetricTests\n\n- (void)showExternalRepresentation:(SecKeyRef)key name:(NSString *)name type:(NSString *)type {\n    NSError *error = nil;\n    __auto_type presentation = [JWTCryptoSecurity externalRepresentationForKey:key error:&error];\n    __auto_type data = presentation;\n    __auto_type string = [JWTBase64Coder base64UrlEncodedStringWithData:data];\n    NSLog(@\"name: %@ type: %@ presentation: %@\", name, type, string);\n}\n\n- (NSDictionary *)extractedKeysIntoSecretWithHelper:(JWTAlgorithmAsymmetricTestsHelper *)helper {\n    __auto_type tokens = [NSMutableDictionary dictionary];\n    __auto_type holders = [NSMutableDictionary dictionary];\n\n    {\n        __auto_type key = JWTAlgorithmAsymmetricTests__ExtractionKeys.PrivateKeyFromP12;\n                \n        id<JWTAlgorithmDataHolderProtocol> holder = [JWTAlgorithmRSFamilyDataHolder new].keyExtractorType([JWTCryptoKeyExtractor privateKeyInP12].type).privateKeyCertificatePassphrase(helper.accessor.p12Password).algorithm(helper.algorithm).secretData(helper.accessor.p12Data);\n        __auto_type builder = [JWTEncodingBuilder encodePayload:helper.payloadDictionary].addHolder(holder);\n\n        __auto_type result = builder.result;\n        if (result.successResult) {\n            tokens[key] = result.successResult.encoded;\n        }\n    }\n\n    {\n        __auto_type key = JWTAlgorithmAsymmetricTests__ExtractionKeys.PublicKeyFromCertificate;\n        __auto_type theKey = helper.accessor.certificateBase64;\n        __auto_type secret = ((JWTCryptoSecurityComponent *)[[JWTCryptoSecurity componentsFromFileContent:theKey] componentsOfType:JWTCryptoSecurityComponents.Certificate].firstObject).content;\n        id<JWTAlgorithmDataHolderProtocol> holder = [JWTAlgorithmRSFamilyDataHolder new].keyExtractorType([JWTCryptoKeyExtractor publicKeyWithCertificate].type).algorithm(helper.algorithm).secret(secret);\n        if (holder) {\n            holders[key] = holder;\n        }\n    }\n\n    {\n        // do we need certificate passphrase here?\n        __auto_type key = JWTAlgorithmAsymmetricTests__ExtractionKeys.PrivateKeyFromPem;\n        __auto_type theKey = helper.accessor.privateKeyBase64;\n        __auto_type secret = ((JWTCryptoSecurityComponent *)[[JWTCryptoSecurity componentsFromFileContent:theKey] componentsOfType:JWTCryptoSecurityComponents.Key].firstObject).content;\n        id<JWTAlgorithmDataHolderProtocol> holder = [JWTAlgorithmRSFamilyDataHolder new].keyExtractorType([JWTCryptoKeyExtractor privateKeyWithPEMBase64].type).algorithm(helper.algorithm).secret(secret);\n        __auto_type builder = [JWTEncodingBuilder encodePayload:helper.payloadDictionary].addHolder(holder);\n        __auto_type result = builder.result;\n        if (result.successResult) {\n            tokens[key] = result.successResult.encoded;\n        }\n    }\n\n    {\n        __auto_type key = JWTAlgorithmAsymmetricTests__ExtractionKeys.PublicKeyFromPem;\n        __auto_type theKey = helper.accessor.publicKeyBase64;\n        __auto_type secret = ((JWTCryptoSecurityComponent *)[[JWTCryptoSecurity componentsFromFileContent:theKey] componentsOfType:JWTCryptoSecurityComponents.Key].firstObject).content;\n        id<JWTAlgorithmDataHolderProtocol> holder = [JWTAlgorithmRSFamilyDataHolder new].keyExtractorType([JWTCryptoKeyExtractor publicKeyWithPEMBase64].type).algorithm(helper.algorithm).secret(secret);\n        if (holder) {\n            holders[key] = holder;\n        }\n    }\n\n    __auto_type result = @{\n                           JWTAlgorithmAsymmetricTests__ExtractionKeys.Tokens : tokens,\n                           JWTAlgorithmAsymmetricTests__ExtractionKeys.Holders : holders\n               };\n\n    return result;\n}\n\n- (NSDictionary *)extractedKeysIntoSignAndVerifyKeysWithHelper:(JWTAlgorithmAsymmetricTestsHelper *)helper {\n    __auto_type tokens = [NSMutableDictionary dictionary];\n    __auto_type holders = [NSMutableDictionary dictionary];\n\n    // check name?\n    __auto_type parameters = helper.cryptoKeyBuilderParameters;\n    \n    {\n        __auto_type key = JWTAlgorithmAsymmetricTests__ExtractionKeys.PrivateKeyFromP12;\n\n        __auto_type privateKey = ({\n            NSError *error = nil;\n            __auto_type result = [[JWTCryptoKeyPrivate alloc] initWithP12Data:helper.accessor.p12Data withPassphrase:helper.accessor.p12Password parameters:parameters error:&error];\n            result;\n        });\n        [self showExternalRepresentation:privateKey.key name:helper.name type:key];\n        \n        id<JWTAlgorithmDataHolderProtocol> holder = [JWTAlgorithmRSFamilyDataHolder new].signKey(privateKey).algorithm(helper.algorithm);//.secretData([NSData data]);\n        __auto_type builder = [JWTEncodingBuilder encodePayload:helper.payloadDictionary].addHolder(holder);\n        \n        __auto_type result = builder.result;\n        if (result.successResult) {\n            tokens[key] = result.successResult.encoded;\n        }\n    }\n    \n    {\n        __auto_type key = JWTAlgorithmAsymmetricTests__ExtractionKeys.PublicKeyFromCertificate;\n        __auto_type certificate = helper.accessor.certificateBase64;\n        __auto_type secret = ((JWTCryptoSecurityComponent *)[[JWTCryptoSecurity componentsFromFileContent:certificate] componentsOfType:JWTCryptoSecurityComponents.Certificate].firstObject).content;\n        __auto_type publicKey = ({\n            NSError *error = nil;\n            __auto_type result = [[JWTCryptoKeyPublic alloc] initWithCertificateBase64String:secret parameters:parameters error:&error];\n            result;\n        });\n        [self showExternalRepresentation:publicKey.key name:helper.name type:key];\n\n        id<JWTAlgorithmDataHolderProtocol> holder = [JWTAlgorithmRSFamilyDataHolder new].verifyKey(publicKey).algorithm(helper.algorithm).secretData([NSData data]);\n        if (holder) {\n            holders[key] = holder;\n        }\n    }\n    \n    {\n        __auto_type key = JWTAlgorithmAsymmetricTests__ExtractionKeys.PrivateKeyFromPem;\n        __auto_type theKey = helper.accessor.privateKeyBase64;\n        __auto_type secret = ((JWTCryptoSecurityComponent *)[[JWTCryptoSecurity componentsFromFileContent:theKey] componentsOfType:JWTCryptoSecurityComponents.Key].firstObject).content;\n        __auto_type privateKey = ({\n            NSError *error = nil;\n            __auto_type result = [[JWTCryptoKeyPrivate alloc] initWithBase64String:secret parameters:parameters error:&error];\n            result;\n        });\n        id<JWTAlgorithmDataHolderProtocol> holder = [JWTAlgorithmRSFamilyDataHolder new].signKey(privateKey).algorithm(helper.algorithm).secretData([NSData data]);\n        __auto_type builder = [JWTEncodingBuilder encodePayload:helper.payloadDictionary].addHolder(holder);\n        __auto_type result = builder.result;\n        if (result.successResult) {\n            tokens[key] = result.successResult.encoded;\n        }\n    }\n\n    {\n        __auto_type key = JWTAlgorithmAsymmetricTests__ExtractionKeys.PublicKeyFromPem;\n        __auto_type theKey = helper.accessor.publicKeyBase64;\n        __auto_type secret = ((JWTCryptoSecurityComponent *)[[JWTCryptoSecurity componentsFromFileContent:theKey] componentsOfType:JWTCryptoSecurityComponents.Key].firstObject).content;\n        __auto_type publicKey = ({\n            NSError *error = nil;\n            __auto_type result = [[JWTCryptoKeyPublic alloc] initWithBase64String:secret parameters:parameters error:&error];\n            result;\n        });\n        id<JWTAlgorithmDataHolderProtocol> holder = [JWTAlgorithmRSFamilyDataHolder new].verifyKey(publicKey).algorithm(helper.algorithm).secretData([NSData data]);\n        if (holder) {\n            holders[key] = holder;\n        }\n    }\n    \n    \n    __auto_type result = @{\n                           JWTAlgorithmAsymmetricTests__ExtractionKeys.Tokens : tokens,\n                           JWTAlgorithmAsymmetricTests__ExtractionKeys.Holders : holders\n                           };\n    return result;\n}\n\n/*API VERSION THREE*/\n- (void)verifyKeysWithTokensAndHolders:(NSDictionary *)dictionary helper:(JWTAlgorithmAsymmetricTestsHelper *)helper {\n    [self verifyKeysWithTokens:[dictionary objectForKey:JWTAlgorithmAsymmetricTests__ExtractionKeys.Tokens] holders:[dictionary objectForKey:JWTAlgorithmAsymmetricTests__ExtractionKeys.Holders] helper:helper];\n}\n\n- (void)verifyKeysWithTokens:(NSDictionary *)tokens holders:(NSDictionary *)holders helper:(JWTAlgorithmAsymmetricTestsHelper *)helper {\n    for (NSString *holderKey in holders) {\n        __auto_type holder = (id <JWTAlgorithmDataHolderProtocol>)[holders objectForKey:holderKey];\n        for (NSString *tokenKey in tokens) {\n            // we must\n            __auto_type token = (NSString *)[tokens objectForKey:tokenKey];\n            __auto_type builder = [JWTDecodingBuilder decodeMessage:token].addHolder(holder);\n            __auto_type result = builder.result;\n            if (result.successResult) {\n                NSLog(@\"Pair: <%@> decodeBy <%@> passed\", tokenKey, holderKey);\n                [self assertDecodedDictionary:result.successResult.headerAndPayloadDictionary andHelper:helper];\n            }\n            else {\n                NSLog(@\"Pair: <%@> decodeBy <%@> failed. Error: %@\", tokenKey, holderKey, result.errorResult.error);\n                [self assertDecodedDictionary:nil andHelper:helper];\n            }\n        }\n    }\n}\n\n/*API VERSION THREE*/\n- (void)testExtractingKeysFromDifferentContainers {\n    [XCTContext runActivityNamed:@\"Extracting keys into secret and secretData\" block:^(id<XCTActivity>  _Nonnull activity) {\n        __auto_type algorithmNames = @[\n                                       JWTAlgorithmNameRS256,\n                                       JWTAlgorithmNameRS384,\n                                       JWTAlgorithmNameRS512,\n                                       JWTAlgorithmNameES256,\n                                       JWTAlgorithmNameES384,\n                                       JWTAlgorithmNameES512\n                                       ];\n        for (NSString *name in algorithmNames) {\n            __auto_type helper = [[JWTAlgorithmAsymmetricTestsHelper new] configuredByName:name];\n            if (helper.accessor.checked == nil) {\n                XCTFail(\"Warning. Accessor is invalid\");\n            }\n            if (helper.algorithm == nil) {\n                continue;\n            }\n            __auto_type dictionary = [self extractedKeysIntoSecretWithHelper:helper];\n            [self verifyKeysWithTokensAndHolders:dictionary helper:helper];\n        }\n    }];\n    \n    [XCTContext runActivityNamed:@\"Extracting keys into verify and sign keys\" block:^(id<XCTActivity>  _Nonnull activity) {\n        __auto_type algorithmsNames = @[\n                                   JWTAlgorithmNameES256,\n                                   JWTAlgorithmNameES384,\n                                   JWTAlgorithmNameES512\n                                   ];\n        for (NSString *name in algorithmsNames) {\n            __auto_type helper = [[JWTAlgorithmAsymmetricTestsHelper new] configuredByName:name];\n            if (helper.algorithm == nil) {\n                continue;\n            }\n            __auto_type dictionary = [self extractedKeysIntoSignAndVerifyKeysWithHelper:helper];\n            [self verifyKeysWithTokensAndHolders:dictionary helper:helper];\n        }\n    }];\n}\n\n/*API VERSION TWO*/\n// For RS part only.\n- (void)testEncoding {\n\n}\n\n- (void)testDecoding {\n\n}\n\n@end\n\n@implementation JWTAlgorithmAsymmetricTests (Check)\n- (void)assertDecodedDictionary:(NSDictionary *)dictionary andHelper:(JWTAlgorithmAsymmetricTestsHelper *)helper {\n    XCTAssertEqualObjects(dictionary, helper.fullDictionary);\n}\n- (void)assertToken:(NSString *)token andHelper:(JWTAlgorithmAsymmetricTestsHelper *)helper {\n    // configure token?!\n    XCTAssertEqualObjects(token, helper.token);\n    // decode it?\n    // or not?\n    // later.. :3\n}\n@end\n"
  },
  {
    "path": "Tests/JWTTests/Tests/Algorithms/JWTAlgorithmHSTests.m",
    "content": "//\n//  JWTAlgorithmHSTests.m\n//  iOS_Tests\n//\n//  Created by Dmitry on 7/29/18.\n//\n\n@import XCTest;\n@import JWT;\n\n@interface JWTAlgorithmHSTestsHelper : NSObject\n@property (copy, nonatomic, readwrite) NSString *payload;\n@property (copy, nonatomic, readwrite) NSString *signedPayload;\n@property (copy, nonatomic, readwrite) NSString *signedPayloadBase64UrlEncoded;\n@property (copy, nonatomic, readwrite) NSString *secret;\n@property (copy, nonatomic, readwrite) NSString *wrongSecret;\n@property (copy, nonatomic, readwrite) NSString *signature;\n@property (copy, nonatomic, readwrite) NSString *name;\n- (instancetype)configuredByName:(NSString *)name;\n\n@property (strong, nonatomic, readwrite) id <JWTAlgorithm> algorithm;\n@property (strong, nonatomic, readwrite) JWTAlgorithmHolder *theAlgorithm;\n\n@property (strong, nonatomic, readwrite) JWTBase64Coder *base64Coder;\n@end\n\n@implementation JWTAlgorithmHSTestsHelper\n- (NSDictionary <NSString *, void(^)(void)>*)configurations {\n    __weak __auto_type weakSelf = self;\n    return @{\n             JWTAlgorithmNameHS256 : ^{\n                 weakSelf.signedPayload = @\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9\";\n                 weakSelf.signedPayloadBase64UrlEncoded = @\"uC_LeRrOxXhZuYm0MKgmSIzi5Hn9-SMmvQoug3WkK6Q\";\n                 weakSelf.signature = @\"TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ\";\n             },\n\n             JWTAlgorithmNameHS384 : ^{\n                 weakSelf.signedPayload = @\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9\";\n                 weakSelf.signedPayloadBase64UrlEncoded = @\"s62aZf5ZLMSvjtBQpY4kiJbYxSu8wLAUop2D9nod5Eqgd-nyUCEj-iaDuVuI4gaJ\";\n                 weakSelf.signature = @\"hnzqaUFa2kfSFnynQ_WBJ7-wpLCgsyEdilCkRKliadjVuG-hGnc1qhvIjlvxSie5\";\n             },\n             JWTAlgorithmNameHS512 : ^{\n                 weakSelf.signedPayload = @\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9\";\n                 weakSelf.signedPayloadBase64UrlEncoded = @\"KR3aqiPK-jqq4cl1U5H0vvNbvby5JzmlYYpciW9lINKw0o0tKYfayXR54xIUpR2Wz86voo5GpPlhtjxGNSoYng\";\n                 weakSelf.signature = @\"SerC5MWQIs3fRH6ZD7gKKbq51TsyydXTvl23WpD9sA085SzQ7pK6M0TnYjFITNUkwuniGG5Is2OKJCEIHPn1Kg\";\n             }\n             };\n}\n- (void)generalConfigure {\n    self.payload = @\"payload\";\n    self.secret = @\"secret\";\n    self.wrongSecret = @\"notTheSecret\";\n    self.base64Coder = [JWTBase64Coder new];\n}\n- (instancetype)configuredByName:(NSString *)name {\n    __auto_type configured = [self configurations][name];\n    if (configured) {\n        [self generalConfigure];\n        configured();\n        self.name = name;\n    }\n    // choose configuration here?\n    self.algorithm = [JWTAlgorithmFactory algorithmByName:name];\n    self.theAlgorithm = [[JWTAlgorithmHolder alloc] initWithAlgorithm:self.algorithm];\n    return self;\n}\n@end\n\n@interface JWTAlgorithmHSTests : XCTestCase\n\n@end\n\n@implementation JWTAlgorithmHSTests\n\n- (void)setUp {\n    [super setUp];\n    // Put setup code here. This method is called before the invocation of each test method in the class.\n}\n\n- (void)tearDown {\n    // Put teardown code here. This method is called after the invocation of each test method in the class.\n    [super tearDown];\n}\n\n- (void)testAlgorithms {\n    {\n        [self theTestForAlgorithmName:@\"HS256\"];\n    }\n    {\n        [self theTestForAlgorithmName:@\"HS384\"];\n    }\n    {\n        [self theTestForAlgorithmName:@\"HS512\"];\n    }\n}\n\n- (void)theTestForAlgorithmName:(NSString *)name {\n    __block __auto_type helper = [[JWTAlgorithmHSTestsHelper new] configuredByName:name];\n\n    XCTAssertNotNil(helper);\n    XCTAssertNotNil(helper.algorithm);\n\n    [XCTContext runActivityNamed:@\"name is from HS family\" block:^(id<XCTActivity>  _Nonnull activity) {\n        XCTAssertEqualObjects(helper.algorithm.name, helper.name);\n    }];\n    \n    [XCTContext runActivityNamed:@\"HMAC encodes the payload using SHA256\" block:^(id<XCTActivity> _Nonnull activity) {\n        __auto_type encodedPayload = [helper.theAlgorithm encodePayload:helper.payload withSecret:helper.secret];\n        XCTAssertEqualObjects([helper.base64Coder stringWithData:encodedPayload], helper.signedPayloadBase64UrlEncoded);\n    }];\n    \n    [XCTContext runActivityNamed:@\"HMAC encodes the payload data using SHA256\" block:^(id<XCTActivity> _Nonnull activity) {\n        __auto_type payloadData = [helper.base64Coder dataWithString:helper.payload];\n        __auto_type secretData = [helper.base64Coder dataWithString:helper.secret];        \n        __auto_type encodedPayload = [helper.theAlgorithm encodePayloadData:payloadData withSecret:secretData];\n        XCTAssertEqualObjects([helper.base64Coder stringWithData:encodedPayload], helper.signedPayloadBase64UrlEncoded);\n    }];\n    \n    [XCTContext runActivityNamed:@\"HMAC encodes the payload canonically\" block:^(id<XCTActivity> _Nonnull activity) {\n        XCTAssertTrue([helper.theAlgorithm verifySignedInput:helper.signedPayload withSignature:helper.signature verificationKey:helper.secret]);\n    }];\n\n    [XCTContext runActivityNamed:@\"should verify JWT with valid signature and secret\" block:^(id<XCTActivity> _Nonnull activity) {\n        XCTAssertTrue([helper.theAlgorithm verifySignedInput:helper.signedPayload withSignature:helper.signature verificationKey:helper.secret]);\n    }];\n\n    [XCTContext runActivityNamed:@\"should fail to verify JWT with invalid secret\" block:^(id<XCTActivity> _Nonnull activity) {\n        XCTAssertFalse([helper.theAlgorithm verifySignedInput:helper.signedPayload withSignature:helper.signature verificationKey:helper.wrongSecret]);\n    }];\n\n    [XCTContext runActivityNamed:@\"should fail to verify JWT with invalid signature\" block:^(id<XCTActivity> _Nonnull activity) {\n        XCTAssertFalse([helper.theAlgorithm verifySignedInput:helper.signedPayload withSignature:nil verificationKey:helper.secret]);\n    }];\n\n    [XCTContext runActivityNamed:@\"should verify JWT with valid signature and secret Data\" block:^(id<XCTActivity> _Nonnull activity) {\n        __auto_type secretData = [helper.base64Coder dataWithString:helper.secret];\n        XCTAssertTrue([helper.theAlgorithm verifySignedInput:helper.signedPayload withSignature:helper.signature verificationKeyData:secretData]);\n    }];\n\n    [XCTContext runActivityNamed:@\"should fail to verify JWT with invalid secret\" block:^(id<XCTActivity> _Nonnull activity) {\n        __auto_type secretData = [helper.base64Coder dataWithString:helper.wrongSecret];\n        XCTAssertFalse([helper.theAlgorithm verifySignedInput:helper.signedPayload withSignature:helper.signature verificationKeyData:secretData]);\n    }];\n\n    [XCTContext runActivityNamed:@\"should fail to verify JWT with invalid signature\" block:^(id<XCTActivity> _Nonnull activity) {\n        __auto_type secretData = [helper.base64Coder dataWithString:helper.secret];\n        XCTAssertFalse([helper.theAlgorithm verifySignedInput:helper.signedPayload withSignature:nil verificationKeyData:secretData]);\n    }];\n}\n\n@end\n"
  },
  {
    "path": "Tests/JWTTests/Tests/Algorithms/JWTAlgorithmNoneTests.m",
    "content": "//\n//  JWTAlgorithmNoneTests.m\n//  iOS_Tests\n//\n//  Created by Dmitry on 7/29/18.\n//\n\n@import XCTest;\n@import JWT;\n\n@interface JWTAlgorithmTestsHelper__None : NSObject\n@property (copy, nonatomic, readwrite) NSString *payload;\n@property (copy, nonatomic, readwrite) NSString *signedPayload;\n@property (copy, nonatomic, readwrite) NSString *signedPayloadBase64;\n@property (copy, nonatomic, readwrite) NSString *secret;\n@property (copy, nonatomic, readwrite) NSString *wrongSecret;\n@property (copy, nonatomic, readwrite) NSString *signature;\n@property (copy, nonatomic, readwrite) NSString *name;\n- (instancetype)configuredByName:(NSString *)name;\n\n@property (strong, nonatomic, readwrite) id <JWTAlgorithm> algorithm;\n@property (strong, nonatomic, readwrite) JWTAlgorithmHolder *theAlgorithm;\n\n@property (strong, nonatomic, readwrite) JWTBase64Coder *base64Coder;\n@end\n\n@implementation JWTAlgorithmTestsHelper__None\n- (NSDictionary <NSString *, void(^)(void)>*)configurations {\n    __weak __auto_type weakSelf = self;\n    return @{\n             JWTAlgorithmNameNone : ^{\n                 weakSelf.signedPayload = @\"eyJhbGciOiJub25lIn0.eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ\";\n                 weakSelf.signedPayloadBase64 = @\"\";\n                 weakSelf.signature = @\"signed\";\n             }\n             };\n}\n- (void)generalConfigure {\n    self.payload = @\"payload\";\n    self.secret = @\"secret\";\n    self.wrongSecret = @\"notTheSecret\";\n    self.base64Coder = [JWTBase64Coder new];\n}\n- (instancetype)configuredByName:(NSString *)name {\n    __auto_type configured = [self configurations][name];\n    if (configured) {\n        [self generalConfigure];\n        configured();\n        self.name = name;\n    }\n    // choose configuration here?\n    self.algorithm = [JWTAlgorithmFactory algorithmByName:name];\n    self.theAlgorithm = [[JWTAlgorithmHolder alloc] initWithAlgorithm:self.algorithm];\n    return self;\n}\n@end\n\n\n@interface JWTAlgorithmNoneTests : XCTestCase\n\n@end\n\n@implementation JWTAlgorithmNoneTests\n\n- (void)setUp {\n    [super setUp];\n    // Put setup code here. This method is called before the invocation of each test method in the class.\n}\n\n- (void)tearDown {\n    // Put teardown code here. This method is called after the invocation of each test method in the class.\n    [super tearDown];\n}\n\n- (void)testExample {\n    // This is an example of a functional test case.\n    // Use XCTAssert and related functions to verify your tests produce the correct results.\n}\n\n- (void)testPerformanceExample {\n    // This is an example of a performance test case.\n    [self measureBlock:^{\n        // Put the code you want to measure the time of here.\n    }];\n}\n\n- (void)testAlgorithms {\n    {\n        [self theTestForAlgorithmName:@\"none\"];\n    }\n}\n\n- (void)theTestForAlgorithmName:(NSString *)name {\n    __block __auto_type helper = [[JWTAlgorithmTestsHelper__None new] configuredByName:name];\n\n    XCTAssertNotNil(helper);\n    XCTAssertNotNil(helper.algorithm);\n\n    [XCTContext runActivityNamed:@\"name is none\" block:^(id<XCTActivity> _Nonnull activity){\n        XCTAssertEqualObjects(helper.algorithm.name, name);\n    }];\n\n    [XCTContext runActivityNamed:@\"should not encode payload and return emptry signature instead\" block:^(id<XCTActivity> _Nonnull activity){\n        __auto_type encodedPayload = [helper.theAlgorithm encodePayload:helper.payload withSecret:helper.secret];\n        XCTAssertEqualObjects([helper.base64Coder stringWithData:encodedPayload], helper.signedPayloadBase64);\n    }];\n\n    [XCTContext runActivityNamed:@\"should not encode payload data and return emptry signature instead\" block:^(id<XCTActivity> _Nonnull activity){\n        __auto_type payloadData = [helper.base64Coder dataWithString:helper.payload];\n        __auto_type secretData = [helper.base64Coder dataWithString:helper.secret];\n\n        __auto_type encodedPayload = [helper.theAlgorithm encodePayloadData:payloadData withSecret:secretData];\n        XCTAssertEqualObjects([encodedPayload base64EncodedStringWithOptions:0], helper.signedPayloadBase64);\n    }];\n\n    [XCTContext runActivityNamed:@\"should not verify JWT with a secret provided\" block:^(id<XCTActivity> _Nonnull activity){\n        XCTAssertFalse([helper.theAlgorithm verifySignedInput:helper.signedPayload withSignature:nil verificationKey:helper.secret]);\n    }];\n\n    [XCTContext runActivityNamed:@\"should not verify JWT with a signature provided\" block:^(id<XCTActivity> _Nonnull activity){\n        XCTAssertFalse([helper.theAlgorithm verifySignedInput:helper.signedPayload withSignature:helper.signature verificationKey:nil]);\n    }];\n\n    [XCTContext runActivityNamed:@\"should verify JWT with no signature and no secret provided\" block:^(id<XCTActivity> _Nonnull activity){\n        XCTAssertTrue([helper.theAlgorithm verifySignedInput:helper.signedPayload withSignature:nil verificationKey:nil]);\n    }];\n\n    [XCTContext runActivityNamed:@\"should not verify JWT with a secret data provided\" block:^(id<XCTActivity> _Nonnull activity){\n        __auto_type secretData = [helper.base64Coder dataWithString:helper.secret];\n        XCTAssertFalse([helper.theAlgorithm verifySignedInput:helper.signedPayload withSignature:nil verificationKeyData:secretData]);\n    }];\n\n    [XCTContext runActivityNamed:@\"should not verify JWT with a signature data provided\" block:^(id<XCTActivity> _Nonnull activity){\n        __auto_type secretData = [helper.base64Coder dataWithString:nil];\n        XCTAssertFalse([helper.theAlgorithm verifySignedInput:helper.signedPayload withSignature:helper.signature verificationKeyData:secretData]);\n    }];\n\n    [XCTContext runActivityNamed:@\"should verify JWT with no signature and no secret data provided\" block:^(id<XCTActivity> _Nonnull activity){\n        __auto_type secretData = [helper.base64Coder dataWithString:nil];\n        XCTAssertTrue([helper.theAlgorithm verifySignedInput:helper.signedPayload withSignature:nil verificationKeyData:secretData]);\n    }];\n}\n\n@end\n"
  },
  {
    "path": "Tests/JWTTests/Tests/ClaimSet/JWTClaimsCustomClaimsBaseTests.m",
    "content": "//\n//  JWTClaimsCustomClaimsBaseTests.m\n//  iOS_Tests\n//\n//  Created by Dmitry Lobanov on 30.05.2021.\n//\n\n@import XCTest;\n@import JWT;\n\n/**\n Consider the following claims set.\n \n \"intersection\": \"1, 2\" // Actually, it is array\n \n and the rule\n \n \"intersection\" arrays should have non-empty intersection.\n\n Let's implement this claim.\n */\n\n/// Define a name of claim\n@interface JWTClaimsNames (Custom)\n@property (copy, nonatomic, readonly, class) NSString *intersectionOfArrays;\n@end\n\n@implementation JWTClaimsNames (Custom)\n+ (NSString *)intersectionOfArrays { return @\"intersection\"; }\n@end\n\n/// Define a claim\n@interface JWTClaimCustomIntersectionOfArrays : JWTClaimBase\n@end\n\n@implementation JWTClaimCustomIntersectionOfArrays\n+ (NSString *)name { return JWTClaimsNames.intersectionOfArrays; }\n@end\n\n/// Define a serialization\n@interface JWTClaimSerializerForArray : JWTClaimSerializerBase\n@end\n\n@implementation JWTClaimSerializerForArray\n\n- (NSObject *)deserializedClaimValue:(NSObject *)value forName:(NSString *)name {\n    if ([value isKindOfClass:NSString.class]) {\n        __auto_type array = [(NSString *)value componentsSeparatedByString:@\",\"];\n        __auto_type result = [NSMutableArray array];\n        for (NSString *item in array) {\n            [result addObject:@(item.integerValue)];\n        }\n        \n        __auto_type descriptor = [[NSSortDescriptor alloc] initWithKey:@\"integerValue\" ascending:YES];\n\n        return [result sortedArrayUsingDescriptors:@[descriptor]];\n    }\n    return value;\n}\n\n- (NSObject *)serializedClaimValue:(id<JWTClaimProtocol>)claim {\n    __auto_type value = claim.value;\n    if ([value isKindOfClass:NSArray.class]) {\n        __auto_type descriptor = [[NSSortDescriptor alloc] initWithKey:@\"integerValue\" ascending:YES];\n        \n        __auto_type sortedArray = [(NSArray *)claim.value sortedArrayUsingDescriptors:@[descriptor]];\n        return [sortedArray componentsJoinedByString:@\",\"];\n    }\n    return value;\n}\n\n@end\n\n/// Define a rule\n@interface JWTClaimVerifierForIntersection : JWTClaimVerifierBase\n@end\n\n@implementation JWTClaimVerifierForIntersection\n- (BOOL)verifyValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue {\n    if ([value isKindOfClass:NSArray.class] && [trustedValue isKindOfClass:NSArray.class]) {\n        __auto_type lhs = (NSArray *)value;\n        __auto_type rhs = (NSArray *)trustedValue;\n        \n        if (rhs.count != 2) {\n            return NO;\n        }\n        \n        if (lhs.count > 2 || lhs.count == 0) {\n            return NO;\n        }\n        \n        __auto_type lowerBorder = ((NSNumber *)rhs.firstObject).integerValue;\n        __auto_type upperBorder = ((NSNumber *)rhs.lastObject).integerValue;\n        \n        if (lhs.count == 1) {\n            __auto_type checkValue = ((NSNumber *)lhs.firstObject).integerValue;\n            return lowerBorder <= checkValue && upperBorder >= checkValue;\n        }\n        \n        if (lhs.count == 2) {\n            __auto_type untrustedLowerBorder = ((NSNumber *)lhs.firstObject).integerValue;\n            __auto_type untrustedUpperBorder = ((NSNumber *)lhs.lastObject).integerValue;\n            return (untrustedLowerBorder >= lowerBorder && untrustedLowerBorder <= upperBorder) || (untrustedUpperBorder >= lowerBorder && untrustedUpperBorder <= upperBorder);\n        }\n    }\n    return NO;\n}\n@end\n\n/// Define a dsl\n@interface JWTClaimsSetDSLBase (CustomDSL)\n@property (copy, nonatomic, readwrite) NSArray *intersection;\n@end\n\n@implementation JWTClaimsSetDSLBase (CustomDSL)\n- (NSArray *)intersection {\n    return (NSArray *)[self dslValueForName:JWTClaimsNames.intersectionOfArrays];\n}\n- (void)setIntersection:(NSArray *)intersection {\n    [self dslSetValue:intersection forName:JWTClaimsNames.intersectionOfArrays];\n}\n@end\n\n@interface JWTClaimVariations (CustomDSL)\n+ (id<JWTClaimProtocol>)intersectionOfArrays;\n@end\n\n@implementation JWTClaimVariations (CustomDSL)\n+ (id<JWTClaimProtocol>)intersectionOfArrays {\n    return [JWTClaimCustomIntersectionOfArrays new];\n}\n@end\n\n@interface JWTClaimSerializerVariations (CustomDSL)\n+ (id<JWTClaimSerializerProtocol>)array;\n@end\n\n@implementation JWTClaimSerializerVariations (CustomDSL)\n+ (id<JWTClaimSerializerProtocol>)array {\n    return [JWTClaimSerializerForArray new];\n}\n@end\n\n@interface JWTClaimVerifierVariations (CustomDSL)\n+ (id<JWTClaimVerifierProtocol>)intersection;\n@end\n\n@implementation JWTClaimVerifierVariations (CustomDSL)\n+ (id<JWTClaimVerifierProtocol>)intersection {\n    return [JWTClaimVerifierForIntersection new];\n}\n@end\n\n@interface JWTClaimsCustomClaimsBaseTests : XCTestCase\n@property (strong, nonatomic, readwrite) id<JWTClaimsSetCoordinatorProtocol> claimsSetCoordinator;\n@end\n\n@implementation JWTClaimsCustomClaimsBaseTests\n\n- (void)setUp {\n    // Put setup code here. This method is called before the invocation of each test method in the class.\n    __auto_type claim = JWTClaimVariations.intersectionOfArrays;\n    __auto_type claimSerializer = JWTClaimSerializerVariations.array;\n    __auto_type claimVerifier = JWTClaimVerifierVariations.intersection;\n    \n\n    self.claimsSetCoordinator = [JWTClaimsSetCoordinatorBase new];\n    [self.claimsSetCoordinator registerClaim:claim serializer:claimSerializer verifier:claimVerifier forClaimName:JWTClaimsNames.intersectionOfArrays];\n}\n\n- (void)tearDown {\n    // Put teardown code here. This method is called after the invocation of each test method in the class.\n}\n\n- (void)testSerialize {\n    __auto_type deserialized = ({\n        self.claimsSetCoordinator.configureClaimsSet(^JWTClaimsSetDSLBase * _Nonnull(JWTClaimsSetDSLBase * _Nonnull claimsSetDSL) {\n            claimsSetDSL.intersection = @[@(2), @(5)];\n            return claimsSetDSL;\n        });\n        \n        self.claimsSetCoordinator.claimsSetStorage;\n    });\n    \n    __auto_type serialized = ({\n        __auto_type dictionary = [self.claimsSetCoordinator.claimsSetSerializer dictionaryFromClaimsSet:deserialized];\n        dictionary;\n    });\n    \n    __auto_type result = @{\n        JWTClaimsNames.intersectionOfArrays : @\"2,5\"\n    };\n    XCTAssertEqual(serialized.count, 1);\n    XCTAssertEqualObjects(serialized, result);\n}\n\n- (void)testDeserialize {\n    __auto_type given = @{\n        JWTClaimsNames.intersectionOfArrays : @\"2,5\"\n    };\n    \n    __auto_type deserialized = ({\n        self.claimsSetCoordinator.claimsSetStorage = [JWTClaimsSetBase new];\n        [self.claimsSetCoordinator.claimsSetSerializer claimsSetFromDictionary:given];\n    });\n    __auto_type result = ({\n        __auto_type dsl = self.claimsSetCoordinator.dslDesrciption;\n        dsl.intersection = @[@(2), @(5)];\n        dsl;\n    });\n    XCTAssertEqualObjects(result.intersection, [deserialized claimByName:JWTClaimsNames.intersectionOfArrays].value);\n}\n\n- (void)testPerformanceExample {\n    // This is an example of a performance test case.\n    [self measureBlock:^{\n        // Put the code you want to measure the time of here.\n    }];\n}\n\n@end\n\n@interface JWTClaimsCustomClaimsDifferentNamesTests : XCTestCase\n@property (strong, nonatomic, readwrite) id<JWTClaimsSetCoordinatorProtocol> claimsSetCoordinator;\n@property (copy, nonatomic, readwrite) NSString *duplicateClaimName;\n@end\n\n@implementation JWTClaimsCustomClaimsDifferentNamesTests\n\n- (void)setUp {\n    self.duplicateClaimName = @\"duplicateClaimName\";\n    __auto_type claim = JWTClaimVariations.intersectionOfArrays;\n    __auto_type claimSerializer = JWTClaimSerializerVariations.array;\n    __auto_type claimVerifier = JWTClaimVerifierVariations.intersection;\n    \n\n    self.claimsSetCoordinator = [JWTClaimsSetCoordinatorBase new];\n//    [self.claimsSetCoordinator registerClaim:claim serializer:claimSerializer verifier:claimVerifier forClaimName:JWTClaimsNames.intersectionOfArrays];\n    [self.claimsSetCoordinator registerClaim:claim serializer:claimSerializer verifier:claimVerifier forClaimName:self.duplicateClaimName];\n}\n\n- (void)testSerialize {\n    __auto_type deserialized = ({\n        self.claimsSetCoordinator.configureClaimsSet(^JWTClaimsSetDSLBase * _Nonnull(JWTClaimsSetDSLBase * _Nonnull claimsSetDSL) {\n            [claimsSetDSL dslSetValue:@[@(2), @(5)] forName:self.duplicateClaimName];\n            return claimsSetDSL;\n        });\n        \n        self.claimsSetCoordinator.claimsSetStorage;\n    });\n    \n    __auto_type serialized = ({\n        __auto_type dictionary = [self.claimsSetCoordinator.claimsSetSerializer dictionaryFromClaimsSet:deserialized];\n        dictionary;\n    });\n    \n    __auto_type result = @{\n        self.duplicateClaimName : @\"2,5\"\n    };\n    XCTAssertEqual(serialized.count, 1);\n    XCTAssertEqualObjects(serialized, result);\n}\n\n- (void)testDeserialize {\n    __auto_type given = @{\n        self.duplicateClaimName : @\"2,5\"\n    };\n    \n    __auto_type deserialized = ({\n        self.claimsSetCoordinator.claimsSetStorage = [JWTClaimsSetBase new];\n        [self.claimsSetCoordinator.claimsSetSerializer claimsSetFromDictionary:given];\n    });\n    __auto_type result = ({\n        __auto_type dsl = self.claimsSetCoordinator.dslDesrciption;\n//        dsl.intersection = @[@(2), @(5)];\n        [dsl dslSetValue:@[@(2), @(5)] forName:self.duplicateClaimName];\n        dsl;\n    });\n    XCTAssertNotNil([result dslValueForName:self.duplicateClaimName]);\n    XCTAssertEqualObjects([result dslValueForName:self.duplicateClaimName], [deserialized claimByName:self.duplicateClaimName].value);\n}\n\n\n@end\n"
  },
  {
    "path": "Tests/JWTTests/Tests/ClaimSet/JWTClaimsSerializerBaseTests.m",
    "content": "//\n//  JWTClaimsSerializerBaseTests.m\n//  Tests\n//\n//  Created by Dmitry Lobanov on 24.05.2021.\n//\n\n@import XCTest;\n@import JWT;\n\n@interface JWTClaimsSerializerBaseTests : XCTestCase\n@property (strong, nonatomic, readwrite) id<JWTClaimsSetProtocol> deserialized;\n@property (copy, nonatomic, readwrite) NSDictionary *serialized;\n\n@property (assign, nonatomic, readwrite) NSTimeInterval expirationDateTimestamp;\n@property (assign, nonatomic, readwrite) NSTimeInterval notBeforeDateTimestamp;\n@property (assign, nonatomic, readwrite) NSTimeInterval issuedAtTimestamp;\n@end\n\n@implementation JWTClaimsSerializerBaseTests @end\n\n@interface JWTClaimsSerializerBaseTests__Serialization : JWTClaimsSerializerBaseTests @end\n\n@implementation JWTClaimsSerializerBaseTests__Serialization\n- (void)setUp {\n    self.expirationDateTimestamp = 1234567;\n    self.notBeforeDateTimestamp = 1234321;\n    self.issuedAtTimestamp = 1234333;\n\n    \n    __auto_type coordinator = [JWTClaimsSetCoordinatorBase new];\n    self.deserialized = ({\n        coordinator.configureClaimsSet(^JWTClaimsSetDSLBase * _Nonnull(JWTClaimsSetDSLBase * _Nonnull claimsSetDSL) {\n            claimsSetDSL.issuer = @\"Facebook\";\n            claimsSetDSL.subject = @\"Token\";\n            claimsSetDSL.audience = @\"https://jwt.io\";\n            claimsSetDSL.expirationDate = [NSDate dateWithTimeIntervalSince1970:self.expirationDateTimestamp];\n            claimsSetDSL.notBeforeDate = [NSDate dateWithTimeIntervalSince1970:self.notBeforeDateTimestamp];\n            claimsSetDSL.issuedAt = [NSDate dateWithTimeIntervalSince1970:self.issuedAtTimestamp];\n            claimsSetDSL.identifier = @\"thisisunique\";\n            claimsSetDSL.type = @\"test\";\n            claimsSetDSL.scope = @\"https://www.googleapis.com/auth/devstorage.read_write\";\n            return claimsSetDSL;\n        });\n        coordinator.claimsSetStorage;\n    });\n    \n    __auto_type serializer = coordinator.claimsSetSerializer;\n    self.serialized = ({\n        __auto_type serialized = [serializer dictionaryFromClaimsSet:self.deserialized];\n        serialized;\n    });\n}\n- (void)testHaveEnoughKeys:(NSNumber *)number inDictionary:(NSDictionary *)dictionary {\n    [XCTContext runActivityNamed:@\"number of serialized values\" block:^(id<XCTActivity> _Nonnull activity) {\n        XCTAssertEqualObjects(@(dictionary.allValues.count), @(9));\n    }];\n}\n- (void)testDictionary:(NSDictionary *)dictionary hasValue:(id)value forKey:(NSString *)key name:(NSString *)name {\n    __auto_type activityName = [NSString stringWithFormat:@\"serializes the %@ property\", name];\n    [XCTContext runActivityNamed:activityName block:^(id<XCTActivity>  _Nonnull activity) {\n        XCTAssertEqualObjects([dictionary objectForKey:key], value);\n    }];\n}\n- (void)test {\n    [self testHaveEnoughKeys:@(9) inDictionary:self.serialized];\n    [self testDictionary:self.serialized hasValue:[self.deserialized claimByName:JWTClaimsNames.issuer].value forKey:JWTClaimsNames.issuer name:@\"issuer\"];\n    [self testDictionary:self.serialized hasValue:[self.deserialized claimByName:JWTClaimsNames.subject].value forKey:JWTClaimsNames.subject name:@\"subject\"];\n    [self testDictionary:self.serialized hasValue:[self.deserialized claimByName:JWTClaimsNames.audience].value forKey:JWTClaimsNames.audience name:@\"audience\"];\n    [self testDictionary:self.serialized hasValue:@(self.expirationDateTimestamp) forKey:JWTClaimsNames.expirationTime name:@\"expirationDate\"];\n    [self testDictionary:self.serialized hasValue:@(self.notBeforeDateTimestamp) forKey:JWTClaimsNames.notBefore name:@\"notBeforeDate\"];\n    [self testDictionary:self.serialized hasValue:@(self.issuedAtTimestamp) forKey:JWTClaimsNames.issuedAt name:@\"issuedAtDate\"];\n    [self testDictionary:self.serialized hasValue:[self.deserialized claimByName:JWTClaimsNames.jwtID].value forKey:JWTClaimsNames.jwtID name:@\"identifier(jti)\"];\n    [self testDictionary:self.serialized hasValue:[self.deserialized claimByName:JWTClaimsNames.type].value forKey:JWTClaimsNames.type name:@\"type\"];\n    [self testDictionary:self.serialized hasValue:[self.deserialized claimByName:JWTClaimsNames.scope].value forKey:JWTClaimsNames.scope name:@\"scope\"];\n}\n@end\n\n@interface JWTClaimsSerializerBaseTests__Deserialization : JWTClaimsSerializerBaseTests @end\n\n@implementation JWTClaimsSerializerBaseTests__Deserialization\n- (void)setUp {\n    self.serialized = @{\n                   @\"iss\": @\"Facebook\",\n                   @\"sub\": @\"Token\",\n                   @\"aud\": @\"https://jwt.io\",\n                   @\"exp\": @(64092211200),\n                   @\"nbf\": @(-62135769600),\n                   @\"iat\": @(1370005175),\n                   @\"jti\": @\"thisisunique\",\n                   @\"typ\": @\"test\",\n                   @\"scope\": @\"https://www.googleapis.com/auth/devstorage.read_write\"\n                   };\n    __auto_type claimsProvider = [[JWTClaimsProviderBase alloc] init];\n    __auto_type claimsSetStorage = [[JWTClaimsSetBase alloc] init];\n    __auto_type serializer = [[JWTClaimsSetSerializerBase alloc] init];\n    serializer.claimsProvider = claimsProvider;\n    serializer.claimsSetStorage = claimsSetStorage;\n    \n    __auto_type result = [serializer claimsSetFromDictionary:self.serialized];\n    self.deserialized = [[[JWTClaimsSetBase alloc] init] copyWithClaims:result.claims];\n}\n- (void)testDeserializeProperty:(id)property comparedToValue:(id)value name:(NSString *)name {\n    __auto_type propertyKey = name;\n    __auto_type activityName = [NSString stringWithFormat:@\"deserializes the %@ property\", propertyKey];\n    [XCTContext runActivityNamed:activityName block:^(id<XCTActivity> _Nonnull activity) {\n        XCTAssertEqualObjects(property, value);\n    }];\n}\n- (void)test {\n    [self testDeserializeProperty:[self.deserialized claimByName:JWTClaimsNames.issuer].value comparedToValue:self.serialized[JWTClaimsNames.issuer] name:JWTClaimsNames.issuer];\n    [self testDeserializeProperty:[self.deserialized claimByName:JWTClaimsNames.subject].value comparedToValue:self.serialized[JWTClaimsNames.subject] name:JWTClaimsNames.subject];\n    [self testDeserializeProperty:[self.deserialized claimByName:JWTClaimsNames.audience].value comparedToValue:self.serialized[JWTClaimsNames.audience] name:JWTClaimsNames.audience];\n    [self testDeserializeProperty:[self.deserialized claimByName:JWTClaimsNames.expirationTime].value comparedToValue:[NSDate dateWithTimeIntervalSince1970:[self.serialized[JWTClaimsNames.expirationTime] doubleValue]] name:JWTClaimsNames.expirationTime];\n    [self testDeserializeProperty:[self.deserialized claimByName:JWTClaimsNames.notBefore].value comparedToValue:[NSDate dateWithTimeIntervalSince1970:[self.serialized[JWTClaimsNames.notBefore] doubleValue]] name:JWTClaimsNames.notBefore];\n    [self testDeserializeProperty:[self.deserialized claimByName:JWTClaimsNames.issuedAt].value comparedToValue:[NSDate dateWithTimeIntervalSince1970:[self.serialized[JWTClaimsNames.issuedAt] doubleValue]] name:JWTClaimsNames.issuedAt];\n    [self testDeserializeProperty:[self.deserialized claimByName:JWTClaimsNames.jwtID].value comparedToValue:self.serialized[JWTClaimsNames.jwtID] name:JWTClaimsNames.jwtID];\n    [self testDeserializeProperty:[self.deserialized claimByName:JWTClaimsNames.type].value comparedToValue:self.serialized[JWTClaimsNames.type] name:JWTClaimsNames.type];\n    [self testDeserializeProperty:[self.deserialized claimByName:JWTClaimsNames.scope].value comparedToValue:self.serialized[JWTClaimsNames.scope] name:JWTClaimsNames.scope];\n}\n@end\n"
  },
  {
    "path": "Tests/JWTTests/Tests/ClaimSet/JWTClaimsSerializerTests.m",
    "content": "//\n//  JWTClaimsSerializerTests.m\n//  iOS_Tests\n//\n//  Created by Dmitry on 7/29/18.\n//\n\n@import XCTest;\n@import JWT;\n\n@interface JWTClaimsSerializerTests : XCTestCase\n@property (strong, nonatomic, readwrite) JWTClaimsSet *deserialized;\n@property (copy, nonatomic, readwrite) NSDictionary *serialized;\n\n@property (assign, nonatomic, readwrite) NSTimeInterval expirationDateTimestamp;\n@property (assign, nonatomic, readwrite) NSTimeInterval notBeforeDateTimestamp;\n@property (assign, nonatomic, readwrite) NSTimeInterval issuedAtTimestamp;\n@end\n\n@implementation JWTClaimsSerializerTests @end\n\n@interface JWTClaimsSerializerTests__Serialization : JWTClaimsSerializerTests @end\n\n@implementation JWTClaimsSerializerTests__Serialization\n- (void)setUp {\n    self.expirationDateTimestamp = 1234567;\n    self.notBeforeDateTimestamp = 1234321;\n    self.issuedAtTimestamp = 1234333;\n    self.deserialized = ({\n        __auto_type claimsSet = [[JWTClaimsSet alloc] init];\n        claimsSet.issuer = @\"Facebook\";\n        claimsSet.subject = @\"Token\";\n        claimsSet.audience = @\"https://jwt.io\";\n        claimsSet.expirationDate = [NSDate dateWithTimeIntervalSince1970:self.expirationDateTimestamp];\n        claimsSet.notBeforeDate = [NSDate dateWithTimeIntervalSince1970:self.notBeforeDateTimestamp];\n        claimsSet.issuedAt = [NSDate dateWithTimeIntervalSince1970:self.issuedAtTimestamp];\n        claimsSet.identifier = @\"thisisunique\";\n        claimsSet.type = @\"test\";\n        claimsSet.scope = @\"https://www.googleapis.com/auth/devstorage.read_write\";\n        claimsSet;\n    });\n    self.serialized = ({\n        __auto_type serialized = [JWTClaimsSetSerializer dictionaryWithClaimsSet:self.deserialized];\n        serialized;\n    });\n}\n- (void)testHaveEnoughKeys:(NSNumber *)number inDictionary:(NSDictionary *)dictionary {\n    [XCTContext runActivityNamed:@\"number of serialized values\" block:^(id<XCTActivity> _Nonnull activity) {\n        XCTAssertEqualObjects(@(dictionary.allValues.count), @(9));\n    }];\n}\n- (void)testDictionary:(NSDictionary *)dictionary hasValue:(id)value forKey:(NSString *)key name:(NSString *)name {\n    __auto_type activityName = [NSString stringWithFormat:@\"serializes the %@ property\", name];\n    [XCTContext runActivityNamed:activityName block:^(id<XCTActivity>  _Nonnull activity) {\n        XCTAssertEqualObjects([dictionary objectForKey:key], value);\n    }];\n}\n- (void)test {\n    [self testHaveEnoughKeys:@(9) inDictionary:self.serialized];\n    [self testDictionary:self.serialized hasValue:self.deserialized.issuer forKey:@\"iss\" name:@\"issuer\"];\n    [self testDictionary:self.serialized hasValue:self.deserialized.subject forKey:@\"sub\" name:@\"subject\"];\n    [self testDictionary:self.serialized hasValue:self.deserialized.audience forKey:@\"aud\" name:@\"audience\"];\n    [self testDictionary:self.serialized hasValue:@(self.expirationDateTimestamp) forKey:@\"exp\" name:@\"expirationDate\"];\n    [self testDictionary:self.serialized hasValue:@(self.notBeforeDateTimestamp) forKey:@\"nbf\" name:@\"notBeforeDate\"];\n    [self testDictionary:self.serialized hasValue:@(self.issuedAtTimestamp) forKey:@\"iat\" name:@\"issuedAtDate\"];\n    [self testDictionary:self.serialized hasValue:self.deserialized.identifier forKey:@\"jti\" name:@\"identifier(jti)\"];\n    [self testDictionary:self.serialized hasValue:self.deserialized.type forKey:@\"typ\" name:@\"type\"];\n    [self testDictionary:self.serialized hasValue:self.deserialized.scope forKey:@\"scope\" name:@\"scope\"];\n\n}\n@end\n\n@interface JWTClaimsSerializerTests__Deserialization : JWTClaimsSerializerTests @end\n\n@implementation JWTClaimsSerializerTests__Deserialization\n- (void)setUp {\n    self.serialized = @{\n                   @\"iss\": @\"Facebook\",\n                   @\"sub\": @\"Token\",\n                   @\"aud\": @\"https://jwt.io\",\n                   @\"exp\": @(64092211200),\n                   @\"nbf\": @(-62135769600),\n                   @\"iat\": @(1370005175),\n                   @\"jti\": @\"thisisunique\",\n                   @\"typ\": @\"test\",\n                   @\"scope\": @\"https://www.googleapis.com/auth/devstorage.read_write\"\n                   };\n    self.deserialized = [JWTClaimsSetSerializer claimsSetWithDictionary:self.serialized];\n}\n- (void)testDeserializeProperty:(id)property comparedToValue:(id)value name:(NSString *)name {\n    __auto_type propertyKey = name;\n    __auto_type activityName = [NSString stringWithFormat:@\"deserializes the %@ property\", propertyKey];\n    [XCTContext runActivityNamed:activityName block:^(id<XCTActivity> _Nonnull activity) {\n        XCTAssertEqualObjects(property, value);\n    }];\n}\n- (void)test {\n    [self testDeserializeProperty:self.deserialized.issuer comparedToValue:[self.serialized objectForKey:@\"iss\"] name:@\"iss\"];\n    [self testDeserializeProperty:self.deserialized.subject comparedToValue:[self.serialized objectForKey:@\"sub\"] name:@\"sub\"];\n    [self testDeserializeProperty:self.deserialized.audience comparedToValue:[self.serialized objectForKey:@\"aud\"] name:@\"aud\"];\n    [self testDeserializeProperty:self.deserialized.expirationDate comparedToValue:[NSDate dateWithTimeIntervalSince1970:[[self.serialized objectForKey:@\"exp\"] doubleValue]] name:@\"exp\"];\n    [self testDeserializeProperty:self.deserialized.notBeforeDate comparedToValue:[NSDate dateWithTimeIntervalSince1970:[[self.serialized objectForKey:@\"nbf\"] doubleValue]] name:@\"nbf\"];\n    [self testDeserializeProperty:self.deserialized.issuedAt comparedToValue:[NSDate dateWithTimeIntervalSince1970:[[self.serialized objectForKey:@\"iat\"] doubleValue]] name:@\"iat\"];\n    [self testDeserializeProperty:self.deserialized.identifier comparedToValue:[self.serialized objectForKey:@\"jti\"] name:@\"jti\"];\n    [self testDeserializeProperty:self.deserialized.type comparedToValue:[self.serialized objectForKey:@\"typ\"] name:@\"typ\"];\n    [self testDeserializeProperty:self.deserialized.scope comparedToValue:[self.serialized objectForKey:@\"scope\"] name:@\"scope\"];\n}\n@end\n"
  },
  {
    "path": "Tests/JWTTests/Tests/JWT/JWTIssuesTests.m",
    "content": "//\n//  JWTIssuesTests.m\n//  iOS_Tests\n//\n//  Created by Dmitry on 7/29/18.\n//\n\n@import XCTest;\n@import JWT;\n\n#import \"JWTAssetAccessor.h\"\n\n@interface JWTIssuesTests : XCTestCase\n\n@end\n\n@implementation JWTIssuesTests\n- (void)testIssues {\n    [XCTContext runActivityNamed:@\"RS256 key should be read correctly from file. #121\" block:^(id<XCTActivity> _Nonnull activity) {\n        __auto_type accessor = [[JWTAssetAccessor alloc] initWithFolder:@\"rs256\"];\n        __auto_type content = accessor.publicKeyBase64;\n        id key = ((JWTCryptoSecurityComponent *)[[JWTCryptoSecurity componentsFromFileContent:content] componentsOfType:JWTCryptoSecurityComponents.Key].firstObject).content;\n        NSLog(@\"%@ key: %@\", self.debugDescription, key);\n    }];\n    [XCTContext runActivityNamed:@\"RS256 signature verification crashes application #141\" block:^(id<XCTActivity> _Nonnull activity) {\n        NSString *publicKey = @\"MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAM/l2OJO6C6eZWwV4h2FooxI2YZ/XNL+BP7kEB7wiudqi0vGRAheahe+vtazFE+J3V1iy+bwIqLXop571zgj6G0CAwEAAQ==\";\n        NSString *algorithmName = JWTAlgorithmNameRS256;\n        NSString *token = @\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGFpbVZlcnNpb24iOiIxLjAuMCIsImNvbnRlbnRIYXNoIjoiMDJlMzNkZjhlMjUwYzRmOTZlODUwM2VlZDRlMDJlN2MxMWQ1MWVmOGViYzI0MDkyM2NlOWQ0NDcwMWU5Y2YxOSIsImlhdCI6MTUwMzQwNzUxOH0.d1ETmvpXxPl747A8OzIGDy-Tke5D9NRVmnJtTBxx61wLQo7fH14u4XMWChMlkjG_9WAvWOAIVFtMQb9IZuA5QQ\";\n        id <JWTAlgorithmDataHolderProtocol> verifyDataHolder = [JWTAlgorithmRSFamilyDataHolder new].keyExtractorType([JWTCryptoKeyExtractor publicKeyWithPEMBase64].type).algorithmName(algorithmName).secret(publicKey);\n        JWTCodingBuilder *verifyBuilder = [JWTDecodingBuilder decodeMessage:token].addHolder(verifyDataHolder);\n        JWTCodingResultType *verifyResult = verifyBuilder.result;\n\n        if (verifyResult.successResult) {\n            // success\n            NSLog(@\"%@ success: %@\", self.debugDescription, verifyResult.successResult.payload);\n        }\n        else {\n            // error\n            NSLog(@\"%@ error: %@\", self.debugDescription, verifyResult.errorResult.error);\n        }\n    }];\n    [XCTContext runActivityNamed:@\"RS256 verification fails with valid public key #139\" block:^(id<XCTActivity> _Nonnull activity) {\n        NSString *publicKey = @\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlyT86d6Stui8i8ZpzzbFHE+WVx/77fU+rglC6CMAslBr3WZO0xibQJJtBCTEkw7r6LkLaEOTkvHdjE1/cUnAFw4M7iIy238gx5gRoELZ7g+nh9C6v8HuQJovabaOFed+wnayw8D0YV5+JG6HJ4ExOO/3TmAum1yacBAzYFHcxOO/glbJY0/41K1kU7d5bFK9gs7DsMyBOInXDdIiTO9XrmN8zY3zncnsgYiwlrVwm5lfJIBnE38gOWen7EnFossogJqrn84SPao9Kslr9064PJN74AWh1ricU/A1zYH0QAFHSI2WGlyoH9V9ZbOWm8gn1IqCypVyg1YCrwaqThjESQIDAQAB\";\n        NSString *algorithmName = JWTAlgorithmNameRS256;\n        NSString* token = @\"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC93d3cuY3JhY2tlZC5jb20iLCJhdWQiOiJjcmFja2VkIGFwcCIsInN1YiI6ImNyYWNrZWQgYXBwIiwiZXhwIjoxNTA0OTEzMTY2LCJ1aWQiOiI3Nzk3MiIsInNhbHQiOiI0NTQ3YjQ0ZTA2OTAyOTE3OTJiMjM0MjcwOWY5NTU4ZmQ2MTE3MGExIiwiYXBwX2FkIjpmYWxzZSwiYXBwX3ZvdGVfY29tbWVudCI6dHJ1ZX0.Bqllr9A2ULTlncb0EKLNjTn0qWKG_8NX6mwjf2S1GdS3JH9D7uGGVioxhHN24OZS5QCN9q6rcuYSQzMn-Vz4fAKtDOQws6LZLm7OFwe7uLYXlrK0w3GIxs6nRuGWGIzyxiwjOcy5Vs0HlKAZF7bE8aDUtW5WpbBz4JvgvKc2kmAc3IAMhxs8zRF0jaaiAye7Z7EMjtztmuW8eUosnwKPSa-P2zC-ElcAA67WJ7otYThlbqYDEnVhHrSxj3i3LdgRk0dwumf1zmIikCxFJBDClIroSat9J3hBYFTs6R8EL1YAUc387H_XXLMItLWeHPIMwmXx5wVzr6G_biWlaSyK1w\";\n\n        id <JWTAlgorithmDataHolderProtocol> verifyDataHolder = [JWTAlgorithmRSFamilyDataHolder new].keyExtractorType([JWTCryptoKeyExtractor publicKeyWithPEMBase64].type).algorithmName(algorithmName).secret(publicKey);\n        JWTCodingBuilder *verifyBuilder = [JWTDecodingBuilder decodeMessage:token].addHolder(verifyDataHolder);\n        JWTCodingResultType *verifyResult = verifyBuilder.result;\n\n        if (verifyResult.successResult) {\n            // success\n            NSLog(@\"%@ success: %@\", self.debugDescription, verifyResult.successResult.payload);\n            token = verifyResult.successResult.encoded;\n            NSLog(@\"%@ token: %@\", self.debugDescription, token);\n        }\n        else {\n            // error\n            NSLog(@\"%@ error: %@\", self.debugDescription, verifyResult.errorResult.error);\n        }\n    }];\n    [XCTContext runActivityNamed:@\"Crashing RS256 decoding #112\" block:^(id<XCTActivity> _Nonnull activity) {\n        NSString *publicKey = @\" MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQAB==\";\n        NSString *algorithmName = @\"RS256\";\n        NSString *message = @\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE\";\n        JWTBuilder *builder = [JWTBuilder decodeMessage:message].secret(publicKey).algorithmName(algorithmName);\n        NSDictionary *dictionary = builder.decode;\n\n        // should be invalid certificate error.\n        if (builder.jwtError) {\n            NSLog(@\"%@ error occurred: %@\", self, builder.jwtError);\n        }\n        else {\n            NSLog(@\"%@ payload! %@\", self, dictionary);\n        }\n        XCTAssertNil(dictionary);\n    }];\n}\n\n@end\n"
  },
  {
    "path": "Tests/JWTTests/Tests/JWT/JWTReadmeTests.m",
    "content": "//\n//  JWTReadmeTests.m\n//  iOS_Tests\n//\n//  Created by Dmitry on 7/29/18.\n//\n\n@import XCTest;\n@import JWT;\n\n@interface JWTReadmeTests : XCTestCase\n\n@end\n\n@implementation JWTReadmeTests\n\n- (void)testVersionThree {\n    [XCTContext runActivityNamed:@\"ClaimsSetCoordinator should work properly\" block:^(id<XCTActivity>  _Nonnull activity) {\n        id<JWTClaimsSetCoordinatorProtocol> claimsSetCoordinator = [JWTClaimsSetCoordinatorBase new];\n        __auto_type claimsSetDSL = claimsSetCoordinator.dslDesrciption;\n        // fill it\n        claimsSetDSL.issuer = @\"Facebook\";\n        claimsSetDSL.subject = @\"Token\";\n        claimsSetDSL.audience = @\"https://jwt.io\";\n        \n        claimsSetCoordinator.claimsSetStorage = claimsSetDSL.claimsSetStorage;\n        // encode it\n        __auto_type secret = @\"secret\";\n        __auto_type algorithmName = @\"HS384\";\n        __auto_type headers = @{@\"custom\":@\"value\"};\n\n        id<JWTAlgorithmDataHolderProtocol>holder = [JWTAlgorithmHSFamilyDataHolder new].algorithmName(algorithmName).secret(secret);\n\n        JWTCodingResultType *result = [JWTEncodingBuilder encodeClaimsSetWithCoordinator:claimsSetCoordinator].headers(headers).addHolder(holder).result;\n\n        NSString *encodedToken = result.successResult.encoded;\n        if (result.successResult) {\n            // handle encoded result\n            NSLog(@\"encoded result: %@\", result.successResult.encoded);\n        }\n        else {\n            // handle error\n            NSLog(@\"encode failed, error: %@\", result.errorResult.error);\n        }\n\n        // decode it\n        // you can set any property that you want, all properties are optional\n        __auto_type trustedClaimsSet = claimsSetDSL.claimsSetStorage;\n\n        NSNumber *options = @(JWTCodingDecodingOptionsNone);\n        NSString *yourJwt = encodedToken; // from previous example\n        JWTCodingResultType *decodedResult = [JWTDecodingBuilder decodeMessage:yourJwt].claimsSetCoordinator(claimsSetCoordinator).addHolder(holder).options(options).and.result;\n\n        if (decodedResult.successResult) {\n            // handle decoded result\n            NSLog(@\"decoded result: %@\", decodedResult.successResult.headerAndPayloadDictionary);\n            NSLog(@\"headers: %@\", decodedResult.successResult.headers);\n            NSLog(@\"payload: %@\", decodedResult.successResult.payload);\n            NSLog(@\"trustedClaimsSet: %@\", [claimsSetCoordinator.claimsSetSerializer dictionaryFromClaimsSet:trustedClaimsSet]);\n            NSLog(@\"decodedClaimsSet: %@\", [claimsSetCoordinator.claimsSetSerializer dictionaryFromClaimsSet:decodedResult.successResult.claimsSetStorage]);\n        }\n        else {\n            // handle error\n            NSLog(@\"decode failed, error: %@\", decodedResult.errorResult.error);\n        }\n    }];\n    [XCTContext runActivityNamed:@\"API should work well with EC algorithms\" block:^(id<XCTActivity>  _Nonnull activity) {\n        NSString *privatePemFilename = @\"ec256-private\";\n        NSString *publicPemFilename = @\"ec256-public\";\n        NSString *passphrase = @\"password\";\n        NSString *(^loadKey)(NSString *, NSBundle *) = ^NSString *(NSString *name, NSBundle *bundle){\n            NSURL *fileURL = [bundle URLForResource:name withExtension:@\"pem\"];\n            NSError *error = nil;\n            NSString *fileContent = [NSString stringWithContentsOfURL:fileURL encoding:NSUTF8StringEncoding error:&error];\n            if (error) {\n                NSLog(@\"%@ error: %@\", self.debugDescription, error);\n                return nil;\n            }\n            return fileContent;\n        };\n        NSBundle *bundle = [NSBundle bundleForClass:self.class];\n        NSString *publicPemKey = loadKey(publicPemFilename, bundle);\n        NSString *privatePemKey = loadKey(privatePemFilename, bundle);\n        \n        // sign and verify\n        {\n            NSString *algorithmName = @\"ES256\";\n            id <JWTAlgorithmDataHolderProtocol> signDataHolder = [JWTAlgorithmRSFamilyDataHolder new].keyExtractorType([JWTCryptoKeyExtractor privateKeyWithPEMBase64].type).privateKeyCertificatePassphrase(passphrase).algorithmName(algorithmName).secret(privatePemKey);\n            \n            id <JWTAlgorithmDataHolderProtocol> verifyDataHolder = [JWTAlgorithmRSFamilyDataHolder new].keyExtractorType([JWTCryptoKeyExtractor publicKeyWithPEMBase64].type).algorithmName(algorithmName).secret(publicPemKey);\n            \n            NSDictionary *payloadDictionary = @{@\"hello\": @\"world\"};\n            \n            JWTCodingBuilder *signBuilder = [JWTEncodingBuilder encodePayload:payloadDictionary].addHolder(signDataHolder);\n            JWTCodingResultType *signResult = signBuilder.result;\n            NSString *token = nil;\n            if (signResult.successResult) {\n                // success\n                NSLog(@\"%@ success: %@\", self.debugDescription, signResult.successResult.encoded);\n                token = signResult.successResult.encoded;\n            }\n            else {\n                // error\n                NSLog(@\"%@ error: %@\", self.debugDescription, signResult.errorResult.error);\n            }\n            \n            // verify\n            if (token == nil) {\n                NSLog(@\"something wrong\");\n            }\n            \n            JWTCodingBuilder *verifyBuilder = [JWTDecodingBuilder decodeMessage:token].addHolder(verifyDataHolder);\n            JWTCodingResultType *verifyResult = verifyBuilder.result;\n            if (verifyResult.successResult) {\n                // success\n                NSLog(@\"%@ success: %@\", self.debugDescription, verifyResult.successResult.payload);\n                token = verifyResult.successResult.encoded;\n                NSLog(@\"%@ token: %@\", self.debugDescription, token);\n            }\n            else {\n                // error\n                NSLog(@\"%@ error: %@\", self.debugDescription, verifyResult.errorResult.error);\n            }\n        }\n    }];\n    [XCTContext runActivityNamed:@\"API should work well with Pem keys loading\" block:^(id<XCTActivity> _Nonnull activity){\n        NSString *privatePemFilename = @\"rs256-private\";\n        NSString *publicPemFilename = @\"rs256-public\";\n        NSString *passphrase = @\"password\";\n        NSString *(^loadKey)(NSString *, NSBundle *) = ^NSString *(NSString *name, NSBundle *bundle){\n            NSURL *fileURL = [bundle URLForResource:name withExtension:@\"pem\"];\n            NSError *error = nil;\n            NSString *fileContent = [NSString stringWithContentsOfURL:fileURL encoding:NSUTF8StringEncoding error:&error];\n            if (error) {\n                NSLog(@\"%@ error: %@\", self.debugDescription, error);\n                return nil;\n            }\n            return fileContent;\n        };\n        NSBundle *bundle = [NSBundle bundleForClass:self.class];\n        NSString *publicPemKey = loadKey(publicPemFilename, bundle);\n        NSString *privatePemKey = loadKey(privatePemFilename, bundle);\n\n        // sign and verify\n        {\n            NSString *algorithmName = @\"RS256\";\n            id <JWTAlgorithmDataHolderProtocol> signDataHolder = [JWTAlgorithmRSFamilyDataHolder new].keyExtractorType([JWTCryptoKeyExtractor privateKeyWithPEMBase64].type).privateKeyCertificatePassphrase(passphrase).algorithmName(algorithmName).secret(privatePemKey);\n\n            id <JWTAlgorithmDataHolderProtocol> verifyDataHolder = [JWTAlgorithmRSFamilyDataHolder new].keyExtractorType([JWTCryptoKeyExtractor publicKeyWithPEMBase64].type).algorithmName(algorithmName).secret(publicPemKey);\n\n            NSDictionary *payloadDictionary = @{@\"hello\": @\"world\"};\n\n            JWTCodingBuilder *signBuilder = [JWTEncodingBuilder encodePayload:payloadDictionary].addHolder(signDataHolder);\n            JWTCodingResultType *signResult = signBuilder.result;\n            NSString *token = nil;\n            if (signResult.successResult) {\n                // success\n                NSLog(@\"%@ success: %@\", self.debugDescription, signResult.successResult.encoded);\n                token = signResult.successResult.encoded;\n            }\n            else {\n                // error\n                NSLog(@\"%@ error: %@\", self.debugDescription, signResult.errorResult.error);\n            }\n\n            // verify\n            if (token == nil) {\n                NSLog(@\"something wrong\");\n            }\n\n            JWTCodingBuilder *verifyBuilder = [JWTDecodingBuilder decodeMessage:token].addHolder(verifyDataHolder);\n            JWTCodingResultType *verifyResult = verifyBuilder.result;\n            if (verifyResult.successResult) {\n                // success\n                NSLog(@\"%@ success: %@\", self.debugDescription, verifyResult.successResult.payload);\n                token = verifyResult.successResult.encoded;\n                NSLog(@\"%@ token: %@\", self.debugDescription, token);\n            }\n            else {\n                // error\n                NSLog(@\"%@ error: %@\", self.debugDescription, verifyResult.errorResult.error);\n            }\n        }\n    }];\n    [XCTContext runActivityNamed:@\"API should show work with chains moderate\" block:^(id<XCTActivity> _Nonnull activity){\n        JWTClaimsSet *claimsSet = [[JWTClaimsSet alloc] init];\n        // fill it\n        claimsSet.issuer = @\"Facebook\";\n        claimsSet.subject = @\"Token\";\n        claimsSet.audience = @\"https://jwt.io\";\n\n        // possible that your algorithm has several secrets.\n        // you don't know which secret to use.\n        // but you want to decode it.\n        NSString *firstSecret = @\"first\";\n        NSArray *manySecrets = @[@\"second\", @\"third\", @\"forty two\"];\n        // translate to data\n        NSArray *manySecretsData = @[];\n        for (NSString *secret in manySecrets) {\n            NSData *secretData = [JWTBase64Coder dataWithBase64UrlEncodedString:secret];\n            if (secret) {\n                manySecretsData = [manySecretsData arrayByAddingObject:secretData];\n            }\n        }\n\n        NSString *algorithmName = JWTAlgorithmNameHS384;\n\n        id <JWTAlgorithmDataHolderProtocol> firstHolder = [JWTAlgorithmHSFamilyDataHolder new].algorithmName(algorithmName).secret(firstSecret);\n\n        // lets create chain\n        JWTAlgorithmDataHolderChain *chain = [JWTAlgorithmDataHolderChain chainWithHolder:firstHolder];\n\n        // and lets populate chain with secrets.\n        NSLog(@\"chain has: %@\", chain.debugDescription);\n\n        JWTAlgorithmDataHolderChain *expandedChain = [chain chainByPopulatingAlgorithm:firstHolder.internalAlgorithm withManySecretData:manySecretsData];\n\n        // now we have expanded chain with many secrets and one algorithm.\n        NSLog(@\"expanded chain has: %@\", expandedChain.debugDescription);\n\n    }];\n    [XCTContext runActivityNamed:@\"API should show work with chains simple\" block:^(id<XCTActivity> _Nonnull activity){\n        JWTClaimsSet *claimsSet = [[JWTClaimsSet alloc] init];\n        // fill it\n        claimsSet.issuer = @\"Facebook\";\n        claimsSet.subject = @\"Token\";\n        claimsSet.audience = @\"https://jwt.io\";\n\n        // create token\n        NSString *token = @\"...\";\n\n        // possible that algorithm could return error.\n        // you could try use algorithm and data chain.\n\n        NSString *firstSecret = @\"first\";\n        NSString *firstAlgorithmName = JWTAlgorithmNameHS384;\n\n        id <JWTAlgorithmDataHolderProtocol> firstHolder = [JWTAlgorithmHSFamilyDataHolder new].algorithmName(firstAlgorithmName).secret(firstSecret);\n\n        id <JWTAlgorithmDataHolderProtocol> errorHolder = [JWTAlgorithmNoneDataHolder new];\n\n        // chain together.\n        JWTAlgorithmDataHolderChain *chain = [[JWTAlgorithmDataHolderChain alloc] initWithHolders:@[firstHolder, errorHolder]];\n\n        // or add them in builder\n        [JWTDecodingBuilder decodeMessage:token].addHolder(firstHolder).addHolder(errorHolder);\n\n        // or add them as chain\n        [JWTDecodingBuilder decodeMessage:token].chain(chain);\n    }];\n}\n\n- (void)testOthers {\n    [XCTContext runActivityNamed:@\"RS coding should work correctly\" block:^(id<XCTActivity> _Nonnull activity){\n        // Test example.\n        // Encode\n        NSDictionary *payload = @{@\"payload\" : @\"hidden_information\"};\n        NSString *algorithmName = @\"RS256\";\n        NSString *fileName = @\"Test certificate and private key 1\";\n\n        NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:fileName ofType:@\"p12\"];\n        NSData *privateKeySecretData = [NSData dataWithContentsOfFile:filePath];\n\n        NSString *passphraseForPrivateKey = @\"password\";\n\n        JWTBuilder *builder = [JWTBuilder encodePayload:payload].secretData(privateKeySecretData).privateKeyCertificatePassphrase(passphraseForPrivateKey).algorithmName(algorithmName);\n        NSString *token = builder.encode;\n\n        // check error\n        if (builder.jwtError) {\n            // error occurred.\n            NSLog(@\"%@ error occured while encoding: %@\", self, builder.jwtError);\n        }\n        else {\n            NSLog(@\"%@ token: %@\", self, token);\n        }\n        // Decode\n        // Suppose, that you get token from previous example. You need a valid public key for a private key in previous example.\n        // Private key stored in @\"secret_key.p12\". So, you need public key for that private key.\n\n        NSString *publicKey = @\"...\"; // load public key. Or use it as raw string.\n\n        // test example:\n        publicKey = @\"MIICnTCCAYUCBEReYeAwDQYJKoZIhvcNAQEFBQAwEzERMA8GA1UEAxMIand0LTIwNDgwHhcNMTQwMTI0MTMwOTE2WhcNMzQwMjIzMjAwMDAwWjATMREwDwYDVQQDEwhqd3QtMjA0ODCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKhWb9KXmv45+TKOKhFJkrboZbpbKPJ9Yp12xKLXf8060KfStEStIX+7dCuAYylYWoqiGpuLVVUL5JmHgXmK9TJpzv9Dfe3TAc/+35r8r9IYB2gXUOZkebty05R6PLY0RO/hs2ZhrOozHMo+x216Gwz0CWaajcuiY5Yg1V8VvJ1iQ3rcRgZapk49RNX69kQrGS63gzj0gyHnRtbqc/Ua2kobCA83nnznCom3AGinnlSN65AFPP5jmri0l79+4ZZNIerErSW96mUF8jlJFZI1yJIbzbv73tL+y4i0+BvzsWBs6TkHAp4pinaI8zT+hrVQ2jD4fkJEiRN9lAqLPUd8CNkCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAnqBw3UHOSSHtU7yMi1+HE+9119tMh7X/fCpcpOnjYmhW8uy9SiPBZBl1z6vQYkMPcURnDMGHdA31kPKICZ6GLWGkBLY3BfIQi064e8vWHW7zX6+2Wi1zFWdJlmgQzBhbr8pYh9xjZe6FjPwbSEuS0uE8dWSWHJLdWsA4xNX9k3pr601R2vPVFCDKs3K1a8P/Xi59kYmKMjaX6vYT879ygWt43yhtGTF48y85+eqLdFRFANTbBFSzdRlPQUYa5d9PZGxeBTcg7UBkK/G+d6D5sd78T2ymwlLYrNi+cSDYD6S4hwZaLeEK6h7p/OoG02RBNuT4VqFRu5DJ6Po+C6JhqQ==\";\n\n        algorithmName = @\"RS256\";\n\n        JWTBuilder *decodeBuilder = [JWTBuilder decodeMessage:token].secret(publicKey).algorithmName(algorithmName);\n        NSDictionary *envelopedPayload = decodeBuilder.decode;\n\n        // check error\n        if (decodeBuilder.jwtError) {\n            // error occurred.\n            NSLog(@\"%@ error occured while decoding %@\", self,decodeBuilder.jwtError);\n        }\n        else {\n            NSLog(@\"%@ envelopedPayload: %@ \", self, envelopedPayload);\n        }\n    }];\n    [XCTContext runActivityNamed:@\"fluent example should work correctly\" block:^(id<XCTActivity> _Nonnull activity){\n        // suppose, that you create ClaimsSet\n        JWTClaimsSet *claimsSet = [[JWTClaimsSet alloc] init];\n        // fill it\n        claimsSet.issuer = @\"Facebook\";\n        claimsSet.subject = @\"Token\";\n        claimsSet.audience = @\"https://jwt.io\";\n\n        // encode it\n        NSString *secret = @\"secret\";\n        NSString *algorithmName = @\"HS384\";\n        NSDictionary *headers = @{@\"custom\":@\"value\"};\n        JWTBuilder *encodeBuilder = [JWT encodeClaimsSet:claimsSet];\n        NSString *encodedResult = encodeBuilder.secret(secret).algorithmName(algorithmName).headers(headers).encode;\n\n        if (encodeBuilder.jwtError) {\n            // handle error\n            NSLog(@\"encode failed, error: %@\", encodeBuilder.jwtError);\n        }\n        else {\n            // handle encoded result\n            NSLog(@\"encoded result: %@\", encodedResult);\n        }\n\n        // decode it\n        // you can set any property that you want, all properties are optional\n        JWTClaimsSet *trustedClaimsSet = [claimsSet copy];\n\n        // decode forced ? try YES\n        BOOL decodeForced = NO;\n        NSNumber *options = @(decodeForced);\n        NSString *yourJwt = encodedResult; // from previous example\n        NSString *yourSecret = secret; // from previous example\n        JWTBuilder *decodeBuilder = [JWT decodeMessage:yourJwt];\n        NSDictionary *decodedResult = decodeBuilder.message(yourJwt).secret(yourSecret).claimsSet(trustedClaimsSet).options(options).decode;\n        if (decodeBuilder.jwtError) {\n            // handle error\n            NSLog(@\"decode failed, error: %@\", decodeBuilder.jwtError);\n        }\n        else {\n            // handle decoded result\n            NSLog(@\"decoded result: %@\", decodedResult);\n        }\n    }];\n}\n\n- (void)testReadme {\n    [self testVersionThree];\n    [self testOthers];\n}\n\n@end\n"
  },
  {
    "path": "Tests/JWTTests/Tests/JWTCoding/JWTCodingTests.m",
    "content": "//\n//  JWTCodingTests.m\n//  \n//\n//  Created by Dmitry Lobanov on 06.02.2022.\n//\n\n#import <XCTest/XCTest.h>\n@import JWT;\n\n@interface JWTCodingTests : XCTestCase\n\n@end\n\n@implementation JWTCodingTests\n\n- (void)setUp {\n    // Put setup code here. This method is called before the invocation of each test method in the class.\n}\n\n- (void)tearDown {\n    // Put teardown code here. This method is called after the invocation of each test method in the class.\n}\n\n- (void)testJWTCodingBuilderShouldEncode {\n    __auto_type expectedToken = @\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ\";\n    __auto_type secret = @\"secret\";\n    __auto_type payload = @{\n        @\"sub\": @\"1234567890\",\n        @\"name\": @\"John Doe\",\n        @\"admin\": @(YES),\n    };\n    \n    __auto_type holder = [JWTAlgorithmHSFamilyDataHolder new].algorithmName(JWTAlgorithmNameHS256).secret(secret);\n    __auto_type result = [JWTEncodingBuilder encodePayload:payload].addHolder(holder).result;\n    XCTAssertNotNil(result.successResult);\n//    XCTAssertEqualObjects(result.successResult.encoded, expectedToken);\n    XCTAssertNil(result.errorResult);\n}\n\n\n- (void)testJWTCodingBuilderShouldDecode {\n    __auto_type token = @\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ\";\n    __auto_type secret = @\"secret\";\n    __auto_type expectedHeaders = @{\n        @\"typ\": @\"JWT\",\n        @\"alg\": @\"HS256\"\n    };\n    __auto_type expectedPayload = @{\n        @\"admin\": @(1),\n        @\"name\": @\"John Doe\",\n        @\"sub\": @\"1234567890\"\n    };\n    \n    __auto_type holder = [JWTAlgorithmHSFamilyDataHolder new].algorithmName(JWTAlgorithmNameHS256).secret(secret);\n    __auto_type result = [JWTDecodingBuilder decodeMessage:token].addHolder(holder).result;\n    XCTAssertNotNil(result.successResult);\n    XCTAssertEqualObjects(result.successResult.headers, expectedHeaders);\n    XCTAssertEqualObjects(result.successResult.payload, expectedPayload);\n    XCTAssertNil(result.errorResult);\n}\n\n@end\n"
  },
  {
    "path": "Tests/JWTTests/include/JWTAssetAccessor.h",
    "content": "//\n//  JWTAssetAccessor.h\n//  Tests\n//\n//  Created by Dmitry Lobanov on 05.01.2022.\n//\n\n#import <Foundation/Foundation.h>\n#import <XCTest/XCTest.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n@interface JWTAssetAccessor : NSObject\n@property (copy, nonatomic, readwrite) NSString *folder;\n- (instancetype)initWithFolder:(NSString *)folder;\n- (instancetype)initWithAlgorithmType:(NSString *)type shaSize:(NSNumber *)size;\n- (instancetype)initWithAlgorithName:(NSString *)name;\n@end\n\n@interface JWTAssetAccessor (Validation)\n- (nullable instancetype)checked;\n- (BOOL)check;\n@end\n\n@interface JWTAssetAccessor (FolderAccess)\n- (NSString *)stringFromFileWithName:(NSString *)name;\n- (NSData *)dataFromFileWithName:(NSString *)name;\n@end\n\n@interface JWTAssetAccessor (Getters)\n@property (copy, nonatomic, readonly) NSString *privateKeyBase64;\n@property (copy, nonatomic, readonly) NSString *publicKeyBase64;\n@property (copy, nonatomic, readonly) NSString *certificateBase64;\n@property (copy, nonatomic, readonly) NSData *p12Data;\n@property (copy, nonatomic, readonly) NSString *p12Password;\n@end\n\nNS_ASSUME_NONNULL_END\n"
  },
  {
    "path": "VERSION",
    "content": "3.0.0-beta.14"
  }
]