PEM file decryption. More...
Go to the source code of this file.
Functions | |
error_t | pemDecryptPrivateKey (const char_t *input, size_t inputLen, const char_t *password, char_t *output, size_t *outputLen) |
PEM private key decryption. More... | |
error_t | pemDecryptMessage (const PemHeader *header, const char_t *password, const uint8_t *ciphertext, size_t ciphertextLen, uint8_t *plaintext, size_t *plaintextLen) |
PEM message decryption. More... | |
error_t | pemFormatIv (const PemHeader *header, uint8_t *iv, size_t ivLen) |
Extract the IV from the PEM encapsulated header. More... | |
error_t | pemKdf (const char_t *p, size_t pLen, const uint8_t *s, size_t sLen, uint8_t *dk, size_t dkLen) |
Key derivation function. More... | |
Detailed Description
PEM file decryption.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneCRYPTO Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file pem_decrypt.h.
Function Documentation
◆ pemDecryptMessage()
error_t pemDecryptMessage | ( | const PemHeader * | header, |
const char_t * | password, | ||
const uint8_t * | ciphertext, | ||
size_t | ciphertextLen, | ||
uint8_t * | plaintext, | ||
size_t * | plaintextLen | ||
) |
PEM message decryption.
- Parameters
-
[in] header PEM encapsulated header [in] password NULL-terminated string containing the password [in] ciphertext Pointer to the ciphertext data [in] ciphertextLen Length of the ciphertext data, in bytes [out] plaintext Pointer to the plaintext data [out] plaintextLen Length of the plaintext data, in bytes
- Returns
- Error code
Definition at line 361 of file pem_decrypt.c.
◆ pemDecryptPrivateKey()
error_t pemDecryptPrivateKey | ( | const char_t * | input, |
size_t | inputLen, | ||
const char_t * | password, | ||
char_t * | output, | ||
size_t * | outputLen | ||
) |
PEM private key decryption.
- Parameters
-
[in] input Pointer to the encrypted private key (PEM format) [in] inputLen Length of the encrypted private key [in] password NULL-terminated string containing the password [out] output Pointer to decrypted private key (PEM format) [out] outputLen Length of the decrypted private key
- Returns
- Error code
Definition at line 58 of file pem_decrypt.c.
◆ pemFormatIv()
Extract the IV from the PEM encapsulated header.
- Parameters
-
[in] header PEM encapsulated header [out] iv Initialization vector [in] ivLen Length of the initialization vector, in bytes
- Returns
- Error code
Definition at line 495 of file pem_decrypt.c.
◆ pemKdf()
error_t pemKdf | ( | const char_t * | p, |
size_t | pLen, | ||
const uint8_t * | s, | ||
size_t | sLen, | ||
uint8_t * | dk, | ||
size_t | dkLen | ||
) |
Key derivation function.
- Parameters
-
[in] p Password, an octet string [in] pLen Length in octets of password [in] s Salt, an octet string [in] sLen Length in octets of salt [out] dk Derived key [in] dkLen Intended length in octets of the derived key
- Returns
- Error code
Definition at line 548 of file pem_decrypt.c.