Latest 1.0.1
Homepage https://github.com/insidegui/GRCodeSignatureVerifier
License BSD
Platforms osx 10.11, requires ARC
Authors

Simple code signature verification for OS X apps.

GRCodeSignatureVerifier can be used to check if an app has been tampered with by verifying It’s code signature.

See demo app to learn more.

Read the docs.

Example

Swift

let verifier = GRCodeSignatureVerifier.sharedInstance()

// requirements are optional, but they make the verification stronger
verifier.codeRequirements = "identifier = "com.yourcompany.AppName""

if !verifier.isSignatureValid {
    NSLog("The app was modified. Exiting... (verifier.validationError)")
    exit(1)
}

Objective-C

GRCodeSignatureVerifier *verifier = [GRCodeSignatureVerifier sharedInstance];

verifier.codeRequirements = @"identifier = "com.yourcompany.AppName"";

if (!verifier.isSignatureValid) {
    NSLog("The app was modified. Exiting... %@", verifier.validationError);
    exit(1);
}

Precompiled code requirements

You can use the tool csreq to compile code requirements:

$ csreq -r requirements.txt -b requirements.bin

To use precompiled code requirements you set the codeRequirementsData property:

verifier.codeRequirementsData = [NSData dataWithContentsOfFile:@"/path/to/requirements.bin"];

To learn more about what are code requirements and the code requirements language, check out this document from Apple.

Installing

Using CocoaPods:

Add a Podfile that contains at least the following information to the root of your app project, then do pod install.
If you’re unfamiliar with CocoaPods, read using CocoaPods.

platform :osx, "10.11"
pod 'GRCodeSignatureVerifier'
use_frameworks!

Manually

Framework

Just download the code and add GRCodeSignatureVerifier.framework to the Embedded Binaries section of your app’s target config.

Directly

Alternatively, you can just drop GRCodeSignatureVerifier.h and GRCodeSignatureVerifier.m in your app and use It directly.

❤️

Flattr this git repo

Latest podspec

{
    "name": "GRCodeSignatureVerifier",
    "version": "1.0.1",
    "summary": "GRCodeSignatureVerifier can be used to check if an app has been tampered with by verifying It's code signature.",
    "description": "Simple code signature verification for OS X apps.nnGRCodeSignatureVerifier can be used to check if an app has been tampered with by verifying It's code signature.nn[See demo app to learn more](https://github.com/insidegui/GRCodeSignatureVerifierDemo).",
    "homepage": "https://github.com/insidegui/GRCodeSignatureVerifier",
    "license": "BSD",
    "authors": {
        "Guilherme Rambo": "[email protected]"
    },
    "source": {
        "git": "https://github.com/insidegui/GRCodeSignatureVerifier.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "osx": "10.11"
    },
    "requires_arc": true,
    "source_files": "GRCodeSignatureVerifier/*.{h,m}"
}

Pin It on Pinterest

Share This