Latest 1.9
Homepage https://github.com/google/macops-molcertificate
License Apache
Platforms osx 10.9
Frameworks Security
Authors

Objective-C wrapper around SecCertificateRef with caching accessors.

Requires ARC. Tested on OS X 10.9+.

Usage


#import <MOLCertificate/MOLCertificate.h>

- (MOLCertificate *)certificateFromFile:(NSString *)filePath {
  NSData *fileData = [NSData dataWithContentsOfFile:filePath];
  return [[MOLCertificate alloc] initWithCertificateDataPEM:fileData];
}

- (BOOL)validateCertificate:(MOLCertificate *)cert {
  if ([cert.validFrom compare:[NSDate date]) == NSOrderedDescending) {
    NSLog(@"Certificate has expired");
    return NO;
  }

  if (! [cert.commonName isEqual:@"My Certificate"]) {
    NSLog(@"Certificate is not named the way I expected");
    return YES;
  }

  if (! [cert.countryName isEqual:@"US"]) {
    NSLog(@"This certificate is very un-American.");
  }
}

Installation

Install using CocoaPods.

pod 'MOLCertificate'

You can also import the project manually but this isn’t tested.

Documentation

Reference documentation is at CocoaDocs.org:

http://cocoadocs.org/docsets/MOLCertificate

Contributing

Patches to this library are very much welcome.
Please see the CONTRIBUTING file.

Latest podspec

{
    "name": "MOLCertificate",
    "version": "1.9",
    "platforms": {
        "osx": "10.9"
    },
    "license": {
        "type": "Apache",
        "file": "LICENSE"
    },
    "homepage": "https://github.com/google/macops-molcertificate",
    "authors": {
        "Google Macops": "[email protected]"
    },
    "summary": "Objective-C wrapper around SecCertificateRef",
    "source": {
        "git": "https://github.com/google/macops-molcertificate.git",
        "tag": "v1.9"
    },
    "source_files": "Source/MOLCertificate/MOLCertificate.{h,m}",
    "frameworks": "Security"
}

Pin It on Pinterest

Share This