hx509: private key exclusion options
commite51574599662486e2e54fec03eb69003a8998fa5
authorNicolas Williams <nico@twosigma.com>
Fri, 6 Dec 2019 23:11:01 +0000 (6 17:11 -0600)
committerNicolas Williams <nico@twosigma.com>
Tue, 10 Dec 2019 00:10:10 +0000 (9 18:10 -0600)
tree38aa3377b11c6b3246270b89e187322ffa31c432
parent3c0d1258ceae61a00f7fb2a8ac220399cb0cbe84
hx509: private key exclusion options

Add two ways to exclude private keys when dealing with an hx509
certificate store.  One as a load option (load no private keys, never
add private keys), one as a store option (store no private keys).

This is useful for CA code so it can have a single store with the
issuer's credentials _and_ the chain for it, and copy those to a store
with the issued certificate and _not_ accidentally include the issuer's
private key.

It would be much safer still to flip the default for this flag, but that
could break out-of-tree libhx509 dependents.
lib/hx509/cert.c
lib/hx509/hx509.h
lib/hx509/hxtool-commands.in
lib/hx509/hxtool.c
lib/hx509/keyset.c
lib/hx509/ks_file.c
lib/hx509/ks_keychain.c
lib/hx509/ks_p11.c
lib/hx509/ks_p12.c