Add a simple command line tool to interact with the keystore.

The app is yet almost empty but will gradually grow to include
enumeration and possibly modification functions for the keystore.
This commit is contained in:
Michael Lotz
2013-03-05 10:59:52 -05:00
committed by Ryan Leavengood
parent c494c06109
commit 05480477ff
2 changed files with 38 additions and 0 deletions
+1
View File
@@ -88,6 +88,7 @@ StdBinCommands
draggers.cpp
ffm.cpp
iroster.cpp
keystore.cpp
listattr.cpp
listfont.cpp
listres.cpp
+37
View File
@@ -0,0 +1,37 @@
/*
* Copyright 2012, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Michael Lotz, [email protected]
*/
#include <KeyStore.h>
#include <stdio.h>
int
main(int argc, char* argv[])
{
BKeyStore keyStore;
BPasswordKey password;
uint32 cookie = 0;
while (true) {
printf("trying to get next password with cookie: %" B_PRIu32 "\n",
cookie);
status_t result = keyStore.GetNextKey(B_KEY_TYPE_PASSWORD,
B_KEY_PURPOSE_ANY, cookie, password);
if (result != B_OK) {
printf("failed with: %s\n", strerror(result));
break;
}
password.PrintToStream();
}
return 0;
}