1 /******************************************************************
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * LICENSE-2.0" target="_blank">http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 ******************************************************************/
30 #include "byte_array.h"
31 #include "pki_errors.h"
33 /// Maximal number of revoked certificates in list
35 #define CRL_MAX_LEN (256)
37 #define CRL_MAX_LEN (1024)
38 #endif // WITH_ARDUINO
40 * @struct CertificateList
44 * Structure fields contain byte arrays pointed to relative DER certificate positions.
48 ByteArray tbs; /**< TBS sequence of CRL.*/
49 ByteArray issuer; /**< Issuer name.*/
50 ByteArray date; /**< The issue-date for CRL.*/
51 ByteArray signR; /**< Signature r value.*/
52 ByteArray signS; /**< Signature s value.*/
57 * Prints Certificate List to console.
59 * @param crl - pointer to certificate list structure
60 * @return PKI_SUCCESS if success, error code otherwise
62 PKIError PrintCRL(const CertificateList *const crl);
66 * Decodes and checks Certificate List.
68 * @param code - certificate list structure in DER format
69 * @param crl - pointer to certificate list structure
70 * @param caPubKey - ByteArray structure contains CA public key
71 * @return PKI_SUCCESS if success, error code otherwise
73 PKIError DecodeCertificateList(ByteArray code, CertificateList *crl, ByteArray caPubKey);