|
1 | 1 | /* |
2 | | - * Copyright (c) 2014-2018, Arm Limited and affiliates. |
| 2 | + * Copyright (c) 2014-2019, Arm Limited and affiliates. |
3 | 3 | * SPDX-License-Identifier: Apache-2.0 |
4 | 4 | * |
5 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -235,6 +235,18 @@ typedef struct { |
235 | 235 | const uint8_t *key_chain[4]; /**< Certificate private key. */ |
236 | 236 | } arm_certificate_chain_entry_s; |
237 | 237 |
|
| 238 | +/** Certificate structure. */ |
| 239 | +typedef struct { |
| 240 | + const uint8_t *cert; /**< Certificate pointer. */ |
| 241 | + uint16_t cert_len; /**< Certificate length. */ |
| 242 | +} arm_certificate_entry_s; |
| 243 | + |
| 244 | +/** Certificate Revocation List structure. */ |
| 245 | +typedef struct { |
| 246 | + const uint8_t *crl; /**< Certificate Revocation List pointer. */ |
| 247 | + uint16_t crl_len; /**< Certificate Revocation List length. */ |
| 248 | +} arm_cert_revocation_list_entry_s; |
| 249 | + |
238 | 250 | /** Structure for the network keys used by net_network_key_get */ |
239 | 251 | typedef struct ns_keys_t |
240 | 252 |
|
@@ -880,12 +892,56 @@ extern int8_t arm_net_route_delete(const uint8_t *prefix, uint8_t prefix_len, co |
880 | 892 | extern int8_t arm_nwk_6lowpan_border_router_nd_context_load(int8_t interface_id, uint8_t *contex_data); //NVM |
881 | 893 |
|
882 | 894 | /** |
883 | | - * Set certificate chain for PANA |
| 895 | + * Set certificate chain |
| 896 | + * |
884 | 897 | * \param chain_info Certificate chain. |
885 | 898 | * \return 0 on success, negative on failure. |
886 | 899 | */ |
887 | 900 | extern int8_t arm_network_certificate_chain_set(const arm_certificate_chain_entry_s *chain_info); |
888 | 901 |
|
| 902 | +/** |
| 903 | + * Add trusted certificate |
| 904 | + * |
| 905 | + * This is used to add trusted root or intermediate certificate in addition to those |
| 906 | + * added using certificate chain set call. Function can be called several times to add |
| 907 | + * more than one certificate. |
| 908 | + * |
| 909 | + * \param cert Certificate. |
| 910 | + * \return 0 on success, negative on failure. |
| 911 | + */ |
| 912 | +extern int8_t arm_network_trusted_certificate_add(const arm_certificate_entry_s *cert); |
| 913 | + |
| 914 | +/** |
| 915 | + * Remove trusted certificate |
| 916 | + * |
| 917 | + * This is used to remove trusted root or intermediate certificate. |
| 918 | + * |
| 919 | + * \param cert Certificate. |
| 920 | + * \return 0 on success, negative on failure. |
| 921 | + */ |
| 922 | +extern int8_t arm_network_trusted_certificate_remove(const arm_certificate_entry_s *cert); |
| 923 | + |
| 924 | +/** |
| 925 | + * Add Certificate Revocation List |
| 926 | + * |
| 927 | + * This is used to add Certificate Revocation List (CRL). Function can be called several |
| 928 | + * times to add more than one Certificate Revocation List. |
| 929 | + * |
| 930 | + * \param crl Certificate revocation list |
| 931 | + * \return 0 on success, negative on failure. |
| 932 | + */ |
| 933 | +extern int8_t arm_network_certificate_revocation_list_add(const arm_cert_revocation_list_entry_s *crl); |
| 934 | + |
| 935 | +/** |
| 936 | + * Remove Certificate Revocation List |
| 937 | + * |
| 938 | + * This is used to remove Certificate Revocation List. |
| 939 | + * |
| 940 | + * \param crl Certificate revocation list |
| 941 | + * \return 0 on success, negative on failure. |
| 942 | + */ |
| 943 | +extern int8_t arm_network_certificate_revocation_list_remove(const arm_cert_revocation_list_entry_s *crl); |
| 944 | + |
889 | 945 | /** |
890 | 946 | * \brief Add PSK key to TLS library. |
891 | 947 | * |
|
0 commit comments