mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 00:06:32 +01:00
Generalized PEM writing in x509write module for RSA keys as well
This commit is contained in:
parent
135f1e9c70
commit
f3df61ad10
3 changed files with 175 additions and 77 deletions
|
|
@ -216,6 +216,28 @@ int x509write_key_der( rsa_context *rsa, unsigned char *buf, size_t size );
|
|||
int x509write_csr_der( x509_csr *ctx, unsigned char *buf, size_t size );
|
||||
|
||||
#if defined(POLARSSL_BASE64_C)
|
||||
/**
|
||||
* \brief Write a RSA public key to a PKCS#1 PEM string
|
||||
*
|
||||
* \param rsa RSA to write away
|
||||
* \param buf buffer to write to
|
||||
* \param size size of the buffer
|
||||
*
|
||||
* \return 0 successful, or a specific error code
|
||||
*/
|
||||
int x509write_pubkey_pem( rsa_context *rsa, unsigned char *buf, size_t size );
|
||||
|
||||
/**
|
||||
* \brief Write a RSA key to a PKCS#1 PEM string
|
||||
*
|
||||
* \param rsa RSA to write away
|
||||
* \param buf buffer to write to
|
||||
* \param size size of the buffer
|
||||
*
|
||||
* \return 0 successful, or a specific error code
|
||||
*/
|
||||
int x509write_key_pem( rsa_context *rsa, unsigned char *buf, size_t size );
|
||||
|
||||
/**
|
||||
* \brief Write a CSR (Certificate Signing Request) to a
|
||||
* PEM string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue