unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ben Key <bkey76@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: tzz@lifelogs.com, Emacs-devel@gnu.org
Subject: Re: Modifying Emacs to use the Mac OS X Keychain Services
Date: Sat, 28 May 2011 12:16:53 -0500	[thread overview]
Message-ID: <BANLkTinDu__i+kU6AsCrutY2O0z5YthUPg@mail.gmail.com> (raw)
In-Reply-To: <87aae67v6e.fsf@gmx.de>

[-- Attachment #1: Type: text/plain, Size: 2591 bytes --]

Michael Albinus <michael.albinus@gmx.de> wrote:

> I'm not using OS X, could you, please, send me a pointer to the Keychain
> Services API?
>
>
Some information on the Keychain Services API can be found at the Keychain
Services Tasks for Mac OS X page found at
http://developer.apple.com/library/mac/#documentation/Security/Conceptual/keychainServConcepts/03tasks/tasks.html.
More detailed information can be found at the Keychain Services Reference
page found at
http://developer.apple.com/library/mac/#documentation/Security/Reference/keychainservices/Reference/reference.html
.

While the Keychain Services API does not exactly mirror the
org.freedesktop.secrets interface it is possible to implement the same
concepts expressed in secrets.el via the Keychain Services API.  For
example, a ns-secrets-create-item function could be easily defined that has
the same parameters as secrets-create-item.  This function would use
SecKeychainOpen to open the keychain specified by the collection parameter,
and if the call to SecKeychainOpen failed, it could use SecKeychainCreate to
create the specified keychain.  It then could use
SecKeychainAddGenericPassword to add the item specified by the item
parameter with the password specified by the password parameter, to the
opened or newly created keychain.  The attributes parameter could be
processed by calling SecKeychainItemModifyAttributesAndData.

The ns-secrets-delete-item, ns-secrets-get-secret, and
ns-secrets-get-attributes functions could also be written similarly.  I am
not certain about the other functions, mainly because I have not yet
finished my research.

The point is, I can implement ns- equivalents in C for most, if not all of
the functions defined in secrets.el with the same parameters and nearly the
same behavior.  I may even be able to make them behave exactly the same as
their secrets.el counterparts.

Once the functions are defined in C, we can later decide how to call them
from Lisp.  We can decide to call them from secrets.el by having each of the
functions use the following psudeo code

(if (fboundp 'ns-{func})
  call ns-{func}
use dbus)

or we could add another auth source to auth-source.el.  Either way would
work for me.

Perhaps I should just focus on writing the ns- equivalents of each of the
secrets.el functions and we can decide later how to call them.  What do you
think?

Note: I am not exactly certain how to parse the attributes parameter of my
proposed ns-secrets-create-item function.  If someone can point me to an
example of how to process something like that in C it would be helpful.

[-- Attachment #2: Type: text/html, Size: 3272 bytes --]

  reply	other threads:[~2011-05-28 17:16 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-28  2:56 Modifying Emacs to use the Mac OS X Keychain Services Ben Key
2011-05-28 11:09 ` Michael Albinus
2011-05-28 13:00   ` Ben Key
2011-05-28 14:32     ` Michael Albinus
2011-05-28 17:16       ` Ben Key [this message]
2011-05-28 18:13         ` Ted Zlatanov
2011-05-28 19:38         ` Michael Albinus
2011-05-28 15:11     ` Ted Zlatanov
  -- strict thread matches above, loose matches on Subject: below --
2011-05-28 18:32 Ben Key
2011-05-30  1:08 Ben Key
2011-05-30  1:19 ` Daniel Colascione
2011-05-30 12:27 ` Ted Zlatanov
2011-06-01  2:04 Ben Key
2011-06-01  2:13 ` Ted Zlatanov
2011-06-05 18:54 ` Ben Key
2011-06-05 20:01   ` Ted Zlatanov
2011-06-06 20:26   ` Michael Albinus
2011-06-07  3:34     ` Ben Key
2011-06-07  7:58       ` Michael Albinus
     [not found]         ` <BANLkTin1DxY33iaQ5=9KJKD_gwQvsJwJ8Q@mail.gmail.com>
2011-06-08  5:50           ` Ben Key
2011-06-08 20:48             ` Ted Zlatanov
2012-07-27 15:20               ` Dave Abrahams
2012-07-28 12:16                 ` Harald Hanche-Olsen
2012-07-28 16:33                   ` Dave Abrahams
2012-07-28 16:45                     ` Harald Hanche-Olsen
2012-07-29 22:05                 ` Ted Zlatanov
2012-07-30 13:34                   ` Michael Albinus
2012-07-31 15:45                     ` Ted Zlatanov
2012-08-20 13:42                   ` Dave Abrahams
2012-08-20 13:49                   ` Dave Abrahams
2012-08-20 14:02                     ` Dave Abrahams
2011-06-05 23:23 Ben Key
2011-06-06  0:05 ` Ted Zlatanov
2011-06-11  0:30 Ben Key
2011-06-11  1:13 ` Ted Zlatanov
2011-06-12  2:28 Ben Key
2011-06-12  4:18 ` Ben Key
2011-06-12 16:40   ` Eli Zaretskii
2011-06-12 22:23     ` Ted Zlatanov
2011-06-13  3:14     ` Ben Key
2011-06-14  3:12   ` Stefan Monnier
2011-06-15  2:15     ` Ben Key
2011-06-15 15:12       ` Ted Zlatanov
2011-06-15 16:30         ` Andreas Schwab
2011-06-15 20:02           ` Ted Zlatanov
2011-06-15 23:26         ` Stefan Monnier
2011-06-17 20:31           ` Chong Yidong
2011-06-12 22:21 ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTinDu__i+kU6AsCrutY2O0z5YthUPg@mail.gmail.com \
    --to=bkey76@gmail.com \
    --cc=Emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=tzz@lifelogs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).