Commit Graph

43 Commits

Author SHA1 Message Date
Nicolas Williams
252487dfe4 hx509: support reading private keys from PEM files
This commit adds:

 - hx509_cert_init_private_key() for creating an hx509_cert object that
   has just a private key

 - hx509_cert_have_private_key_only() for checking whether an hx509_cert
   object has just a private key

This also generalizes the get_key() internal function in hxtool, which
is tasked with reding or generating a private key for use in signing
CSRs.  Now hxtool request-create can read/write private keys to/from PEM
files, not just DER files.

This is needed to support key types other than just RSA for CSRs and
certificates.
2019-10-03 13:09:18 -05:00
Nicolas Williams
32bc4083c4 libhx509: export some missing symbols 2019-07-09 12:34:26 -05:00
Ed Maste
8ef0071d96 Remove duplicate symbols from libhx509 version-script.map
Commit 7758a5d0 (r21331) added semiprivate function
_hx509_request_to_pkcs10 twice.
2016-07-21 14:39:37 -04:00
Jelmer Vernooij
cc495fd78d Avoid breaking symbol names for all previously present functions.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2014-03-24 22:45:13 -05:00
Jeffrey Altman
f3d9d4119e export hx509_ca_tbs_set_signature_algorithm
hx509_ca_tbs_set_signature_algorithm was added by commit
c69c4634ad.  It must be exported
for use by hxtool on Windows.

Change-Id: I14b927abde96814ae2e0a90f232ab00915a9f29e
2014-02-16 21:01:57 -05:00
Patrik Lundin
0ff637618e add version print 2013-05-01 13:46:35 -07:00
Jelmer Vernooij
36ade8b509 hx509: Make various functions used by Samba public.
* hx509_cert_public_encrypt
* hx509_parse_private_key
* hx509_private_key_assign_rsa
* hx509_private_key_free
* hx509_private_key_private_decrypt
* hx509_private_key_init
* hx509_private_key2SPKI
* hx509_request_get_name
* hx509_request_get_SubjectPublicKeyInfo
* hx509_request_free
* hx509_request_init
* hx509_request_set_name
* hx509_request_set_SubjectPublicKeyInfo

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-02-23 19:47:28 -08:00
Matthieu Patou
8ce821c387 heimdal: make some private key manipulation function public
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-01-26 12:03:50 -08:00
Matthieu Patou
4c507594d3 heimdal: make hx509_cert_public_encrypt public
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-01-26 12:03:35 -08:00
Love Hornquist Astrand
49ca1a40fa export hx509_find_private_alg 2011-01-12 17:49:12 +01:00
Love Hornquist Astrand
6f328a9194 add padding support via hx509_crypto_set_padding 2010-09-22 14:41:17 -07:00
Love Hornquist Astrand
94c720a453 add new symbols 2010-08-10 09:22:30 -07:00
Love Hornquist Astrand
2a842e90d3 Drop MD2 support
Patch partly from Guillaume Rousse
2010-04-28 22:10:27 +02:00
Love Hornquist Astrand
f45766eda0 add hx509_certs_iter_f 2009-11-22 13:54:02 -08:00
Love Hornquist Astrand
ec47674c2b expose hx509_certs_ref 2009-09-29 09:42:15 -07:00
Love Hornquist Astrand
b9c11926f7 add hx509_print_cert 2009-09-21 06:24:14 -07:00
Love Hörnquist Åstrand
2f58f14e09 add hx509_peer_info_add_cms_alg and sort
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25256 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-28 01:21:39 +00:00
Love Hörnquist Åstrand
bbfb5e38e7 export hx509_crypto_allow_weak
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24817 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-02-27 03:23:48 +00:00
Love Hörnquist Åstrand
02dab69819 hx509_cms_create_signed;
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24755 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-02-16 19:13:55 +00:00
Love Hörnquist Åstrand
f374e9b14f add hx509_certs_filter
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24584 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-02-04 22:05:08 +00:00
Love Hörnquist Åstrand
ba69102e6b add flags to hx509_cms_verify_signed
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24192 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-12-15 04:30:52 +00:00
Love Hörnquist Åstrand
b1f885befe use rk_undumpdata, spelling
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23413 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-07-26 18:34:53 +00:00
Love Hörnquist Åstrand
75ea702745 new version
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23315 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-23 04:30:31 +00:00
Love Hörnquist Åstrand
e4549b08d5 add missing symbols
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22689 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-03-16 11:35:21 +00:00
Love Hörnquist Åstrand
00f8b507cb rename to be more consistent, export for teting
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22679 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-03-14 14:52:48 +00:00
Love Hörnquist Åstrand
90c30290de Export hx509_query_match_expr.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22678 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-03-14 01:23:04 +00:00
Love Hörnquist Åstrand
d635542a92 add hx509_pem_read
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22662 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-02-26 16:19:36 +00:00
Love Hörnquist Åstrand
0ff6dbc8bb Add matching on EKU, validate EKUs, add hxtool matching glue, add check. Adapted from pach from Tim Miller of Mitre
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22538 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-01-27 13:05:47 +00:00
Love Hörnquist Åstrand
a4bfd78fb7 Export hx509_free_error_string().
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22480 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-01-18 11:15:49 +00:00
Love Hörnquist Åstrand
1514df0d1b only export C_GetFunctionList
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22476 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-01-17 11:27:56 +00:00
Love Hörnquist Åstrand
c9f443454e Add a PKCS11 provider supporting signing and verifing sigatures.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22435 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-01-14 20:53:56 +00:00
Love Hörnquist Åstrand
7e262db693 Replace hx509_name_to_der_name with hx509_name_binary.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22431 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-01-13 14:07:41 +00:00
Love Hörnquist Åstrand
c0b822fc17 drop hx509_print_func, add hx509_xfree
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22352 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-12-26 21:19:27 +00:00
Love Hörnquist Åstrand
7b6d45bb7a Export more functions.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21346 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-26 14:23:47 +00:00
Love Hörnquist Åstrand
0c933fc88c Add initialize_hx_error_table_r.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21339 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-26 12:42:15 +00:00
Love Hörnquist Åstrand
6e3fe4518e Unexport internal asn.1 symbols, add _hx509_request_print.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21336 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-26 12:19:23 +00:00
Love Hörnquist Åstrand
307d29f7e6 Missed some semi-private functions.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21333 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-26 11:57:39 +00:00
Love Hörnquist Åstrand
7758a5d027 Export more crap^W semiprivate functions.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21331 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-26 11:11:05 +00:00
Love Hörnquist Åstrand
13c7584ff7 add more missing ;
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21325 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-26 10:21:37 +00:00
Love Hörnquist Åstrand
72176d0c50 add missing ;
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21324 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-26 10:20:51 +00:00
Love Hörnquist Åstrand
35a7646bf0 Export some semi-private functions.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21305 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-25 17:04:12 +00:00
Love Hörnquist Åstrand
5a42c2faa3 export hx509_pem_write
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21304 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-25 16:54:53 +00:00
Love Hörnquist Åstrand
d19038227e Limited exported symbols.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21281 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-25 05:40:09 +00:00