On Sun, Jan 28, 2007 at 02:08:22PM +0900, Daniel B. wrote:
I’ve been using dbi-dbrc to store database login/passwords in the past,
but they aren’t encrypted (just protected via perms). I may have to use
this if the API is friendly (I’ve only looked at the demo so far).
I think the documentation for Keybox is pretty good, but feel free to
call me on it. Its all on the website as rdoc, You’ll probably want to
look at the Storage::Container documentation.
Here’s a quick script to give you an idea of what you could do to roll
your own encrypted storage container using keybox.
% cat embedded_container.rb
PASSPHRASE = "passphrase"
DB_PATH = "/tmp/database.yaml"
container = Storage::Container.new(PASSPHRASE,DB_PATH)
# use the already existing HostAccountEntry
container << HostAccountEntry.new("My DB Login",
"a really good password")
# pretend we're in a different part of a program, or another program
c2 = Storage::Container.new(PASSPHRASE,DB_PATH)
# iterate over results
c2.find("example").each do |c|
puts "=" * 20
# or we just now we want the first one found
Let me know if you have any specific questions or approaches. And if
you have some requests for specific API’s or functionality let me know.
And patches are always good.