Re: json help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/08/2021 15:34, JT Morée wrote:
> I am back to working with json data now that 2.4.0 is closer to
> release. I am using source clone cloned from gitlab to get the latest
> features but not able to get some commands to work.

JSON format is defined in LUKS2 doc, there is no change in 2.4.0, we are just
adding API for external shared library.
 
> If I'm reading the latest man page properly these commands should
> import json data into the header but it always fails for me.

Yes, but also read LUKS2 speciofication (in /docs), section 3.6 that describes token object.

While it can store arbitrary JSON metadata, there are mandatory fields (type, keyslots array)

If you are using direct JSON API (token import), these fields must be present.

Try

  echo '{ "type" : "blah" , "keyslots" : [ ], "foo" : "bar" }' |  ./cryptsetup token import /dev/sdb --key-slot 0

Type is you name for this token type, keyslots is then assigned according to parameters on commandline.

Also if something fails, try --debug, in your case:

...
# STDIN descriptor JSON read requested.
# Updating JSON for token -1.
# Token "0" is missing "type" (string) specification.
Failed to import token from file.

So it should give you a hint.

Milan
_______________________________________________
dm-crypt mailing list -- dm-crypt@xxxxxxxx
To unsubscribe send an email to dm-crypt-leave@xxxxxxxx




[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux