x509_cert_ext_format.h
Go to the documentation of this file.
1 /**
2  * @file x509_cert_ext_format.h
3  * @brief X.509 extension formatting
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneCRYPTO Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _X509_CERT_EXT_FORMAT_H
32 #define _X509_CERT_EXT_FORMAT_H
33 
34 //Dependencies
35 #include "core/crypto.h"
36 #include "pkix/x509_common.h"
37 
38 //C++ guard
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 //X.509 related functions
45  const X509SubjectKeyId *subjectKeyId, const X509AuthKeyId *authKeyId,
46  uint8_t *output, size_t *written);
47 
48 error_t x509FormatExtension(const X509Extension *extension, uint8_t *output,
49  size_t *written);
50 
52  uint8_t *output, size_t *written);
53 
54 error_t x509FormatKeyUsage(const X509KeyUsage *keyUsage, uint8_t *output,
55  size_t *written);
56 
58  uint8_t *output, size_t *written);
59 
60 error_t x509FormatKeyPurposes(uint16_t bitmap, uint8_t *output,
61  size_t *written);
62 
64  uint8_t *output, size_t *written);
65 
67  uint8_t *output, size_t *written);
68 
70  uint8_t *output, size_t *written);
71 
73  uint8_t *output, size_t *written);
74 
75 //C++ guard
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif
X.509 common definitions.
error_t x509FormatKeyUsage(const X509KeyUsage *keyUsage, uint8_t *output, size_t *written)
Format KeyUsage extension.
error_t x509FormatKeyPurposes(uint16_t bitmap, uint8_t *output, size_t *written)
Format the list of key purposes.
uint8_t extensions[]
Definition: ntp_common.h:207
Subject Key Identifier extension.
Definition: x509_common.h:884
error_t x509FormatNsCertType(const X509NsCertType *nsCertType, uint8_t *output, size_t *written)
Format NetscapeCertType extension.
error_t x509FormatBasicConstraints(const X509BasicConstraints *basicConstraints, uint8_t *output, size_t *written)
Format BasicConstraints extension.
error_t
Error codes.
Definition: error.h:43
Extended Key Usage extension.
Definition: x509_common.h:848
error_t x509FormatAuthorityKeyId(const X509AuthKeyId *authKeyId, uint8_t *output, size_t *written)
Format AuthorityKeyIdentifier extension.
X.509 certificate extension.
Definition: x509_common.h:991
Authority Key Identifier extension.
Definition: x509_common.h:896
General definitions for cryptographic algorithms.
Subject Alternative Name extension.
Definition: x509_common.h:871
Netscape certificate type.
Definition: x509_common.h:980
error_t x509FormatSubjectAltName(const X509SubjectAltName *subjectAltName, uint8_t *output, size_t *written)
Format SubjectAltName extension.
Basic Constraints extension.
Definition: x509_common.h:813
X.509 certificate extensions.
Definition: x509_common.h:1003
error_t x509FormatSubjectKeyId(const X509SubjectKeyId *subjectKeyId, uint8_t *output, size_t *written)
Format SubjectKeyIdentifier extension.
error_t x509FormatExtension(const X509Extension *extension, uint8_t *output, size_t *written)
Format X.509 certificate extension.
error_t x509FormatExtendedKeyUsage(const X509ExtendedKeyUsage *extKeyUsage, uint8_t *output, size_t *written)
Format ExtendedKeyUsage extension.
error_t x509FormatExtensions(const X509Extensions *extensions, const X509SubjectKeyId *subjectKeyId, const X509AuthKeyId *authKeyId, uint8_t *output, size_t *written)
Format Extensions structure.
Key Usage extension.
Definition: x509_common.h:837