diff options
author | Lei He <helei.sig11@bytedance.com> | 2022-10-08 16:50:29 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2022-11-02 06:56:32 -0400 |
commit | 58660863ba5ca4f74fa70671da2899b264dc5f34 (patch) | |
tree | d6907865e91667bf5457f1fba9869b9cd30f507b /crypto/rsakey.h | |
parent | 3b34ccad6695f3fd3e48555d895d450f750c00e6 (diff) | |
download | qemu-58660863ba5ca4f74fa70671da2899b264dc5f34.zip qemu-58660863ba5ca4f74fa70671da2899b264dc5f34.tar.gz qemu-58660863ba5ca4f74fa70671da2899b264dc5f34.tar.bz2 |
crypto: Support export akcipher to pkcs8
crypto: support export RSA private keys with PKCS#8 standard.
So that users can upload this private key to linux kernel.
Signed-off-by: lei he <helei.sig11@bytedance.com>
Message-Id: <20221008085030.70212-4-helei.sig11@bytedance.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'crypto/rsakey.h')
-rw-r--r-- | crypto/rsakey.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/crypto/rsakey.h b/crypto/rsakey.h index 974b76f..00b3ecc 100644 --- a/crypto/rsakey.h +++ b/crypto/rsakey.h @@ -22,7 +22,6 @@ #ifndef QCRYPTO_RSAKEY_H #define QCRYPTO_RSAKEY_H -#include "qemu/osdep.h" #include "qemu/host-utils.h" #include "crypto/akcipher.h" @@ -84,6 +83,16 @@ QCryptoAkCipherRSAKey *qcrypto_akcipher_rsakey_parse( QCryptoAkCipherKeyType type, const uint8_t *key, size_t keylen, Error **errp); +/** + * qcrypto_akcipher_rsakey_export_as_p8info: + * + * Export RSA private key to PKCS#8 private key info. + */ +void qcrypto_akcipher_rsakey_export_p8info(const uint8_t *key, + size_t keylen, + uint8_t **dst, + size_t *dlen); + void qcrypto_akcipher_rsakey_free(QCryptoAkCipherRSAKey *key); G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoAkCipherRSAKey, |