Documentation
¶
Overview ¶
Package netcertstore hosts the NetCertStore. It is a certificate/key store for network-related tests (such as VPN and WiFi).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store contains the information to use TPM to store certificates/keys during the test. Strictly speaking, this struct holds the information required to access a chaps slot/token. Note that Store is currently a singleton because users of this struct (network tests) only need one Store at a moment and handling multiple Store at a time adds unnecessary complexity.
func CreateStore ¶
CreateStore sets up a Store for network testing. Note that rebooting the DUT or restarting the cryptohomed/chapsd daemon will invalidate the store returned by this method. It is the caller's responsibility to call Cleanup() before rebooting or restarting the daemon. NetCertStore only support devices/boards with TPM.
func (*Store) Cleanup ¶
Cleanup resets the environment (chaps keystore and cryptohome vault) back to the state before the Store instance is created.
func (*Store) InstallCertKeyPair ¶
func (s *Store) InstallCertKeyPair(ctx context.Context, key, certificate string) (identifier string, retErr error)
InstallCertKeyPair installs a key and its certificate into the TPM. key is the private key in PEM format; certificate is the certificate in PEM format. The returned identifier is the ID to the object when inserted into the user token.