Skip to content

Commit f823436

Browse files
authored
Update README.md
1 parent 4b78a1d commit f823436

File tree

1 file changed

+31
-33
lines changed

1 file changed

+31
-33
lines changed

README.md

+31-33
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
where private keys as embedded inside:
44

5-
* Google Cloud KMS
6-
* Trusted Platform Module (TPM)
5+
* `Google Cloud KMS`
6+
* `Trusted Platform Module (TPM)`
77

88
Basically, you will get a `crypto.Signer` interface where the private keys are saved on those platform.
99

@@ -23,48 +23,18 @@ see the [example/](example/) folder for more information.
2323

2424
Initialize a signer and directly use `.sign()` as shown in this sample for GCS SignedURL:
2525

26-
* [GCS SignedURL for KMS](https://github.com/salrashid123/kms_service_accounts/blob/master/main.go#L56)
26+
* [GCS SignedURL for KMS](https://github.com/salrashid123/kms_service_accounts)
2727
* [GCS signedURLs and GCP Authentication with Trusted Platform Module](https://github.com/salrashid123/gcs_tpm)
2828

29-
### TPM Signer Device management
30-
31-
For TPM Signer, there are two modes of operation:
32-
33-
* managed externally
34-
35-
The TPM device is managed externally outside of the signer. You have to instantiate the TPM device ReadWriteCloser and client.Key outside of the library and pass that in.
36-
37-
The advantage of this is you control it opening and closing. You must close the key and closer before calling another signing operation
38-
39-
* managed by library
40-
41-
This is the preferred mode: you just pass the uint32 handle for the key and the path to the tpm device as string and the library opens/closes it as needed.
42-
43-
If the device is busy or the TPM is in use during invocation, the operation will fail.
44-
45-
TODO use a backoff retry similar to [tpmrand](https://github.com/salrashid123/tpmrand) to prevent contention.
46-
47-
Please note that we are persisting the handle here for easy access. The more formal way is to save the entire chain of keys (which is a TODO)
48-
49-
A limitation of using persistent handles is that its limited on a TPM (typically 7 slots). You have to evict (i.,e delete) one before loading a new one.
50-
51-
52-
If you just want to issue JWT's, see
53-
54-
* [https://github.com/salrashid123/golang-jwt-tpm](https://github.com/salrashid123/golang-jwt-tpm)
55-
* [https://github.com/salrashid123/golang-jwt-pkcs11](https://github.com/salrashid123/golang-jwt-pkcs11)
56-
5729
### Usage TLS
5830

5931
* for tpm see [mTLS with TPM bound private key](https://github.com/salrashid123/go_tpm_https_embed)
6032
* for kms see [mTLS with Google Cloud KMS](https://github.com/salrashid123/kms_golang_signer)
6133

62-
6334
### Sign/Verify PSS
6435

6536
see `example/sign_verify*` folders
6637

67-
6838
### Sign/Verify ECC
6939

7040
The default output signature format for ECC based keys is ASN1 format as described in [ecdsa.SignASN1](https://pkg.go.dev/crypto/ecdsa#Sign)
@@ -89,3 +59,31 @@ see `util/csrgen/`
8959
go run certgen/certgen.go -cn server.domain.com
9060
```
9161

62+
---
63+
64+
### TPM Signer Device management
65+
66+
For TPM Signer, there are two modes of operation:
67+
68+
* managed externally
69+
70+
The TPM device is managed externally outside of the signer. You have to instantiate the TPM device ReadWriteCloser and client.Key outside of the library and pass that in.
71+
72+
The advantage of this is you control it opening and closing. You must close the key and closer before calling another signing operation
73+
74+
* managed by library
75+
76+
This is the preferred mode: you just pass the uint32 handle for the key and the path to the tpm device as string and the library opens/closes it as needed.
77+
78+
If the device is busy or the TPM is in use during invocation, the operation will fail.
79+
80+
TODO use a backoff retry similar to [tpmrand](https://github.com/salrashid123/tpmrand) to prevent contention.
81+
82+
Please note that we are persisting the handle here for easy access. The more formal way is to save the entire chain of keys (which is a TODO)
83+
84+
A limitation of using persistent handles is that its limited on a TPM (typically 7 slots). You have to evict (i.,e delete) one before loading a new one.
85+
86+
If you just want to issue JWT's, see
87+
88+
* [https://github.com/salrashid123/golang-jwt-tpm](https://github.com/salrashid123/golang-jwt-tpm)
89+
* [https://github.com/salrashid123/golang-jwt-pkcs11](https://github.com/salrashid123/golang-jwt-pkcs11)

0 commit comments

Comments
 (0)