2
* $Id: smkeys.h 1069 2008-06-03 15:54:15Z hubert@u.washington.edu $
4
* ========================================================================
5
* Copyright 2008 University of Washington
7
* Licensed under the Apache License, Version 2.0 (the "License");
8
* you may not use this file except in compliance with the License.
9
* You may obtain a copy of the License at
11
* http://www.apache.org/licenses/LICENSE-2.0
13
* ========================================================================
17
#ifndef PITH_SMKEYS_INCLUDED
18
#define PITH_SMKEYS_INCLUDED
21
#include "../pith/state.h"
22
#include "../pith/send.h"
24
#include <openssl/objects.h>
25
#include <openssl/evp.h>
26
#include <openssl/x509.h>
27
#include <openssl/pkcs7.h>
28
#include <openssl/pem.h>
29
#include <openssl/err.h>
30
#include <openssl/bio.h>
33
#define EMAILADDRLEADER "emailAddress="
34
#define CACERTSTORELEADER "cacert="
37
typedef struct personal_cert {
42
struct personal_cert *next;
46
/* exported protoypes */
47
X509_STORE *get_ca_store(void);
48
PERSONAL_CERT *get_personal_certs(char *d);
49
X509 *get_cert_for(char *email);
50
void save_cert_for(char *email, X509 *cert);
51
char *get_x509_subject_email(X509 *x);
52
EVP_PKEY *load_key(PERSONAL_CERT *pc, char *pass);
53
CertList *mem_to_certlist(char *contents);
54
void add_to_end_of_certlist(CertList **cl, char *name, X509 *cert);
55
void free_certlist(CertList **cl);
56
PERSONAL_CERT *mem_to_personal_certs(char *contents);
57
void free_personal_certs(PERSONAL_CERT **pc);
60
#endif /* PITH_SMKEYS_INCLUDED */