-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Password decrypt the --root-key-file
#433
Comments
@tegefaulkes this has been created now. |
The
It should be similar to During our crypto swap over, I'd want to make it so that domains don't rely on the existence of |
The root key file is assumed to be a PEM, but with the new crypto update, we are going to be using JWKs mostly. We may expect the root key to be in JWK format or in PCKS#8 format. I think for now, we will only support JWK format. |
Note that our webcrypto polyfill can load pkcs#8 format too, so we can support whatever format that webcrypto can import from. We could also use JOSE too. |
Encrypted JWK would be using the PBES2... algorithm. |
So by dropping node forge, we end up dropping support for PKCS#8 and SPKI mostly. We won't really be dealing with those formats anymore. Even @peculiar/x509 and @peculiar/PKI doesn't really have all the support necessary. And we are only using |
The All the utilities to deal with this are now in This means any loading/decrypting of the private key must be done on the outside of There are a number of ways to acquire a hardcoded private key. In particular That will be the only one we would support for now. |
We can incorporate this into the Then if the private key is set, but it's a string, and not a Then if we load from disk, we have decide what format we expect it to be. The only format we would expect is an encrypted JWE or a JWK. Furthermore a password is then expected to be used for decryption here. We can reuse the password for this. To decrypt JWE however, we then have to use JOSE for this, and this means using the webcrypto interface, because there are so many different JWE and different ways of decrypting them. We may limit these algorithms specifically to our own version of JWE ( Ultimately the usecase here is primarily for debugging/testing, so that we can launch PK with a specific private key instead of using a recovery code. It could be useful if someone has the private key and password, but lost the recovery code. Our tests are unlikely to be using this now. So let's just do the simplest thing. Expect to use |
This is now implemented in #446. However we are not taking a password pem encryption. We are using our own JWE algorithm. |
Specification
The
--root-key-file
orPK_ROOT_KEY
may be password encrypted. Theagent start
andbootstrap
commands should check if the PEM is encrypted, and decrypt it with the--password
. This means the same--password
is used to decrypt (if encrypted) and to encrypt the root key.This is important in case the root key is loaded from another PK node path. Or just generated in some other way.
Additional context
--root-key-file
was brought inTasks
The text was updated successfully, but these errors were encountered: