1 | /** @file
|
---|
2 | * IPRT - X509 functions
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2014 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef ___iprt_x509_h
|
---|
27 | #define ___iprt_x509_h
|
---|
28 |
|
---|
29 | #include <iprt/types.h>
|
---|
30 | #include <iprt/manifest.h>
|
---|
31 | #include <openssl/x509v3.h>
|
---|
32 |
|
---|
33 | RT_C_DECLS_BEGIN
|
---|
34 |
|
---|
35 | /** @defgroup grp_rt_x509 RTX509 - X509 Functions
|
---|
36 | * @ingroup grp_rt
|
---|
37 | * @{
|
---|
38 | */
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * Preparation before start to work with openssl
|
---|
42 | *
|
---|
43 | * @todo This should return a status and check that X509 code seems sane. This
|
---|
44 | * would allow dynamic linking if necessary at some point.
|
---|
45 | */
|
---|
46 | RTDECL(int) RTX509PrepareOpenSSL(void);
|
---|
47 |
|
---|
48 | /**
|
---|
49 | * Verify RSA signature for the given memory buffer.
|
---|
50 | *
|
---|
51 | * @returns iprt status code.
|
---|
52 | *
|
---|
53 | * @param pvBuf Memory buffer containing a RSA
|
---|
54 | * signature
|
---|
55 | * @param cbSize The amount of data (in bytes)
|
---|
56 | * @param pManifestDigestIn string contains manifest
|
---|
57 | * digest
|
---|
58 | * @param digestType Type of digest
|
---|
59 | */
|
---|
60 | RTDECL(int) RTRSAVerify(void *pvBuf, unsigned int cbSize, const char* pManifestDigestIn, RTDIGESTTYPE digestType);
|
---|
61 |
|
---|
62 | /**
|
---|
63 | * Verify X509 certificate for the given memory buffer.
|
---|
64 | *
|
---|
65 | * @returns iprt status code.
|
---|
66 | *
|
---|
67 | * @param pvBuf Memory buffer containing X509
|
---|
68 | * certificate
|
---|
69 | * @param cbSize The amount of data (in bytes)
|
---|
70 | */
|
---|
71 | RTDECL(int) RTX509CertificateVerify(void *pvBuf, unsigned int cbSize);
|
---|
72 |
|
---|
73 | /** @todo document me. */
|
---|
74 | RTDECL(unsigned long) RTX509GetErrorDescription(char** pErrorDesc);
|
---|
75 |
|
---|
76 | /** @} */
|
---|
77 |
|
---|
78 | RT_C_DECLS_END
|
---|
79 |
|
---|
80 | #endif /* ___iprt_x509_h */
|
---|
81 |
|
---|