You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-33
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
3
3
where private keys as embedded inside:
4
4
5
-
* Google Cloud KMS
6
-
* Trusted Platform Module (TPM)
5
+
*`Google Cloud KMS`
6
+
*`Trusted Platform Module (TPM)`
7
7
8
8
Basically, you will get a `crypto.Signer` interface where the private keys are saved on those platform.
9
9
@@ -23,48 +23,18 @@ see the [example/](example/) folder for more information.
23
23
24
24
Initialize a signer and directly use `.sign()` as shown in this sample for GCS SignedURL:
25
25
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)
27
27
*[GCS signedURLs and GCP Authentication with Trusted Platform Module](https://github.com/salrashid123/gcs_tpm)
28
28
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.
* for tpm see [mTLS with TPM bound private key](https://github.com/salrashid123/go_tpm_https_embed)
60
32
* for kms see [mTLS with Google Cloud KMS](https://github.com/salrashid123/kms_golang_signer)
61
33
62
-
63
34
### Sign/Verify PSS
64
35
65
36
see `example/sign_verify*` folders
66
37
67
-
68
38
### Sign/Verify ECC
69
39
70
40
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/`
89
59
go run certgen/certgen.go -cn server.domain.com
90
60
```
91
61
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.
0 commit comments