source: libabac/abac_openssl.h @ 7764378

abac0-leak
Last change on this file since 7764378 was a02c849, checked in by Mei <mei@…>, 7 years ago

1) add examples from wiki into regression tests
2) add code to complete the support of combo id/privkey file format
3) update abac.hh/API

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/* abac_openssl.h */
2
3#ifndef __ABAC_OPENSSL_H__
4#define __ABAC_OPENSSL_H__
5
6#include <stdio.h>
7#include <openssl/x509.h>
8#include <openssl/err.h>
9
10/* ID */
11EVP_PKEY* abac_generate_key();
12X509 *abac_generate_cert(EVP_PKEY *, char*, long);
13
14// 8 bytes
15unsigned char *abac_generate_serial();
16
17//
18int init_openssl();
19int deinit_openssl();
20
21X509 *abac_load_id_from_fp(FILE *);
22EVP_PKEY *abac_load_privkey_from_fp(FILE *);
23EVP_PKEY *abac_load_privkey_from_chunk(unsigned char *, int);
24X509 *abac_load_id_from_chunk(unsigned char *, int);
25int abac_write_id_to_fp(X509 *cert, FILE *fp);
26int abac_write_privkey_to_fp(EVP_PKEY *key, FILE *fp);
27
28EVP_PKEY *extract_pubkey_from_cert(X509 *);
29
30unsigned char *abac_string_cert(X509 *);
31EVP_PKEY *extract_pubkey_from_cert(X509 *);
32unsigned char *abac_string_privkey(EVP_PKEY *);
33
34char *abac_get_serial(X509 *);
35char *abac_get_cn(X509 *);
36char *abac_get_subject(X509 *); 
37char *abac_get_issuer(X509 *);
38
39// sha of cert
40char *abac_get_keyid(X509 *);
41
42int abac_check_validity(X509 *, struct tm *, struct tm *);
43int abac_still_valid(X509 *);
44
45#endif /*__ABAC_OPENSSL_H__ */
Note: See TracBrowser for help on using the repository browser.