~ubuntu-branches/ubuntu/karmic/alpine/karmic

« back to all changes in this revision

Viewing changes to pith/smkeys.h

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2008-09-23 12:17:56 UTC
  • mfrom: (2.1.8 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080923121756-6u4x8bwq89qlzt32
Tags: 2.00+dfsg-2
Update to package description: note that Alpine is no longer in
alpha. (Closes: #499640)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id: smkeys.h 1069 2008-06-03 15:54:15Z hubert@u.washington.edu $
 
3
 *
 
4
 * ========================================================================
 
5
 * Copyright 2008 University of Washington
 
6
 *
 
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
 
10
 *
 
11
 *     http://www.apache.org/licenses/LICENSE-2.0
 
12
 *
 
13
 * ========================================================================
 
14
 */
 
15
 
 
16
#ifdef SMIME
 
17
#ifndef PITH_SMKEYS_INCLUDED
 
18
#define PITH_SMKEYS_INCLUDED
 
19
 
 
20
 
 
21
#include "../pith/state.h"
 
22
#include "../pith/send.h"
 
23
 
 
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>
 
31
 
 
32
 
 
33
#define EMAILADDRLEADER "emailAddress="
 
34
#define CACERTSTORELEADER "cacert="
 
35
 
 
36
 
 
37
typedef struct personal_cert {
 
38
    X509                 *cert;
 
39
    EVP_PKEY             *key;
 
40
    char                 *name;
 
41
    char                 *keytext;
 
42
    struct personal_cert *next;
 
43
} PERSONAL_CERT;
 
44
 
 
45
 
 
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);
 
58
 
 
59
 
 
60
#endif /* PITH_SMKEYS_INCLUDED */
 
61
#endif /* SMIME */