Skip to content

Commit 3965aa9

Browse files
committed
document the new key probabilities in README.md
Signed-off-by: Andreas Schmid <[email protected]>
1 parent ccd46a5 commit 3965aa9

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ class Taskwarrior {
8989
Used `taskwarrior.properties` can be created by copying and adjusting
9090
[`src/main/resources/taskwarrior.properties.template`](https://github.com/aaschmid/taskwarrior-java-client/tree/master/src/main/resources/taskwarrior.properties.template).
9191

92-
9392
Testing
9493
-------
9594

@@ -99,18 +98,29 @@ To run tests manually you will need to build and run taskwarrior server containe
9998
Keys formats
10099
------------
101100

102-
Unfortunately Java only has an encoded key spec for a private key in [PKCS#8](https://en.wikipedia.org/wiki/PKCS_8)
103-
format. However, [taskd](https://taskwarrior.org/docs/taskserver/setup.html) generates the private key in
104-
[PKCS#1](https://en.wikipedia.org/wiki/PKCS_1) format if you follow the
105-
[documentation](https://taskwarrior.org/docs/taskserver/user.html). The transformation command below also converts the
106-
key from [PEM](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) to
107-
[DER](https://en.wikipedia.org/wiki/X.690#DER_encoding) format which does not need any further transformation as
108-
handling of the base64 encoded PEM keys.
101+
| Key specification | [PEM]() format¹ | [DER]() format |
102+
| ----------------- |:---------------:|:--------------:|
103+
| [PKCS#1]() | yes | |
104+
| [PKCS#8]() | yes | yes |
105+
106+
¹: The kind of format is currently detected by file extentions.
107+
108+
Note: Keys can be transformed using `openssl`, e.g. from [PKCS#8]() in [PEM]() format to [PKCS#1]() in [DER]() format:
109109

110110
```sh
111111
openssl pkcs8 -topk8 -nocrypt -in $TASKD_GENERATED_KEY.key.pem -inform PEM -out $KEY_NAME.key.pkcs8.der -outform DER
112112
```
113113

114+
**Word of warning**: Current key parsing algorithm for [PKCS#1]() [PEM](() key uses
115+
`sun.security.util.DerInputStream` and `sun.security.util.DerValue` which are not part of the public interface, see
116+
https://www.oracle.com/java/technologies/faq-sun-packages.html for further explainations.
117+
118+
[PKCS#1]: https://en.wikipedia.org/wiki/PKCS_1
119+
[PKCS#8]: https://en.wikipedia.org/wiki/PKCS_8
120+
[PEM]: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail
121+
[DER]: https://en.wikipedia.org/wiki/X.690#DER_encoding
122+
123+
114124
Release notes
115125
-------------
116126

0 commit comments

Comments
 (0)