Skip to content

Commit

Permalink
pk11_uri: pem encoder and decoder
Browse files Browse the repository at this point in the history
Register an encoder for writing the PrivateKeyInfo as PEM. The encoder
writes the pcsk11-uri to the PEM file. The file has the following structure:
{
ASN1_OBJECT *type; // set to "2.5.4.83"
ASN1_UTF8STRING *uri; // pkcs11-uri as produced by p11prov_key_to_uri()
}

The feature has to be enabled explicitly by setting
pkcs11-module-encode-key-uri-to-pem.

Signed-off-by: Florian Wernli <[email protected]>
  • Loading branch information
Florian Wernli committed Jan 23, 2024
1 parent c9fb942 commit 8b5743f
Show file tree
Hide file tree
Showing 15 changed files with 828 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
thkdf
toaepsha2
top_state
tpem_encoder
tpubkey
trand
trsapss
Expand Down
5 changes: 5 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ noinst_HEADERS = \
asymmetric_cipher.h \
debug.h \
encoder.h \
decoder.h \
digests.h \
exchange.h \
kdf.h \
keymgmt.h \
pk11_uri.h \
interface.h \
objects.h \
pkcs11.h \
Expand All @@ -30,10 +32,12 @@ pkcs11_la_SOURCES = \
asymmetric_cipher.c \
debug.c \
encoder.c \
decoder.c \
digests.c \
exchange.c \
kdf.c \
keymgmt.c \
pk11_uri.c \
interface.c \
objects.c \
provider.h \
Expand All @@ -51,6 +55,7 @@ pkcs11_la_SOURCES = \
EXTRA_DIST = \
interface.gen.c \
encoder.gen.c \
pk11_uri.gen.c \
$(NULL)

pkcs11_la_CFLAGS = $(AM_CFLAGS) $(OPENSSL_CFLAGS) -Wall -Werror
Expand Down
Loading

0 comments on commit 8b5743f

Please sign in to comment.