I can use the Vault CLI to successfully write the contents of a crt file as a secret to the generic backend. I can then get the secret from Vault with the CLI and pipe it to a file. A diff shows a perfect match. Here are the commands used:
vault write -field=data -format=raw bmsec/rawcrt data=@/home/myid/test/mycrt.crt
vault read -field=data bmsec/rawcrt > /home/myid/test/rawcrt.crt
However when I try use the Vault API to write the contents of a crt file as a secret to the generic backend I get an error. The curl command used is:
curl -v -X POST '
http://my.system:8200/v1/bmsec/rawcrt?format=raw;field=data' -H 'Content-Type: text/plain' -H 'x-vault-token: f67a7169-c730-7cbf-ddf0-850256ad94a1' -d @/home/myid/test/mycrt.crt
The error reported is:
{"errors":["failed to parse JSON input: invalid character '-' in numeric literal"]}
Is the usage/syntax incorrect, or does the API not support the "raw" parameter?
Thanks for any help.