Skip to content

Instantly share code, notes, and snippets.

@floehopper
Created September 25, 2009 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floehopper/193418 to your computer and use it in GitHub Desktop.
Save floehopper/193418 to your computer and use it in GitHub Desktop.
require 'osx/cocoa'
include OSX
OSX.load_bridge_support_file('/path/to/Security.bridgesupport')
def create_access(access_label)
err, myself = SecTrustedApplicationCreateFromPath(nil)
err, some_other = SecTrustedApplicationCreateFromPath('/Applications/Mail.app')
trusted_apps = NSArray.arrayWithObjects(myself, some_other, nil)
err, access = SecAccessCreate(access_label, trusted_apps)
return nil unless err == 0
return access
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment