def import(input, app_list=[])
      input = input.read if input.is_a? IO

      # Create array of TrustedApplication objects
      trusted_apps = get_trusted_apps(app_list)

      # Create an Access object
      access_buffer = FFI::MemoryPointer.new(:pointer)
      status = Sec.SecAccessCreate(path.to_cf, trusted_apps, access_buffer)
      Sec.check_osstatus status
      access = CF::Base.typecast(access_buffer.read_pointer)

      key_params = Sec::SecItemImportExportKeyParameters.new
      key_params[:accessRef] = access

      # Import item to the keychain
      cf_data = CF::Data.from_string(input).release_on_gc
      cf_array = FFI::MemoryPointer.new(:pointer)
      status = Sec.SecItemImport(cf_data, nil, :kSecFormatUnknown, :kSecItemTypeUnknown, :kSecItemPemArmour, key_params, self, cf_array)
      access.release
      Sec.check_osstatus status
      item_array = CF::Base.typecast(cf_array.read_pointer).release_on_gc

      item_array.to_ruby
    end
def import(input, app_list=[])
      input = input.read if input.is_a? IO

      # Create array of TrustedApplication objects
      trusted_apps = get_trusted_apps(app_list)

      # Create an Access object
      access_buffer = FFI::MemoryPointer.new(:pointer)
      status = Sec.SecAccessCreate(path.to_cf, trusted_apps, access_buffer)
      Sec.check_osstatus status
      access = CF::Base.typecast(access_buffer.read_pointer)

      key_params = Sec::SecItemImportExportKeyParameters.new
      key_params[:accessRef] = access

      # Import item to the keychain
      cf_data = CF::Data.from_string(input).release_on_gc
      cf_array = FFI::MemoryPointer.new(:pointer)
      status = Sec.SecItemImport(cf_data, nil, :kSecFormatUnknown, :kSecItemTypeUnknown, :kSecItemPemArmour, key_params, self, cf_array)
      access.release
      Sec.check_osstatus status
      item_array = CF::Base.typecast(cf_array.read_pointer).release_on_gc

      item_array.to_ruby
    end
Imports item from string or file to this keychain

 @param [IO, String] input IO object or String with raw data to import
 @param [Array <String>] app_list List of applications which will be
 permitted to access imported items
 @return [Array <SecKeychainItem>] List of imported keychain objects,
 each of which may be a SecCertificate, SecKey, or SecIdentity instance