ESAPI-C 1.0
The OWASP Enterprise Security API for C

test/src/test-crypto.c

Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include "minunit.h"
00003 #include "crypto.h"
00004 
00005 int tests_run = 0;
00006 
00007 void test_esapi_encrypt(void) 
00008 {
00009    (void)fprintf(stdout,"Testing %s\n", __func__);
00010 
00011    struct esapi_ctx *ctx = load_security_context("../configuration/ESAPI.properties");
00012 
00013    char *plaintext = "Hello";
00014    char *encrypted = esapi_encrypt(ctx, plaintext);
00015    printf("encrypted <%s>\n", encrypted);
00016    char *decrypted = esapi_encrypt(ctx, encrypted);
00017    printf("decrypted <%s>\n", decrypted);
00018 }
00019 
00020 
00021 int main(void) {
00022    test_esapi_encrypt();
00023    (void)fprintf(stdout, "%s: Pass <%i>, Fail<%i>\n", __FILE__, passed, failed);   
00024    return(EXIT_SUCCESS);
00025 }
 All Data Structures Files Functions Variables Typedefs Defines