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
+11-3
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,9 @@ Use the signer to create a TLS session, sign CA/CSRs, generate signed url or jus
12
12
Some implementations:
13
13
14
14
-`kms/`: Sample that implements `crypto.Signer` using Google Cloud KMS.
15
-
-`tpm/`: Sample that implements `crypto.Signer` using `go-tpm` library for Trusted Platform Module This internally uses [go-tpm-tools.client.GetSigner()](https://pkg.go.dev/github.com/google/go-tpm-tools/client#Key.GetSigner)
15
+
-`tpm/`: Sample that implements `crypto.Signer` using `go-tpm` library for Trusted Platform Module.
16
+
17
+
other stuff:
16
18
17
19
-`util/certgen/`: Library that generates a self-signed x509 certificate for the KMS and TPM based signers above
18
20
-`util/csrgen/`: Library that generates a CSR using the key in KMS or TPM
@@ -80,7 +82,7 @@ If you just want to issue JWT's, see
80
82
81
83
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.
82
84
83
-
The advantage of this is you control it opening and closing. You must close the key and closer before calling another signing operation.
85
+
The advantage of this is you control it opening and closing.
84
86
85
87
```golang
86
88
rwc, err:=OpenTPM(*tpmPath)
@@ -97,8 +99,14 @@ If you just want to issue JWT's, see
97
99
Name: pub.Name,
98
100
},
99
101
})
100
-
// the tpm is opened and then closed after every sign operation
Copy file name to clipboardExpand all lines: example/README.md
+21-11
Original file line number
Diff line number
Diff line change
@@ -134,28 +134,29 @@ type Session interface {
134
134
}
135
135
```
136
136
137
-
eg:
137
+
for example, for a PCR and [AuthPolicy](https://github.com/google/go-tpm/pull/359) enforcement (eg, a PCR and password), you can define a custom session callback
138
138
139
139
```golang
140
-
// for pcr sessions
141
-
typeMyCustomSessionstruct {
142
-
rwr transport.TPM
143
-
sel []tpm2.TPMSPCRSelection
140
+
typeMyPCRAndPolicyAuthValueSessionstruct {
141
+
rwr transport.TPM
142
+
sel []tpm2.TPMSPCRSelection
143
+
password []byte
144
144
}
145
145
146
-
funcNewMyCustomSession(rwrtransport.TPM, sel []tpm2.TPMSPCRSelection) (MyCustomSession, error) {
147
-
returnMyCustomSession{rwr, sel}, nil
146
+
funcNewPCRAndPolicyAuthValueSession(rwrtransport.TPM, sel []tpm2.TPMSPCRSelection, password []byte) (MyPCRAndPolicyAuthValueSession, error) {
0 commit comments