Sha256: 748751c82ced616bd14280d9c3a0cf33414388b477a6bc5c0cfaede82a1a5f7a

Contents?: true

Size: 632 Bytes

Versions: 5

Compression:

Stored size: 632 Bytes

Contents

module Xcode
  class Keychain
    def initialize(path)
      @path = File.expand_path path
    end
    
    def import(cert, password)
      cmd = []
      cmd << "security"
      cmd << "import '#{cert}'"
      cmd << "-k #{@path}"
      cmd << "-P #{password}"
      cmd << "-T /usr/bin/codesign"
      Xcode::Shell.execute(cmd)
    end
    
    def unlock(password)
      cmd = []
      cmd << "security"
      cmd << "unlock-keychain #{@path}"
      cmd << "-p #{password}"
      Xcode::Shell.execute(cmd)
    end
    
    def self.login_keychain
      Xcode::Keychain.new("~/Library/Keychains/login.keychain")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
xcoder-0.0.15 lib/xcode/keychain.rb
xcoder-0.0.14 lib/xcode/keychain.rb
xcoder-0.0.12 lib/xcode/keychain.rb
xcoder-0.0.11 lib/xcode/keychain.rb
xcoder-0.0.10 lib/xcode/keychain.rb