Project: Update MODULE rename of MOLCertificate (#18)
Provides an easy way to do code signature validation in Objective-C
#import <MOLCertificate/MOLCertificate.h> #import <MOLCodesignChecker/MOLCodesignChecker.h> - (BOOL)validateMySignature { MOLCodesignChecker *csInfo = [[MOLCodesignChecker alloc] initWithSelf]; if (csInfo) { // I'm signed! Check the certificate NSLog(@"%@, %@", csInfo.leafCertificate, csInfo.leafCertificate.SHA256); return YES; } return NO; } - (BOOL)validateFile:(NSString *)filePath { MOLCodesignChecker *csInfo = [[MOLCodesignChecker alloc] initWithBinaryPath:filePath]; if (csInfo) { // I'm signed! Check the certificate NSLog(@"%@, %@", csInfo.leafCertificate, csInfo.leafCertificate.SHA256); return YES; } return NO; }
Add the following to your MODULE.bazel:
bazel_dep("molcodesignchecker", version = "3.0") git_override( module_name = "molcodesignchecker", remote = "https://github.com/google/macops-molcodesignchecker.git", tag = "v3.0", )
Add the following to your WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") git_repository( name = "MOLCodesignChecker", remote = "https://github.com/google/macops-molcodesignchecker.git", tag = "v3.0", )
In your BUILD file, add MOLCodesignChecker as a dependency:
objc_library( name = "MyAwesomeApp_lib", srcs = ["src/MyAwesomeApp.m", "src/MyAwesomeApp.h"], deps = ["@molcodesignchecker//:MOLCodesignChecker"], )
Patches to this library are very much welcome. Please see the CONTRIBUTING file.
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
MOLCodesignChecker
Provides an easy way to do code signature validation in Objective-C
Usage
Installation
Using Bazel Modules
Add the following to your MODULE.bazel:
Using Bazel WORKSPACE
Add the following to your WORKSPACE:
Adding dependency in BUILD
In your BUILD file, add MOLCodesignChecker as a dependency:
objc_library( name = "MyAwesomeApp_lib", srcs = ["src/MyAwesomeApp.m", "src/MyAwesomeApp.h"], deps = ["@molcodesignchecker//:MOLCodesignChecker"], )Contributing
Patches to this library are very much welcome. Please see the CONTRIBUTING file.