From f287efe01f5f367b1ee586e592be172beeffae0a Mon Sep 17 00:00:00 2001 From: Dmitriy Musatkin Date: Fri, 6 Oct 2023 11:32:48 -0700 Subject: [PATCH] address comments --- include/aws/io/pem.h | 56 ++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/include/aws/io/pem.h b/include/aws/io/pem.h index 834a8df30..95f497249 100644 --- a/include/aws/io/pem.h +++ b/include/aws/io/pem.h @@ -9,34 +9,38 @@ AWS_EXTERN_C_BEGIN +/* + * Naming follows OpenSSL convention for PEM types. + * Refer to comment after each enum value for the type string it represents. +*/ enum aws_pem_object_type { AWS_PEM_TYPE_UNKNOWN = 0, - AWS_PEM_TYPE_X509_OLD, - AWS_PEM_TYPE_X509, - AWS_PEM_TYPE_X509_TRUSTED, - AWS_PEM_TYPE_X509_REQ_OLD, - AWS_PEM_TYPE_X509_REQ, - AWS_PEM_TYPE_X509_CRL, - AWS_PEM_TYPE_EVP_PKEY, - AWS_PEM_TYPE_PUBLIC_PKCS8, - AWS_PEM_TYPE_PRIVATE_RSA_PKCS1, - AWS_PEM_TYPE_PUBLIC_RSA_PKCS1, - AWS_PEM_TYPE_PRIVATE_DSA_PKCS1, - AWS_PEM_TYPE_PUBLIC_DSA_PKCS1, - AWS_PEM_TYPE_PKCS7, - AWS_PEM_TYPE_PKCS7_SIGNED_DATA, - AWS_PEM_TYPE_PRIVATE_PKCS8_ENCRYPTED, - AWS_PEM_TYPE_PRIVATE_PKCS8, - AWS_PEM_TYPE_DH_PARAMETERS, - AWS_PEM_TYPE_DH_PARAMETERS_X942, - AWS_PEM_TYPE_SSL_SESSION_PARAMETERS, - AWS_PEM_TYPE_DSA_PARAMETERS, - AWS_PEM_TYPE_ECDSA_PUBLIC, - AWS_PEM_TYPE_EC_PARAMETERS, - AWS_PEM_TYPE_EC_PRIVATE, - AWS_PEM_TYPE_PARAMETERS, - AWS_PEM_TYPE_CMS, - AWS_PEM_TYPE_SM2_PARAMETERS + AWS_PEM_TYPE_X509_OLD, /* X509 CERTIFICATE */ + AWS_PEM_TYPE_X509, /* CERTIFICATE */ + AWS_PEM_TYPE_X509_TRUSTED, /* TRUSTED CERTIFICATE */ + AWS_PEM_TYPE_X509_REQ_OLD, /* NEW CERTIFICATE REQUEST */ + AWS_PEM_TYPE_X509_REQ, /* CERTIFICATE REQUEST */ + AWS_PEM_TYPE_X509_CRL, /* X509 CRL */ + AWS_PEM_TYPE_EVP_PKEY, /* ANY PRIVATE KEY */ + AWS_PEM_TYPE_PUBLIC_PKCS8, /* PUBLIC KEY */ + AWS_PEM_TYPE_PRIVATE_RSA_PKCS1, /* RSA PRIVATE KEY */ + AWS_PEM_TYPE_PUBLIC_RSA_PKCS1, /* RSA PUBLIC KEY */ + AWS_PEM_TYPE_PRIVATE_DSA_PKCS1, /* RSA PRIVATE KEY */ + AWS_PEM_TYPE_PUBLIC_DSA_PKCS1, /* RSA PUBLIC KEY */ + AWS_PEM_TYPE_PKCS7, /* PKCS7 */ + AWS_PEM_TYPE_PKCS7_SIGNED_DATA, /* PKCS #7 SIGNED DATA */ + AWS_PEM_TYPE_PRIVATE_PKCS8_ENCRYPTED, /* ENCRYPTED PRIVATE KEY */ + AWS_PEM_TYPE_PRIVATE_PKCS8, /* PRIVATE KEY */ + AWS_PEM_TYPE_DH_PARAMETERS, /* X9.42 DH PARAMETERS */ + AWS_PEM_TYPE_DH_PARAMETERS_X942, /* X9.42 DH PARAMETERS */ + AWS_PEM_TYPE_SSL_SESSION_PARAMETERS, /* SSL SESSION PARAMETERS */ + AWS_PEM_TYPE_DSA_PARAMETERS, /* DSA PARAMETERS */ + AWS_PEM_TYPE_ECDSA_PUBLIC, /* ECDSA PUBLIC KEY */ + AWS_PEM_TYPE_EC_PARAMETERS, /* EC PARAMETERS */ + AWS_PEM_TYPE_EC_PRIVATE, /* EC PRIVATE KEY */ + AWS_PEM_TYPE_PARAMETERS, /* PARAMETERS */ + AWS_PEM_TYPE_CMS, /* CMS */ + AWS_PEM_TYPE_SM2_PARAMETERS /* SM2 PARAMETERS */ }; /*