aboutsummaryrefslogtreecommitdiffstats
path: root/libparc/parc/security/test/test_parc_X509Certificate.c
diff options
context:
space:
mode:
Diffstat (limited to 'libparc/parc/security/test/test_parc_X509Certificate.c')
-rwxr-xr-xlibparc/parc/security/test/test_parc_X509Certificate.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libparc/parc/security/test/test_parc_X509Certificate.c b/libparc/parc/security/test/test_parc_X509Certificate.c
index 3ddb8220..dda9a9ff 100755
--- a/libparc/parc/security/test/test_parc_X509Certificate.c
+++ b/libparc/parc/security/test/test_parc_X509Certificate.c
@@ -53,6 +53,8 @@ LONGBOW_TEST_FIXTURE(Global)
LONGBOW_RUN_TEST_CASE(Global, parc_X509Certificate_GetCertificateDigest);
LONGBOW_RUN_TEST_CASE(Global, parc_X509Certificate_GetDEREncodedCertificate);
LONGBOW_RUN_TEST_CASE(Global, parc_X509Certificate_GetDEREncodedPublicKey);
+ LONGBOW_RUN_TEST_CASE(Global, parc_X509Certificate_CreateSelfSignedCertificate_RSA);
+ LONGBOW_RUN_TEST_CASE(Global, parc_X509Certificate_CreateSelfSignedCertificate_EC);
}
LONGBOW_TEST_FIXTURE_SETUP(Global)
@@ -98,6 +100,24 @@ LONGBOW_TEST_CASE(Global, parc_X509Certificate_Create)
assertNull(certificate, "Expected NULL certificate with non-existent file");
}
+LONGBOW_TEST_CASE(Global, parc_X509Certificate_CreateSelfSignedCertificate_EC)
+{
+ PARCBuffer *privateKeyBuffer = NULL;
+ PARCX509Certificate *certificate = _createSelfSignedCertificate_EC(&privateKeyBuffer, "TEST", 256, 180);
+ assertNotNull(certificate, "Expected non-NULL EC certificate");
+ parcBuffer_Release(&privateKeyBuffer);
+ parcX509Certificate_Release(&certificate);
+}
+
+LONGBOW_TEST_CASE(Global, parc_X509Certificate_CreateSelfSignedCertificate_RSA)
+{
+ PARCBuffer *privateKeyBuffer = NULL;
+ PARCX509Certificate *certificate = _createSelfSignedCertificate_RSA(&privateKeyBuffer, "TEST", 1024, 180);
+ assertNotNull(certificate, "Expected non-NULL RSA certificate");
+ parcBuffer_Release(&privateKeyBuffer);
+ parcX509Certificate_Release(&certificate);
+}
+
LONGBOW_TEST_CASE(Global, parc_X509Certificate_CreateFromDERBuffer)
{
char *fileName = "test.pem";