diff options
author | Sumit Bose <sbose@redhat.com> | 2015-05-08 09:02:26 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-06-19 18:48:13 +0200 |
commit | bf01e8179cbb2be476805340636098deda7e1366 (patch) | |
tree | 690f199f9595215f8fc807389fa9a782a6d59cce /src/util/cert.h | |
parent | e22e04517b9f9d0c7759dc4768eedfd05908e9b6 (diff) | |
download | sssd-bf01e8179cbb2be476805340636098deda7e1366.tar.gz sssd-bf01e8179cbb2be476805340636098deda7e1366.tar.xz sssd-bf01e8179cbb2be476805340636098deda7e1366.zip |
certs: add PEM/DER conversion utilities
Related to https://fedorahosted.org/sssd/ticket/2596
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Diffstat (limited to 'src/util/cert.h')
-rw-r--r-- | src/util/cert.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/util/cert.h b/src/util/cert.h new file mode 100644 index 000000000..79ea1a4ab --- /dev/null +++ b/src/util/cert.h @@ -0,0 +1,47 @@ +/* + SSSD - certificate handling utils - openssl version + + Copyright (C) Sumit Bose <sbose@redhat.com> 2015 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include <stdint.h> +#include <talloc.h> + +#include "util/util.h" + +#ifndef __CERT_H__ +#define __CERT_H__ + +errno_t sss_cert_der_to_pem(TALLOC_CTX *mem_ctx, const uint8_t *der_blob, + size_t der_size, char **pem, size_t *pem_size); + +errno_t sss_cert_pem_to_der(TALLOC_CTX *mem_ctx, const char *pem, + uint8_t **der_blob, size_t *der_size); + +errno_t sss_cert_derb64_to_pem(TALLOC_CTX *mem_ctx, const char *derb64, + char **pem, size_t *pem_size); + +errno_t sss_cert_pem_to_derb64(TALLOC_CTX *mem_ctx, const char *pem, + char **derb64); + +errno_t sss_cert_derb64_to_ldap_filter(TALLOC_CTX *mem_ctx, const char *derb64, + const char *attr_name, + char **ldap_filter); + +errno_t bin_to_ldap_filter_value(TALLOC_CTX *mem_ctx, + const uint8_t *blob, size_t blob_size, + char **_str); +#endif /* __CERT_H__ */ |