]>
Commit | Line | Data |
---|---|---|
440e5d80 RS |
1 | /* |
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. | |
d02b48c6 | 3 | * |
440e5d80 RS |
4 | * Licensed under the OpenSSL license (the "License"). You may not use |
5 | * this file except in compliance with the License. You can obtain a copy | |
6 | * in the file LICENSE in the source distribution or at | |
7 | * https://www.openssl.org/source/license.html | |
d02b48c6 RE |
8 | */ |
9 | ||
10 | #include <stdio.h> | |
11 | #include <stdlib.h> | |
ec577822 BM |
12 | #include <openssl/rsa.h> |
13 | #include <openssl/x509.h> | |
d02b48c6 | 14 | #include "meth.h" |
ec577822 | 15 | #include <openssl/err.h> |
d02b48c6 | 16 | |
0f113f3e | 17 | int main(argc, argv) |
d02b48c6 RE |
18 | int argc; |
19 | char *argv[]; | |
0f113f3e MC |
20 | { |
21 | METHOD_CTX *top, *tmp1, *tmp2; | |
d02b48c6 | 22 | |
0f113f3e MC |
23 | top = METH_new(x509_lookup()); /* get a top level context */ |
24 | if (top == NULL) | |
25 | goto err; | |
d02b48c6 | 26 | |
0f113f3e MC |
27 | tmp1 = METH_new(x509_by_file()); |
28 | if (top == NULL) | |
29 | goto err; | |
30 | METH_arg(tmp1, METH_TYPE_FILE, "cafile1"); | |
31 | METH_arg(tmp1, METH_TYPE_FILE, "cafile2"); | |
32 | METH_push(top, METH_X509_CA_BY_SUBJECT, tmp1); | |
d02b48c6 | 33 | |
0f113f3e MC |
34 | tmp2 = METH_new(x509_by_dir()); |
35 | METH_arg(tmp2, METH_TYPE_DIR, "/home/eay/.CAcerts"); | |
36 | METH_arg(tmp2, METH_TYPE_DIR, "/home/eay/SSLeay/certs"); | |
37 | METH_arg(tmp2, METH_TYPE_DIR, "/usr/local/ssl/certs"); | |
38 | METH_push(top, METH_X509_CA_BY_SUBJECT, tmp2); | |
d02b48c6 | 39 | |
35a1cc90 MC |
40 | /*- tmp=METH_new(x509_by_issuer_dir); |
41 | METH_arg(tmp,METH_TYPE_DIR,"/home/eay/.mycerts"); | |
42 | METH_push(top,METH_X509_BY_ISSUER,tmp); | |
d02b48c6 | 43 | |
35a1cc90 MC |
44 | tmp=METH_new(x509_by_issuer_primary); |
45 | METH_arg(tmp,METH_TYPE_FILE,"/home/eay/.mycerts/primary.pem"); | |
46 | METH_push(top,METH_X509_BY_ISSUER,tmp); | |
d02b48c6 RE |
47 | */ |
48 | ||
0f113f3e MC |
49 | METH_init(top); |
50 | METH_control(tmp1, METH_CONTROL_DUMP, stdout); | |
51 | METH_control(tmp2, METH_CONTROL_DUMP, stdout); | |
52 | EXIT(0); | |
53 | err: | |
0f113f3e MC |
54 | ERR_print_errors_fp(stderr); |
55 | EXIT(1); | |
56 | return (0); | |
57 | } |