tpm2-software / tpm2-tss-engine

OpenSSL Engine for TPM2 devices
https://tpm2-software.github.io
BSD 3-Clause "New" or "Revised" License
148 stars 97 forks source link

Extend key -read and -write functions #279

Open chris2511 opened 9 months ago

chris2511 commented 9 months ago

If an existing key or the new key is not intended to be stored in a file, the current implementation requires the creation of temporary files with all its odds (cleanup, symlink attack, mktemp)

This change allows to provide the key in many different ways:

A filename of "-" translates to for reading and for writing.

If the file named by "filename" does not exist, check whether it contains a "-----BEGIN" and try interpreting the filename itself as key.

Extend documentation in README.md