Вопрос

Following the documentation noted in the wiki, I'm trying to use the KeyczarTool to generate new keyset. Anyone else come across this FileNotFoundException? The KeyczarTool.jar has rwx permissions and tried running via sudo.

From docs

Command Usage:
create --location=/path/to/keys --purpose=(crypt|sign) [--name="A name"] [--asymmetric=(dsa|rsa|ec)]
    Creates a new, empty key set in the given location.
    This key set must have a purpose of either "crypt" or "sign"
    and may optionally be given a name. The optional version 
    flag will generate a public key set of the given algorithm.
    The "dsa" and "ec" asymmetric values are valid only for sets
    with "sign" purpose.

Cmd:

$ java -jar KeyczarTool-0.71f-060112.jar create --location=/keys  --purpose=crypt -name="first key" --asymmetric=rsa   

output:

org.keyczar.exceptions.KeyczarException: Unable to write to: /keys/meta 
    at org.keyczar.KeyczarTool.create(KeyczarTool.java:366)
    at org.keyczar.KeyczarTool.main(KeyczarTool.java:123)
Caused by: java.io.FileNotFoundException: /keys/meta (No such file or directory)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
    at org.keyczar.KeyczarTool.create(KeyczarTool.java:362)
    ... 1 more
Это было полезно?

Решение 2

As @jbtule kindly pointed out you must create the keys dir first. But also include . before the slash.

Correct working command is: $ java -jar KeyczarTool-0.71f-060112.jar create --location=./keys --purpose=crypt -name="first key" --asymmetric=rsa

Другие советы

With the current version of java keyczar the directory "keys" needs to be created first before running the program.

This is a known issue KeyczarTool should create directories automatically.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top