Comments (3)
Sorry, I don't understand what you mean by a "valid advertisement payload". The files that are generated by tang are done in the way you specified.
Apart from that, tang uses a SHA mechanism to get the file names used by tang. This is done by using "jose jwk thp"
But the content is generated similarly to the way you specified.
If you check the file ./src/tangd-rotate-keys.in
, you can check how the keys are rotated (which in the end is a move + new key generation):
DEFAULT_THP_HASH="S256"
for alg in "ES512" "ECMR"; do
json="$(printf '{"alg": "%s"}' "${alg}")"
jwe="$(jose jwk gen --input "${json}")"
thp="$(printf '%s' "${jwe}" | jose jwk thp --input=- \
-a "${DEFAULT_THP_HASH}")"
echo "${jwe}" > "${thp}.jwk"
set_perms "${thp}.jwk"
log "Created new key ${thp}.jwk" "${VERBOSE}"
done
As you can see, "jose jwk gen --input" is used (similar to what you posted), and the file name is calculated passing that output to "jose jwk thp --input=- -a S256"
Hope this helps
from tang.
@sarroutbi Thank you for your reply!
Sorry, I don't understand what you mean by a "valid advertisement payload".
Sorry, my explanation was probably not detailed enough. I am trying to generate the keys offline as well as what is returned by "http://<TANG_URL>/adv" with jose so that I would be able to use clevis with the tang pin even before the tang server was created.
If you check the file ./src/tangd-rotate-keys.in, you can check how the keys are rotated (which in the end is a move + new key generation):
Thanks for that pointer about the file names!
from tang.
I've figured it out. The advertisement seems to be a payload of the form { "keys": [<signing-public-key>, <exchange-public-key>] }
that is signed with the signing private key. The public keys can be derived from the keys in /var/db/tang
, e.g., cat <keyfile> | jose jwk pub -i - -o -
and the payload can then be signed, e.g. echo "${payload}" | jose jws sig -k <priv-sig-keyfile> -I - -o -
. The output should be valid to use with clevis with the "adv" field to make offline encryption work.
from tang.
Related Issues (20)
- "Not on the same physical medium" security requirement for Tang server and clients HOT 1
- Tang server does not deliver keys HOT 12
- README.md: 404 on link to Docker container HOT 5
- Tang running in standalone mode is leaving defunct processes after each request is served
- Release version 13
- Include parameter to change URL path prefix where server is listening
- Fedora rawhide container failing due to issues on dnf.conf format HOT 2
- Similar protocol with proof HOT 3
- Github actions related to code (build, coverage) should not be executed on documentation changes
- Release version 14
- [minor] Check for ss before testing
- tang doesn't reply HOT 6
- [minor] Please also set group in service file
- RFE: Logging?
- Few problems building from v11 source
- Tang doesn't close socket if error occured? HOT 3
- RFE: support arduino build HOT 4
- Reference academic publication of algorithm HOT 3
- Update documentation for 'optional' configurations (SSL/TLS & Authentication)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tang.