Skip to content
This repository has been archived by the owner on May 16, 2020. It is now read-only.

Minor usability improvements #78

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CMakeFiles/
CMakeCache.txt
Makefile
cmake_install.cmake
libtpm2-pk11.so
tpm2-pk11.module
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ TPM2-PK11 provide a PKCS#11 backend for TPM 2.0 chips.
This allows you to use your TPM keys in every application which support the PKCS #11 standard.
For more information about howto setup keys, certificates and applications see the [wiki](https://github.com/irtimmer/tpm2-pk11/wiki).

## Dependencies
For Ubuntu 18.04 Bionic beaver
`apt install libsapi-dev libtasn1-6-dev libp11-kit-dev`

## Features

- Sign and decrypt using private RSA key stored in TPM
Expand Down
19 changes: 19 additions & 0 deletions scripts/cmds-tpmtools2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
#This command was tested on a Ubuntu 18.04 using the in-kernel Resouce Manage
#To run this commands, you need tpm-tools 2.1. This script is not compatible with newer tpm-tools.
#Hardware used was a Dell XPS 9360

export TPM2TOOLS_TCTI_NAME=device
export TPM2TOOLS_DEVICE_FILE=/dev/tpmrm0

set -ex

cd ~/.tpm2
tpm2_createprimary -A e -g 0x000b -G 0x0001 -C po.ctx
#note, you may need to set additional object attributes to make it work with your specific application
tpm2_create -c po.ctx -g 0x000b -G 0x0001 -o key.pub -O key.priv
tpm2_load -c po.ctx -u key.pub -r key.priv -n key.name -C obj.ctx
tpm2_evictcontrol -A o -c obj.ctx -S 0x81010011
rm key.name *.ctx
rm key.priv #TPM now controls private key