Renamed x509parse_* functions to new form

e.g. x509parse_crtfile -> x509_crt_parse_file
diff --git a/include/polarssl/compat-1.2.h b/include/polarssl/compat-1.2.h
index 8b2a016..372f714 100644
--- a/include/polarssl/compat-1.2.h
+++ b/include/polarssl/compat-1.2.h
@@ -189,13 +189,13 @@
 #define POLARSSL_ERR_X509_CERT_INVALID_SERIAL POLARSSL_ERR_X509_INVALID_SERIAL
 #define POLARSSL_ERR_X509_CERT_UNKNOWN_VERSION POLARSSL_ERR_X509_UNKNOWN_VERSION
 
-int x509parse_serial_gets( char *buf, size_t size, const x509_buf *serial ) {
+inline int x509parse_serial_gets( char *buf, size_t size, const x509_buf *serial ) {
     return x509_serial_gets( buf, size, serial );
 }
-int x509parse_dn_gets( char *buf, size_t size, const x509_name *dn ) {
+inline int x509parse_dn_gets( char *buf, size_t size, const x509_name *dn ) {
     return x509_dn_gets( buf, size, dn );
 }
-int x509parse_time_expired( const x509_time *time ) {
+inline int x509parse_time_expired( const x509_time *time ) {
     return x509_time_expired( time );
 }
 #endif /* POLARSSL_X509_USE_C || POLARSSL_X509_CREATE_C */
@@ -203,12 +203,67 @@
 #if defined(POLARSSL_X509_CRT_PARSE_C)
 #define POLARSSL_X509_PARSE_C
 #include "x509_crt.h"
-
+inline int x509parse_crt_der( x509_cert *chain, const unsigned char *buf,
+                              size_t buflen ) {
+    return x509_crt_parse_der( chain, buf, buflen );
+}
+inline int x509parse_crt( x509_cert *chain, const unsigned char *buf, size_t buflen ) {
+    return x509_crt_parse( chain, buf, buflen );
+}
+inline int x509parse_crtfile( x509_cert *chain, const char *path ) {
+    return x509_crt_parse_file( chain, path );
+}
+inline int x509parse_crtpath( x509_cert *chain, const char *path ) {
+    return x509_crt_parse_path( chain, path );
+}
+inline int x509parse_cert_info( char *buf, size_t size, const char *prefix,
+                                const x509_cert *crt ) {
+    return x509_crt_info( buf, size, prefix, crt );
+}
+inline int x509parse_verify( x509_cert *crt, x509_cert *trust_ca,
+                             x509_crl *ca_crl, const char *cn, int *flags,
+                             int (*f_vrfy)(void *, x509_cert *, int, int *),
+                             void *p_vrfy ) {
+    return x509_crt_verify( crt, trust_ca, ca_crl, cn, flags, f_vrfy, p_vrfy );
+}
+inline int x509parse_revoked( const x509_cert *crt, const x509_crl *crl ) {
+    return x509_crt_revoked( crt, crl );
+}
 inline void x509_free( x509_cert *crt ) {
     return x509_crt_free( crt );
 }
 #endif /* POLARSSL_X509_CRT_PARSE_C */
 
+#if defined(POLARSSL_X509_CRL_PARSE_C)
+#define POLARSSL_X509_PARSE_C
+#include "x509_crl.h"
+inline int x509parse_crl( x509_crl *chain, const unsigned char *buf, size_t buflen ) {
+    return x509_crl_parse( chain, buf, buflen );
+}
+inline int x509parse_crlfile( x509_crl *chain, const char *path ) {
+    return x509_crl_parse_file( chain, path );
+}
+inline int x509parse_crl_info( char *buf, size_t size, const char *prefix,
+                               const x509_crl *crl ) {
+    return x509_crl_info( buf, size, prefix, crl );
+}
+#endif /* POLARSSL_X509_CRL_PARSE_C */
+
+#if defined(POLARSSL_X509_CSR_PARSE_C)
+#define POLARSSL_X509_PARSE_C
+#include "x509_csr.h"
+inline int x509parse_csr( x509_csr *csr, const unsigned char *buf, size_t buflen ) {
+    return x509_csr_parse( csr, buf, buflen );
+}
+inline int x509parse_csrfile( x509_csr *csr, const char *path ) {
+    return x509_csr_parse_file( csr, path );
+}
+inline int x509parse_csr_info( char *buf, size_t size, const char *prefix,
+                               const x509_csr *csr ) {
+    return x509_csr_info( buf, size, prefix, csr );
+}
+#endif /* POLARSSL_X509_CSR_PARSE_C */
+
 #if defined(POLARSSL_SSL_TLS_C)
 #include "ssl_ciphersuites.h"
 
diff --git a/include/polarssl/x509_crl.h b/include/polarssl/x509_crl.h
index 2bc7cd8..0c79916 100644
--- a/include/polarssl/x509_crl.h
+++ b/include/polarssl/x509_crl.h
@@ -104,7 +104,7 @@
  *
  * \return         0 if successful, or a specific X509 or PEM error code
  */
-int x509parse_crl( x509_crl *chain, const unsigned char *buf, size_t buflen );
+int x509_crl_parse( x509_crl *chain, const unsigned char *buf, size_t buflen );
 
 #if defined(POLARSSL_FS_IO)
 /**
@@ -116,12 +116,11 @@
  *
  * \return         0 if successful, or a specific X509 or PEM error code
  */
-int x509parse_crlfile( x509_crl *chain, const char *path );
+int x509_crl_parse_file( x509_crl *chain, const char *path );
 #endif /* POLARSSL_FS_IO */
 
 /**
- * \brief          Returns an informational string about the
- *                 CRL.
+ * \brief          Returns an informational string about the CRL.
  *
  * \param buf      Buffer to write to
  * \param size     Maximum size of buffer
@@ -131,8 +130,8 @@
  * \return         The amount of data written to the buffer, or -1 in
  *                 case of an error.
  */
-int x509parse_crl_info( char *buf, size_t size, const char *prefix,
-                        const x509_crl *crl );
+int x509_crl_info( char *buf, size_t size, const char *prefix,
+                   const x509_crl *crl );
 
 /**
  * \brief          Initialize a CRL (chain)
diff --git a/include/polarssl/x509_crt.h b/include/polarssl/x509_crt.h
index 6378191..9eff330 100644
--- a/include/polarssl/x509_crt.h
+++ b/include/polarssl/x509_crt.h
@@ -132,8 +132,8 @@
  *
  * \return         0 if successful, or a specific X509 or PEM error code
  */
-int x509parse_crt_der( x509_cert *chain, const unsigned char *buf,
-                       size_t buflen );
+int x509_crt_parse_der( x509_cert *chain, const unsigned char *buf,
+                        size_t buflen );
 
 /**
  * \brief          Parse one or more certificates and add them
@@ -149,7 +149,7 @@
  * \return         0 if all certificates parsed successfully, a positive number
  *                 if partly successful or a specific X509 or PEM error code
  */
-int x509parse_crt( x509_cert *chain, const unsigned char *buf, size_t buflen );
+int x509_crt_parse( x509_cert *chain, const unsigned char *buf, size_t buflen );
 
 #if defined(POLARSSL_FS_IO)
 /**
@@ -165,7 +165,7 @@
  * \return         0 if all certificates parsed successfully, a positive number
  *                 if partly successful or a specific X509 or PEM error code
  */
-int x509parse_crtfile( x509_cert *chain, const char *path );
+int x509_crt_parse_file( x509_cert *chain, const char *path );
 
 /**
  * \brief          Load one or more certificate files from a path and add them
@@ -180,7 +180,7 @@
  * \return         0 if all certificates parsed successfully, a positive number
  *                 if partly successful or a specific X509 or PEM error code
  */
-int x509parse_crtpath( x509_cert *chain, const char *path );
+int x509_crt_parse_path( x509_cert *chain, const char *path );
 #endif /* POLARSSL_FS_IO */
 
 /**
@@ -195,8 +195,8 @@
  * \return         The amount of data written to the buffer, or -1 in
  *                 case of an error.
  */
-int x509parse_cert_info( char *buf, size_t size, const char *prefix,
-                         const x509_cert *crt );
+int x509_crt_info( char *buf, size_t size, const char *prefix,
+                   const x509_cert *crt );
 
 /**
  * \brief          Verify the certificate signature
@@ -234,12 +234,12 @@
  *                 or another error in case of a fatal error encountered
  *                 during the verification process.
  */
-int x509parse_verify( x509_cert *crt,
-                      x509_cert *trust_ca,
-                      x509_crl *ca_crl,
-                      const char *cn, int *flags,
-                      int (*f_vrfy)(void *, x509_cert *, int, int *),
-                      void *p_vrfy );
+int x509_crt_verify( x509_cert *crt,
+                     x509_cert *trust_ca,
+                     x509_crl *ca_crl,
+                     const char *cn, int *flags,
+                     int (*f_vrfy)(void *, x509_cert *, int, int *),
+                     void *p_vrfy );
 
 #if defined(POLARSSL_X509_CRL_PARSE_C)
 /**
@@ -251,7 +251,7 @@
  * \return         1 if the certificate is revoked, 0 otherwise
  *
  */
-int x509parse_revoked( const x509_cert *crt, const x509_crl *crl );
+int x509_crt_revoked( const x509_cert *crt, const x509_crl *crl );
 #endif /* POLARSSL_X509_CRL_PARSE_C */
 
 /**
diff --git a/include/polarssl/x509_csr.h b/include/polarssl/x509_csr.h
index 5b4b1ba..30ef7c5 100644
--- a/include/polarssl/x509_csr.h
+++ b/include/polarssl/x509_csr.h
@@ -88,7 +88,7 @@
  *
  * \return         0 if successful, or a specific X509 or PEM error code
  */
-int x509parse_csr( x509_csr *csr, const unsigned char *buf, size_t buflen );
+int x509_csr_parse( x509_csr *csr, const unsigned char *buf, size_t buflen );
 
 #if defined(POLARSSL_FS_IO)
 /**
@@ -99,7 +99,7 @@
  *
  * \return         0 if successful, or a specific X509 or PEM error code
  */
-int x509parse_csrfile( x509_csr *csr, const char *path );
+int x509_csr_parse_file( x509_csr *csr, const char *path );
 #endif /* POLARSSL_FS_IO */
 
 /**
@@ -114,8 +114,8 @@
  * \return         The amount of data written to the buffer, or -1 in
  *                 case of an error.
  */
-int x509parse_csr_info( char *buf, size_t size, const char *prefix,
-                        const x509_csr *csr );
+int x509_csr_info( char *buf, size_t size, const char *prefix,
+                   const x509_csr *csr );
 
 /**
  * \brief          Initialize a CSR
diff --git a/library/debug.c b/library/debug.c
index 1c7eeb6..608c434 100644
--- a/library/debug.c
+++ b/library/debug.c
@@ -275,7 +275,7 @@
     while( crt != NULL )
     {
         char buf[1024];
-        x509parse_cert_info( buf, sizeof( buf ) - 1, prefix, crt );
+        x509_crt_info( buf, sizeof( buf ) - 1, prefix, crt );
 
         snprintf( str, maxlen, "%s(%04d): %s #%d:\n%s",
                   file, line, text, ++i, buf );
diff --git a/library/ssl_cache.c b/library/ssl_cache.c
index 3090dc0..a7df823 100644
--- a/library/ssl_cache.c
+++ b/library/ssl_cache.c
@@ -96,8 +96,8 @@
                 return( 1 );
 
             memset( session->peer_cert, 0, sizeof(x509_cert) );
-            if( x509parse_crt( session->peer_cert, entry->peer_cert.p,
-                               entry->peer_cert.len ) != 0 )
+            if( x509_crt_parse( session->peer_cert, entry->peer_cert.p,
+                                entry->peer_cert.len ) != 0 )
             {
                 polarssl_free( session->peer_cert );
                 session->peer_cert = NULL;
diff --git a/library/ssl_srv.c b/library/ssl_srv.c
index 28d3a6c..9f18d6d 100644
--- a/library/ssl_srv.c
+++ b/library/ssl_srv.c
@@ -142,7 +142,7 @@
 
         memset( session->peer_cert, 0, sizeof( x509_cert ) );
 
-        if( ( ret = x509parse_crt( session->peer_cert, p, cert_len ) ) != 0 )
+        if( ( ret = x509_crt_parse( session->peer_cert, p, cert_len ) ) != 0 )
         {
             x509_crt_free( session->peer_cert );
             polarssl_free( session->peer_cert );
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index d0534af..06abe59 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -85,8 +85,8 @@
 
         memset( dst->peer_cert, 0, sizeof(x509_cert) );
 
-        if( ( ret = x509parse_crt( dst->peer_cert, src->peer_cert->raw.p,
-                                   src->peer_cert->raw.len ) != 0 ) )
+        if( ( ret = x509_crt_parse( dst->peer_cert, src->peer_cert->raw.p,
+                                    src->peer_cert->raw.len ) != 0 ) )
         {
             polarssl_free( dst->peer_cert );
             dst->peer_cert = NULL;
@@ -2516,11 +2516,11 @@
             return( POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE );
         }
 
-        ret = x509parse_crt_der( ssl->session_negotiate->peer_cert,
-                                 ssl->in_msg + i, n );
+        ret = x509_crt_parse_der( ssl->session_negotiate->peer_cert,
+                                  ssl->in_msg + i, n );
         if( ret != 0 )
         {
-            SSL_DEBUG_RET( 1, " x509parse_crt", ret );
+            SSL_DEBUG_RET( 1, " x509_crt_parse_der", ret );
             return( ret );
         }
 
@@ -2537,10 +2537,10 @@
             return( POLARSSL_ERR_SSL_CA_CHAIN_REQUIRED );
         }
 
-        ret = x509parse_verify( ssl->session_negotiate->peer_cert,
-                                ssl->ca_chain, ssl->ca_crl, ssl->peer_cn,
-                               &ssl->session_negotiate->verify_result,
-                                ssl->f_vrfy, ssl->p_vrfy );
+        ret = x509_crt_verify( ssl->session_negotiate->peer_cert,
+                               ssl->ca_chain, ssl->ca_crl, ssl->peer_cn,
+                              &ssl->session_negotiate->verify_result,
+                               ssl->f_vrfy, ssl->p_vrfy );
 
         if( ret != 0 )
             SSL_DEBUG_RET( 1, "x509_verify_cert", ret );
diff --git a/library/x509.c b/library/x509.c
index 7f6483e..c5209b6 100644
--- a/library/x509.c
+++ b/library/x509.c
@@ -710,8 +710,8 @@
 
     memset( &clicert, 0, sizeof( x509_cert ) );
 
-    ret = x509parse_crt( &clicert, (const unsigned char *) test_cli_crt,
-                         strlen( test_cli_crt ) );
+    ret = x509_crt_parse( &clicert, (const unsigned char *) test_cli_crt,
+                          strlen( test_cli_crt ) );
     if( ret != 0 )
     {
         if( verbose != 0 )
@@ -722,8 +722,8 @@
 
     memset( &cacert, 0, sizeof( x509_cert ) );
 
-    ret = x509parse_crt( &cacert, (const unsigned char *) test_ca_crt,
-                         strlen( test_ca_crt ) );
+    ret = x509_crt_parse( &cacert, (const unsigned char *) test_ca_crt,
+                          strlen( test_ca_crt ) );
     if( ret != 0 )
     {
         if( verbose != 0 )
@@ -735,7 +735,7 @@
     if( verbose != 0 )
         printf( "passed\n  X.509 signature verify: ");
 
-    ret = x509parse_verify( &clicert, &cacert, NULL, NULL, &flags, NULL, NULL );
+    ret = x509_crt_verify( &clicert, &cacert, NULL, NULL, &flags, NULL, NULL );
     if( ret != 0 )
     {
         if( verbose != 0 )
diff --git a/library/x509_crl.c b/library/x509_crl.c
index e327726..00d51bd 100644
--- a/library/x509_crl.c
+++ b/library/x509_crl.c
@@ -243,7 +243,7 @@
 /*
  * Parse one or more CRLs and add them to the chained list
  */
-int x509parse_crl( x509_crl *chain, const unsigned char *buf, size_t buflen )
+int x509_crl_parse( x509_crl *chain, const unsigned char *buf, size_t buflen )
 {
     int ret;
     size_t len;
@@ -516,7 +516,7 @@
         crl = crl->next;
         x509_crl_init( crl );
 
-        return( x509parse_crl( crl, buf, buflen ) );
+        return( x509_crl_parse( crl, buf, buflen ) );
     }
 
     return( 0 );
@@ -526,7 +526,7 @@
 /*
  * Load one or more CRLs and add them to the chained list
  */
-int x509parse_crlfile( x509_crl *chain, const char *path )
+int x509_crl_parse_file( x509_crl *chain, const char *path )
 {
     int ret;
     size_t n;
@@ -535,7 +535,7 @@
     if ( ( ret = x509_load_file( path, &buf, &n ) ) != 0 )
         return( ret );
 
-    ret = x509parse_crl( chain, buf, n );
+    ret = x509_crl_parse( chain, buf, n );
 
     memset( buf, 0, n + 1 );
     polarssl_free( buf );
@@ -603,8 +603,8 @@
 /*
  * Return an informational string about the CRL.
  */
-int x509parse_crl_info( char *buf, size_t size, const char *prefix,
-                        const x509_crl *crl )
+int x509_crl_info( char *buf, size_t size, const char *prefix,
+                   const x509_crl *crl )
 {
     int ret;
     size_t n;
diff --git a/library/x509_crt.c b/library/x509_crt.c
index f73724e..aa43768 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -515,8 +515,8 @@
 /*
  * Parse and fill a single X.509 certificate in DER format
  */
-static int x509parse_crt_der_core( x509_cert *crt, const unsigned char *buf,
-                                   size_t buflen )
+static int x509_crt_parse_der_core( x509_cert *crt, const unsigned char *buf,
+                                    size_t buflen )
 {
     int ret;
     size_t len;
@@ -756,7 +756,8 @@
  * Parse one X.509 certificate in DER format from a buffer and add them to a
  * chained list
  */
-int x509parse_crt_der( x509_cert *chain, const unsigned char *buf, size_t buflen )
+int x509_crt_parse_der( x509_cert *chain, const unsigned char *buf,
+                        size_t buflen )
 {
     int ret;
     x509_cert *crt = chain, *prev = NULL;
@@ -788,7 +789,7 @@
         x509_crt_init( crt );
     }
 
-    if( ( ret = x509parse_crt_der_core( crt, buf, buflen ) ) != 0 )
+    if( ( ret = x509_crt_parse_der_core( crt, buf, buflen ) ) != 0 )
     {
         if( prev )
             prev->next = NULL;
@@ -805,7 +806,7 @@
 /*
  * Parse one or more PEM certificates from a buffer and add them to the chained list
  */
-int x509parse_crt( x509_cert *chain, const unsigned char *buf, size_t buflen )
+int x509_crt_parse( x509_cert *chain, const unsigned char *buf, size_t buflen )
 {
     int success = 0, first_error = 0, total_failed = 0;
     int buf_format = X509_FORMAT_DER;
@@ -826,7 +827,7 @@
 #endif
 
     if( buf_format == X509_FORMAT_DER )
-        return x509parse_crt_der( chain, buf, buflen );
+        return x509_crt_parse_der( chain, buf, buflen );
 
 #if defined(POLARSSL_PEM_PARSE_C)
     if( buf_format == X509_FORMAT_PEM )
@@ -874,7 +875,7 @@
             else
                 break;
 
-            ret = x509parse_crt_der( chain, pem.buf, pem.buflen );
+            ret = x509_crt_parse_der( chain, pem.buf, pem.buflen );
 
             pem_free( &pem );
 
@@ -910,7 +911,7 @@
 /*
  * Load one or more certificates and add them to the chained list
  */
-int x509parse_crtfile( x509_cert *chain, const char *path )
+int x509_crt_parse_file( x509_cert *chain, const char *path )
 {
     int ret;
     size_t n;
@@ -919,7 +920,7 @@
     if ( ( ret = x509_load_file( path, &buf, &n ) ) != 0 )
         return( ret );
 
-    ret = x509parse_crt( chain, buf, n );
+    ret = x509_crt_parse( chain, buf, n );
 
     memset( buf, 0, n + 1 );
     polarssl_free( buf );
@@ -927,7 +928,7 @@
     return( ret );
 }
 
-int x509parse_crtpath( x509_cert *chain, const char *path )
+int x509_crt_parse_path( x509_cert *chain, const char *path )
 {
     int ret = 0;
 #if defined(_WIN32)
@@ -969,7 +970,7 @@
 									 p, len - 1,
 									 NULL, NULL );
 
-        w_ret = x509parse_crtfile( chain, filename );
+        w_ret = x509_crt_parse_file( chain, filename );
         if( w_ret < 0 )
             ret++;
         else
@@ -1012,7 +1013,7 @@
 
         // Ignore parse errors
         //
-        t_ret = x509parse_crtfile( chain, entry_name );
+        t_ret = x509_crt_parse_file( chain, entry_name );
         if( t_ret < 0 )
             ret++;
         else
@@ -1081,8 +1082,8 @@
  */
 #define BEFORE_COLON    14
 #define BC              "14"
-int x509parse_cert_info( char *buf, size_t size, const char *prefix,
-                         const x509_cert *crt )
+int x509_crt_info( char *buf, size_t size, const char *prefix,
+                   const x509_cert *crt )
 {
     int ret;
     size_t n;
@@ -1154,7 +1155,7 @@
 /*
  * Return 1 if the certificate is revoked, or 0 otherwise.
  */
-int x509parse_revoked( const x509_cert *crt, const x509_crl *crl )
+int x509_crt_revoked( const x509_cert *crt, const x509_crl *crl )
 {
     const x509_crl_entry *cur = &crl->entry;
 
@@ -1176,8 +1177,8 @@
 /*
  * Check that the given certificate is valid accoring to the CRL.
  */
-static int x509parse_verifycrl(x509_cert *crt, x509_cert *ca,
-        x509_crl *crl_list)
+static int x509_crt_verifycrl( x509_cert *crt, x509_cert *ca,
+                               x509_crl *crl_list)
 {
     int flags = 0;
     unsigned char hash[POLARSSL_MD_MAX_SIZE];
@@ -1235,7 +1236,7 @@
         /*
          * Check if certificate is revoked
          */
-        if( x509parse_revoked(crt, crl_list) )
+        if( x509_crt_revoked(crt, crl_list) )
         {
             flags |= BADCERT_REVOKED;
             break;
@@ -1299,7 +1300,7 @@
     return( 0 );
 }
 
-static int x509parse_verify_top(
+static int x509_crt_verify_top(
                 x509_cert *child, x509_cert *trust_ca,
                 x509_crl *ca_crl, int path_cnt, int *flags,
                 int (*f_vrfy)(void *, x509_cert *, int, int *),
@@ -1385,7 +1386,7 @@
     {
 #if defined(POLARSSL_X509_CRL_PARSE_C)
         /* Check trusted CA's CRL for the chain's top crt */
-        *flags |= x509parse_verifycrl( child, trust_ca, ca_crl );
+        *flags |= x509_crt_verifycrl( child, trust_ca, ca_crl );
 #endif
 
         if( x509_time_expired( &trust_ca->valid_to ) )
@@ -1410,7 +1411,7 @@
     return( 0 );
 }
 
-static int x509parse_verify_child(
+static int x509_crt_verify_child(
                 x509_cert *child, x509_cert *parent, x509_cert *trust_ca,
                 x509_crl *ca_crl, int path_cnt, int *flags,
                 int (*f_vrfy)(void *, x509_cert *, int, int *),
@@ -1447,7 +1448,7 @@
 
 #if defined(POLARSSL_X509_CRL_PARSE_C)
     /* Check trusted CA's CRL for the given crt */
-    *flags |= x509parse_verifycrl(child, parent, ca_crl);
+    *flags |= x509_crt_verifycrl(child, parent, ca_crl);
 #endif
 
     grandparent = parent->next;
@@ -1471,13 +1472,13 @@
         /*
          * Part of the chain
          */
-        ret = x509parse_verify_child( parent, grandparent, trust_ca, ca_crl, path_cnt + 1, &parent_flags, f_vrfy, p_vrfy );
+        ret = x509_crt_verify_child( parent, grandparent, trust_ca, ca_crl, path_cnt + 1, &parent_flags, f_vrfy, p_vrfy );
         if( ret != 0 )
             return( ret );
     }
     else
     {
-        ret = x509parse_verify_top( parent, trust_ca, ca_crl, path_cnt + 1, &parent_flags, f_vrfy, p_vrfy );
+        ret = x509_crt_verify_top( parent, trust_ca, ca_crl, path_cnt + 1, &parent_flags, f_vrfy, p_vrfy );
         if( ret != 0 )
             return( ret );
     }
@@ -1495,12 +1496,12 @@
 /*
  * Verify the certificate validity
  */
-int x509parse_verify( x509_cert *crt,
-                      x509_cert *trust_ca,
-                      x509_crl *ca_crl,
-                      const char *cn, int *flags,
-                      int (*f_vrfy)(void *, x509_cert *, int, int *),
-                      void *p_vrfy )
+int x509_crt_verify( x509_cert *crt,
+                     x509_cert *trust_ca,
+                     x509_crl *ca_crl,
+                     const char *cn, int *flags,
+                     int (*f_vrfy)(void *, x509_cert *, int, int *),
+                     void *p_vrfy )
 {
     size_t cn_len;
     int ret;
@@ -1585,13 +1586,13 @@
         /*
          * Part of the chain
          */
-        ret = x509parse_verify_child( crt, parent, trust_ca, ca_crl, pathlen, flags, f_vrfy, p_vrfy );
+        ret = x509_crt_verify_child( crt, parent, trust_ca, ca_crl, pathlen, flags, f_vrfy, p_vrfy );
         if( ret != 0 )
             return( ret );
     }
     else
     {
-        ret = x509parse_verify_top( crt, trust_ca, ca_crl, pathlen, flags, f_vrfy, p_vrfy );
+        ret = x509_crt_verify_top( crt, trust_ca, ca_crl, pathlen, flags, f_vrfy, p_vrfy );
         if( ret != 0 )
             return( ret );
     }
diff --git a/library/x509_csr.c b/library/x509_csr.c
index 65bc63c..91ddb1f 100644
--- a/library/x509_csr.c
+++ b/library/x509_csr.c
@@ -87,7 +87,7 @@
 /*
  * Parse a CSR
  */
-int x509parse_csr( x509_csr *csr, const unsigned char *buf, size_t buflen )
+int x509_csr_parse( x509_csr *csr, const unsigned char *buf, size_t buflen )
 {
     int ret;
     size_t len;
@@ -287,7 +287,7 @@
 /*
  * Load a CSR into the structure
  */
-int x509parse_csrfile( x509_csr *csr, const char *path )
+int x509_csr_parse_file( x509_csr *csr, const char *path )
 {
     int ret;
     size_t n;
@@ -296,7 +296,7 @@
     if ( ( ret = x509_load_file( path, &buf, &n ) ) != 0 )
         return( ret );
 
-    ret = x509parse_csr( csr, buf, n );
+    ret = x509_csr_parse( csr, buf, n );
 
     memset( buf, 0, n + 1 );
     polarssl_free( buf );
@@ -361,8 +361,8 @@
 /*
  * Return an informational string about the CSR.
  */
-int x509parse_csr_info( char *buf, size_t size, const char *prefix,
-                        const x509_csr *csr )
+int x509_csr_info( char *buf, size_t size, const char *prefix,
+                   const x509_csr *csr )
 {
     int ret;
     size_t n;
diff --git a/programs/ssl/ssl_client1.c b/programs/ssl/ssl_client1.c
index da4fe82..cc935b4 100644
--- a/programs/ssl/ssl_client1.c
+++ b/programs/ssl/ssl_client1.c
@@ -113,8 +113,8 @@
     fflush( stdout );
 
 #if defined(POLARSSL_CERTS_C)
-    ret = x509parse_crt( &cacert, (const unsigned char *) test_ca_crt,
-                         strlen( test_ca_crt ) );
+    ret = x509_crt_parse( &cacert, (const unsigned char *) test_ca_crt,
+                          strlen( test_ca_crt ) );
 #else
     ret = 1;
     printf("POLARSSL_CERTS_C not defined.");
@@ -122,7 +122,7 @@
 
     if( ret < 0 )
     {
-        printf( " failed\n  !  x509parse_crt returned -0x%x\n\n", -ret );
+        printf( " failed\n  !  x509_crt_parse returned -0x%x\n\n", -ret );
         goto exit;
     }
 
diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c
index d5e43f6..b342349 100644
--- a/programs/ssl/ssl_client2.c
+++ b/programs/ssl/ssl_client2.c
@@ -121,7 +121,7 @@
     ((void) data);
 
     printf( "\nVerify requested for (Depth %d):\n", depth );
-    x509parse_cert_info( buf, sizeof( buf ) - 1, "", crt );
+    x509_crt_info( buf, sizeof( buf ) - 1, "", crt );
     printf( "%s", buf );
 
     if( ( (*flags) & BADCERT_EXPIRED ) != 0 )
@@ -574,13 +574,13 @@
 
 #if defined(POLARSSL_FS_IO)
     if( strlen( opt.ca_path ) )
-        ret = x509parse_crtpath( &cacert, opt.ca_path );
+        ret = x509_crt_parse_path( &cacert, opt.ca_path );
     else if( strlen( opt.ca_file ) )
-        ret = x509parse_crtfile( &cacert, opt.ca_file );
+        ret = x509_crt_parse_file( &cacert, opt.ca_file );
     else
 #endif
 #if defined(POLARSSL_CERTS_C)
-        ret = x509parse_crt( &cacert, (const unsigned char *) test_ca_crt,
+        ret = x509_crt_parse( &cacert, (const unsigned char *) test_ca_crt,
                 strlen( test_ca_crt ) );
 #else
     {
@@ -590,7 +590,7 @@
 #endif
     if( ret < 0 )
     {
-        printf( " failed\n  !  x509parse_crt returned -0x%x\n\n", -ret );
+        printf( " failed\n  !  x509_crt_parse returned -0x%x\n\n", -ret );
         goto exit;
     }
 
@@ -606,11 +606,11 @@
 
 #if defined(POLARSSL_FS_IO)
     if( strlen( opt.crt_file ) )
-        ret = x509parse_crtfile( &clicert, opt.crt_file );
+        ret = x509_crt_parse_file( &clicert, opt.crt_file );
     else
 #endif
 #if defined(POLARSSL_CERTS_C)
-        ret = x509parse_crt( &clicert, (const unsigned char *) test_cli_crt,
+        ret = x509_crt_parse( &clicert, (const unsigned char *) test_cli_crt,
                 strlen( test_cli_crt ) );
 #else
     {
@@ -620,7 +620,7 @@
 #endif
     if( ret != 0 )
     {
-        printf( " failed\n  !  x509parse_crt returned -0x%x\n\n", -ret );
+        printf( " failed\n  !  x509_crt_parse returned -0x%x\n\n", -ret );
         goto exit;
     }
 
@@ -790,8 +790,8 @@
     if( ssl_get_peer_cert( &ssl ) != NULL )
     {
         printf( "  . Peer certificate information    ...\n" );
-        x509parse_cert_info( (char *) buf, sizeof( buf ) - 1, "      ",
-                             ssl_get_peer_cert( &ssl ) );
+        x509_crt_info( (char *) buf, sizeof( buf ) - 1, "      ",
+                       ssl_get_peer_cert( &ssl ) );
         printf( "%s\n", buf );
     }
 #endif /* POLARSSL_X509_CRT_PARSE_C */
diff --git a/programs/ssl/ssl_fork_server.c b/programs/ssl/ssl_fork_server.c
index df75d92..724bf2f 100644
--- a/programs/ssl/ssl_fork_server.c
+++ b/programs/ssl/ssl_fork_server.c
@@ -138,22 +138,22 @@
 
     /*
      * This demonstration program uses embedded test certificates.
-     * Instead, you may want to use x509parse_crtfile() to read the
-     * server and CA certificates, as well as x509parse_keyfile().
+     * Instead, you may want to use x509_crt_parse_file() to read the
+     * server and CA certificates, as well as pk_parse_keyfile().
      */
-    ret = x509parse_crt( &srvcert, (const unsigned char *) test_srv_crt,
-                         strlen( test_srv_crt ) );
+    ret = x509_crt_parse( &srvcert, (const unsigned char *) test_srv_crt,
+                          strlen( test_srv_crt ) );
     if( ret != 0 )
     {
-        printf( " failed\n  !  x509parse_crt returned %d\n\n", ret );
+        printf( " failed\n  !  x509_crt_parse returned %d\n\n", ret );
         goto exit;
     }
 
-    ret = x509parse_crt( &srvcert, (const unsigned char *) test_ca_crt,
-                         strlen( test_ca_crt ) );
+    ret = x509_crt_parse( &srvcert, (const unsigned char *) test_ca_crt,
+                          strlen( test_ca_crt ) );
     if( ret != 0 )
     {
-        printf( " failed\n  !  x509parse_crt returned %d\n\n", ret );
+        printf( " failed\n  !  x509_crt_parse returned %d\n\n", ret );
         goto exit;
     }
 
diff --git a/programs/ssl/ssl_mail_client.c b/programs/ssl/ssl_mail_client.c
index a95e2da..970d553 100644
--- a/programs/ssl/ssl_mail_client.c
+++ b/programs/ssl/ssl_mail_client.c
@@ -173,8 +173,8 @@
         printf( " ok\n" );
 
     printf( "  . Peer certificate information    ...\n" );
-    x509parse_cert_info( (char *) buf, sizeof( buf ) - 1, "      ",
-                         ssl_get_peer_cert( ssl ) );
+    x509_crt_info( (char *) buf, sizeof( buf ) - 1, "      ",
+                   ssl_get_peer_cert( ssl ) );
     printf( "%s\n", buf );
 
     return( 0 );
@@ -483,12 +483,12 @@
 
 #if defined(POLARSSL_FS_IO)
     if( strlen( opt.ca_file ) )
-        ret = x509parse_crtfile( &cacert, opt.ca_file );
+        ret = x509_crt_parse_file( &cacert, opt.ca_file );
     else
 #endif
 #if defined(POLARSSL_CERTS_C)
-        ret = x509parse_crt( &cacert, (const unsigned char *) test_ca_crt,
-                strlen( test_ca_crt ) );
+        ret = x509_crt_parse( &cacert, (const unsigned char *) test_ca_crt,
+                              strlen( test_ca_crt ) );
 #else
     {
         ret = 1;
@@ -497,7 +497,7 @@
 #endif
     if( ret < 0 )
     {
-        printf( " failed\n  !  x509parse_crt returned %d\n\n", ret );
+        printf( " failed\n  !  x509_crt_parse returned %d\n\n", ret );
         goto exit;
     }
 
@@ -513,12 +513,12 @@
 
 #if defined(POLARSSL_FS_IO)
     if( strlen( opt.crt_file ) )
-        ret = x509parse_crtfile( &clicert, opt.crt_file );
-    else 
+        ret = x509_crt_parse_file( &clicert, opt.crt_file );
+    else
 #endif
 #if defined(POLARSSL_CERTS_C)
-        ret = x509parse_crt( &clicert, (const unsigned char *) test_cli_crt,
-                strlen( test_cli_crt ) );
+        ret = x509_crt_parse( &clicert, (const unsigned char *) test_cli_crt,
+                              strlen( test_cli_crt ) );
 #else
     {
         ret = -1;
@@ -527,7 +527,7 @@
 #endif
     if( ret != 0 )
     {
-        printf( " failed\n  !  x509parse_crt returned %d\n\n", ret );
+        printf( " failed\n  !  x509_crt_parse returned %d\n\n", ret );
         goto exit;
     }
 
diff --git a/programs/ssl/ssl_server.c b/programs/ssl/ssl_server.c
index 1929c9e..2b10923 100644
--- a/programs/ssl/ssl_server.c
+++ b/programs/ssl/ssl_server.c
@@ -118,22 +118,22 @@
 
     /*
      * This demonstration program uses embedded test certificates.
-     * Instead, you may want to use x509parse_crtfile() to read the
-     * server and CA certificates, as well as x509parse_keyfile().
+     * Instead, you may want to use x509_crt_parse_file() to read the
+     * server and CA certificates, as well as pk_parse_keyfile().
      */
-    ret = x509parse_crt( &srvcert, (const unsigned char *) test_srv_crt,
-                         strlen( test_srv_crt ) );
+    ret = x509_crt_parse( &srvcert, (const unsigned char *) test_srv_crt,
+                          strlen( test_srv_crt ) );
     if( ret != 0 )
     {
-        printf( " failed\n  !  x509parse_crt returned %d\n\n", ret );
+        printf( " failed\n  !  x509_crt_parse returned %d\n\n", ret );
         goto exit;
     }
 
-    ret = x509parse_crt( &srvcert, (const unsigned char *) test_ca_crt,
-                         strlen( test_ca_crt ) );
+    ret = x509_crt_parse( &srvcert, (const unsigned char *) test_ca_crt,
+                          strlen( test_ca_crt ) );
     if( ret != 0 )
     {
-        printf( " failed\n  !  x509parse_crt returned %d\n\n", ret );
+        printf( " failed\n  !  x509_crt_parse returned %d\n\n", ret );
         goto exit;
     }
 
diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c
index b024e4b..3a18e13 100644
--- a/programs/ssl/ssl_server2.c
+++ b/programs/ssl/ssl_server2.c
@@ -525,14 +525,14 @@
 
 #if defined(POLARSSL_FS_IO)
     if( strlen( opt.ca_path ) )
-        ret = x509parse_crtpath( &cacert, opt.ca_path );
+        ret = x509_crt_parse_path( &cacert, opt.ca_path );
     else if( strlen( opt.ca_file ) )
-        ret = x509parse_crtfile( &cacert, opt.ca_file );
-    else 
+        ret = x509_crt_parse_file( &cacert, opt.ca_file );
+    else
 #endif
 #if defined(POLARSSL_CERTS_C)
-        ret = x509parse_crt( &cacert, (const unsigned char *) test_ca_crt,
-                strlen( test_ca_crt ) );
+        ret = x509_crt_parse( &cacert, (const unsigned char *) test_ca_crt,
+                              strlen( test_ca_crt ) );
 #else
     {
         ret = 1;
@@ -541,7 +541,7 @@
 #endif
     if( ret < 0 )
     {
-        printf( " failed\n  !  x509parse_crt returned -0x%x\n\n", -ret );
+        printf( " failed\n  !  x509_crt_parse returned -0x%x\n\n", -ret );
         goto exit;
     }
 
@@ -555,12 +555,12 @@
 
 #if defined(POLARSSL_FS_IO)
     if( strlen( opt.crt_file ) )
-        ret = x509parse_crtfile( &srvcert, opt.crt_file );
-    else 
+        ret = x509_crt_parse_file( &srvcert, opt.crt_file );
+    else
 #endif
 #if defined(POLARSSL_CERTS_C)
-        ret = x509parse_crt( &srvcert, (const unsigned char *) test_srv_crt,
-                strlen( test_srv_crt ) );
+        ret = x509_crt_parse( &srvcert, (const unsigned char *) test_srv_crt,
+                              strlen( test_srv_crt ) );
 #else
     {
         ret = 1;
@@ -569,7 +569,7 @@
 #endif
     if( ret != 0 )
     {
-        printf( " failed\n  !  x509parse_crt returned -0x%x\n\n", -ret );
+        printf( " failed\n  !  x509_crt_parse returned -0x%x\n\n", -ret );
         goto exit;
     }
 
@@ -777,8 +777,8 @@
     if( ssl_get_peer_cert( &ssl ) )
     {
         printf( "  . Peer certificate information    ...\n" );
-        x509parse_cert_info( (char *) buf, sizeof( buf ) - 1, "      ",
-                             ssl_get_peer_cert( &ssl ) );
+        x509_crt_info( (char *) buf, sizeof( buf ) - 1, "      ",
+                       ssl_get_peer_cert( &ssl ) );
         printf( "%s\n", buf );
     }
 #endif /* POLARSSL_X509_CRT_PARSE_C */
diff --git a/programs/test/ssl_cert_test.c b/programs/test/ssl_cert_test.c
index 9b58a6d..81d81ed 100644
--- a/programs/test/ssl_cert_test.c
+++ b/programs/test/ssl_cert_test.c
@@ -100,18 +100,18 @@
 
     /*
      * Alternatively, you may load the CA certificates from a .pem or
-     * .crt file by calling x509parse_crtfile( &cacert, "myca.crt" ).
+     * .crt file by calling x509_crt_parse_file( &cacert, "myca.crt" ).
      */
-    ret = x509parse_crtfile( &cacert, "ssl/test-ca/test-ca.crt" );
+    ret = x509_crt_parse_file( &cacert, "ssl/test-ca/test-ca.crt" );
     if( ret != 0 )
     {
-        printf( " failed\n  !  x509parse_crtfile returned %d\n\n", ret );
+        printf( " failed\n  !  x509_crt_parse_file returned %d\n\n", ret );
         goto exit;
     }
 
     printf( " ok\n" );
 
-    x509parse_cert_info( buf, 1024, "CRT: ", &cacert );
+    x509_crt_info( buf, 1024, "CRT: ", &cacert );
     printf("%s\n", buf );
 
     /*
@@ -120,16 +120,16 @@
     printf( "  . Loading the CRL ..." );
     fflush( stdout );
 
-    ret = x509parse_crlfile( &crl, "ssl/test-ca/crl.pem" );
+    ret = x509_crl_parse_file( &crl, "ssl/test-ca/crl.pem" );
     if( ret != 0 )
     {
-        printf( " failed\n  !  x509parse_crlfile returned %d\n\n", ret );
+        printf( " failed\n  !  x509_crl_parse_file returned %d\n\n", ret );
         goto exit;
     }
 
     printf( " ok\n" );
 
-    x509parse_crl_info( buf, 1024, "CRL: ", &crl );
+    x509_crl_info( buf, 1024, "CRL: ", &crl );
     printf("%s\n", buf );
 
     for( i = 0; i < MAX_CLIENT_CERTS; i++ )
@@ -150,10 +150,10 @@
         printf( "  . Loading the client certificate %s...", name );
         fflush( stdout );
 
-        ret = x509parse_crtfile( &clicert, name );
+        ret = x509_crt_parse_file( &clicert, name );
         if( ret != 0 )
         {
-            printf( " failed\n  !  x509parse_crt returned %d\n\n", ret );
+            printf( " failed\n  !  x509_crt_parse_file returned %d\n\n", ret );
             goto exit;
         }
 
@@ -165,7 +165,8 @@
         printf( "  . Verify the client certificate with CA certificate..." );
         fflush( stdout );
 
-        ret = x509parse_verify( &clicert, &cacert, &crl, NULL, &flags, NULL, NULL );
+        ret = x509_crt_verify( &clicert, &cacert, &crl, NULL, &flags, NULL,
+                               NULL );
         if( ret != 0 )
         {
             if( ret == POLARSSL_ERR_X509_CERT_VERIFY_FAILED )
@@ -183,7 +184,7 @@
                 if( flags & BADCRL_EXPIRED )
                     printf( " CRL_EXPIRED " );
             } else {
-                printf( " failed\n  !  x509parse_verify returned %d\n\n", ret );
+                printf( " failed\n  !  x509_crt_verify returned %d\n\n", ret );
                 goto exit;
             }
         }
diff --git a/programs/test/ssl_test.c b/programs/test/ssl_test.c
index 1677aa9..eba3483 100644
--- a/programs/test/ssl_test.c
+++ b/programs/test/ssl_test.c
@@ -214,19 +214,19 @@
         printf("POLARSSL_CERTS_C not defined.\n");
         goto exit;
 #else
-        ret =  x509parse_crt( &srvcert, (const unsigned char *) test_srv_crt,
-                              strlen( test_srv_crt ) );
+        ret =  x509_crt_parse( &srvcert, (const unsigned char *) test_srv_crt,
+                               strlen( test_srv_crt ) );
         if( ret != 0 )
         {
-            printf( "  !  x509parse_crt returned %d\n\n", ret );
+            printf( "  !  x509_crt_parse returned %d\n\n", ret );
             goto exit;
         }
 
-        ret =  x509parse_crt( &srvcert, (const unsigned char *) test_ca_crt,
-                              strlen( test_ca_crt ) );
+        ret =  x509_crt_parse( &srvcert, (const unsigned char *) test_ca_crt,
+                               strlen( test_ca_crt ) );
         if( ret != 0 )
         {
-            printf( "  !  x509parse_crt returned %d\n\n", ret );
+            printf( "  !  x509_crt_parse returned %d\n\n", ret );
             goto exit;
         }
 
diff --git a/programs/x509/cert_app.c b/programs/x509/cert_app.c
index 160e65d..eff906d 100644
--- a/programs/x509/cert_app.c
+++ b/programs/x509/cert_app.c
@@ -101,7 +101,7 @@
     ((void) data);
 
     printf( "\nVerify requested for (Depth %d):\n", depth );
-    x509parse_cert_info( buf, sizeof( buf ) - 1, "", crt );
+    x509_crt_info( buf, sizeof( buf ) - 1, "", crt );
     printf( "%s", buf );
 
     if( ( (*flags) & BADCERT_EXPIRED ) != 0 )
@@ -248,18 +248,18 @@
 
     if( strlen( opt.ca_path ) )
     {
-        ret = x509parse_crtpath( &cacert, opt.ca_path );
+        ret = x509_crt_parse_path( &cacert, opt.ca_path );
         verify = 1;
     }
     else if( strlen( opt.ca_file ) )
     {
-        ret = x509parse_crtfile( &cacert, opt.ca_file );
+        ret = x509_crt_parse_file( &cacert, opt.ca_file );
         verify = 1;
     }
 
     if( ret < 0 )
     {
-        printf( " failed\n  !  x509parse_crt returned -0x%x\n\n", -ret );
+        printf( " failed\n  !  x509_crt_parse returned -0x%x\n\n", -ret );
         goto exit;
     }
 
@@ -277,18 +277,18 @@
         printf( "\n  . Loading the certificate(s) ..." );
         fflush( stdout );
 
-        ret = x509parse_crtfile( &crt, opt.filename );
+        ret = x509_crt_parse_file( &crt, opt.filename );
 
         if( ret < 0 )
         {
-            printf( " failed\n  !  x509parse_crt returned %d\n\n", ret );
+            printf( " failed\n  !  x509_crt_parse_file returned %d\n\n", ret );
             x509_crt_free( &crt );
             goto exit;
         }
 
         if( opt.permissive == 0 && ret > 0 )
         {
-            printf( " failed\n  !  x509parse_crt failed to parse %d certificates\n\n", ret );
+            printf( " failed\n  !  x509_crt_parse failed to parse %d certificates\n\n", ret );
             x509_crt_free( &crt );
             goto exit;
         }
@@ -301,10 +301,11 @@
         while( cur != NULL )
         {
             printf( "  . Peer certificate information    ...\n" );
-            ret = x509parse_cert_info( (char *) buf, sizeof( buf ) - 1, "      ", cur );
+            ret = x509_crt_info( (char *) buf, sizeof( buf ) - 1, "      ",
+                                 cur );
             if( ret == -1 )
             {
-                printf( " failed\n  !  x509parse_cert_info returned %d\n\n", ret );
+                printf( " failed\n  !  x509_crt_info returned %d\n\n", ret );
                 x509_crt_free( &crt );
                 goto exit;
             }
@@ -321,8 +322,8 @@
         {
             printf( "  . Verifying X.509 certificate..." );
 
-            if( ( ret = x509parse_verify( &crt, &cacert, NULL, NULL, &flags,
-                            my_verify, NULL ) ) != 0 )
+            if( ( ret = x509_crt_verify( &crt, &cacert, NULL, NULL, &flags,
+                                         my_verify, NULL ) ) != 0 )
             {
                 printf( " failed\n" );
 
@@ -426,11 +427,11 @@
          * 5. Print the certificate
          */
         printf( "  . Peer certificate information    ...\n" );
-        ret = x509parse_cert_info( (char *) buf, sizeof( buf ) - 1, "      ",
-                                   ssl.session->peer_cert );
+        ret = x509_crt_info( (char *) buf, sizeof( buf ) - 1, "      ",
+                             ssl.session->peer_cert );
         if( ret == -1 )
         {
-            printf( " failed\n  !  x509parse_cert_info returned %d\n\n", ret );
+            printf( " failed\n  !  x509_crt_info returned %d\n\n", ret );
             ssl_free( &ssl );
             goto exit;
         }
diff --git a/programs/x509/cert_write.c b/programs/x509/cert_write.c
index c50cf81..f020225 100644
--- a/programs/x509/cert_write.c
+++ b/programs/x509/cert_write.c
@@ -409,10 +409,10 @@
         printf( "  . Loading the issuer certificate ..." );
         fflush( stdout );
 
-        if( ( ret = x509parse_crtfile( &issuer_crt, opt.issuer_crt ) ) != 0 )
+        if( ( ret = x509_crt_parse_file( &issuer_crt, opt.issuer_crt ) ) != 0 )
         {
             error_strerror( ret, buf, 1024 );
-            printf( " failed\n  !  x509parse_crtfile returned -0x%02x - %s\n\n", -ret, buf );
+            printf( " failed\n  !  x509_crt_parse_file returned -0x%02x - %s\n\n", -ret, buf );
             goto exit;
         }
 
@@ -441,10 +441,10 @@
         printf( "  . Loading the certificate request ..." );
         fflush( stdout );
 
-        if( ( ret = x509parse_csrfile( &csr, opt.request_file ) ) != 0 )
+        if( ( ret = x509_csr_parse_file( &csr, opt.request_file ) ) != 0 )
         {
             error_strerror( ret, buf, 1024 );
-            printf( " failed\n  !  x509parse_csrfile returned -0x%02x - %s\n\n", -ret, buf );
+            printf( " failed\n  !  x509_csr_parse_file returned -0x%02x - %s\n\n", -ret, buf );
             goto exit;
         }
 
diff --git a/programs/x509/crl_app.c b/programs/x509/crl_app.c
index 2213f81..20754fd 100644
--- a/programs/x509/crl_app.c
+++ b/programs/x509/crl_app.c
@@ -114,11 +114,11 @@
     printf( "\n  . Loading the CRL ..." );
     fflush( stdout );
 
-    ret = x509parse_crlfile( &crl, opt.filename );
+    ret = x509_crl_parse_file( &crl, opt.filename );
 
     if( ret != 0 )
     {
-        printf( " failed\n  !  x509parse_crl returned %d\n\n", ret );
+        printf( " failed\n  !  x509_crl_parse_file returned %d\n\n", ret );
         x509_crl_free( &crl );
         goto exit;
     }
@@ -129,10 +129,10 @@
      * 1.2 Print the CRL
      */
     printf( "  . CRL information    ...\n" );
-    ret = x509parse_crl_info( (char *) buf, sizeof( buf ) - 1, "      ", &crl );
+    ret = x509_crl_info( (char *) buf, sizeof( buf ) - 1, "      ", &crl );
     if( ret == -1 )
     {
-        printf( " failed\n  !  x509parse_crl_info returned %d\n\n", ret );
+        printf( " failed\n  !  x509_crl_info returned %d\n\n", ret );
         x509_crl_free( &crl );
         goto exit;
     }
diff --git a/programs/x509/req_app.c b/programs/x509/req_app.c
index 3d35524..6b11fc4 100644
--- a/programs/x509/req_app.c
+++ b/programs/x509/req_app.c
@@ -114,11 +114,11 @@
     printf( "\n  . Loading the CSR ..." );
     fflush( stdout );
 
-    ret = x509parse_csrfile( &csr, opt.filename );
+    ret = x509_csr_parse_file( &csr, opt.filename );
 
     if( ret != 0 )
     {
-        printf( " failed\n  !  x509parse_csr returned %d\n\n", ret );
+        printf( " failed\n  !  x509_csr_parse_file returned %d\n\n", ret );
         x509_csr_free( &csr );
         goto exit;
     }
@@ -129,10 +129,10 @@
      * 1.2 Print the CSR
      */
     printf( "  . CSR information    ...\n" );
-    ret = x509parse_csr_info( (char *) buf, sizeof( buf ) - 1, "      ", &csr );
+    ret = x509_csr_info( (char *) buf, sizeof( buf ) - 1, "      ", &csr );
     if( ret == -1 )
     {
-        printf( " failed\n  !  x509parse_csr_info returned %d\n\n", ret );
+        printf( " failed\n  !  x509_csr_info returned %d\n\n", ret );
         x509_csr_free( &csr );
         goto exit;
     }
diff --git a/tests/suites/test_suite_debug.function b/tests/suites/test_suite_debug.function
index 6bc524b..f1a7f71 100644
--- a/tests/suites/test_suite_debug.function
+++ b/tests/suites/test_suite_debug.function
@@ -37,7 +37,7 @@
 
     ssl_set_dbg(&ssl, string_debug, &buffer);
 
-    TEST_ASSERT( x509parse_crtfile( &crt, crt_file ) == 0 );
+    TEST_ASSERT( x509_crt_parse_file( &crt, crt_file ) == 0 );
     debug_print_crt( &ssl, 0, file, line, prefix, &crt);
 
     TEST_ASSERT( strcmp( buffer.buf, result_str ) == 0 );
diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function
index 082dd33..0aa2a62 100644
--- a/tests/suites/test_suite_x509parse.function
+++ b/tests/suites/test_suite_x509parse.function
@@ -10,7 +10,7 @@
     ((void) crt);
     ((void) certificate_depth);
     *flags |= BADCERT_OTHER;
-    
+
     return 0;
 }
 
@@ -41,8 +41,8 @@
     x509_crt_init( &crt );
     memset( buf, 0, 2000 );
 
-    TEST_ASSERT( x509parse_crtfile( &crt, crt_file ) == 0 );
-    res = x509parse_cert_info( buf, 2000, "", &crt );
+    TEST_ASSERT( x509_crt_parse_file( &crt, crt_file ) == 0 );
+    res = x509_crt_info( buf, 2000, "", &crt );
 
     x509_crt_free( &crt );
 
@@ -63,8 +63,8 @@
     x509_crl_init( &crl );
     memset( buf, 0, 2000 );
 
-    TEST_ASSERT( x509parse_crlfile( &crl, crl_file ) == 0 );
-    res = x509parse_crl_info( buf, 2000, "", &crl );
+    TEST_ASSERT( x509_crl_parse_file( &crl, crl_file ) == 0 );
+    res = x509_crl_info( buf, 2000, "", &crl );
 
     x509_crl_free( &crl );
 
@@ -104,11 +104,11 @@
     else
         TEST_ASSERT( "No known verify callback selected" == 0 );
 
-    TEST_ASSERT( x509parse_crtfile( &crt, crt_file ) == 0 );
-    TEST_ASSERT( x509parse_crtfile( &ca, ca_file ) == 0 );
-    TEST_ASSERT( x509parse_crlfile( &crl, crl_file ) == 0 );
+    TEST_ASSERT( x509_crt_parse_file( &crt, crt_file ) == 0 );
+    TEST_ASSERT( x509_crt_parse_file( &ca, ca_file ) == 0 );
+    TEST_ASSERT( x509_crl_parse_file( &crl, crl_file ) == 0 );
 
-    res = x509parse_verify( &crt, &ca, &crl, cn_name, &flags, f_vrfy, NULL );
+    res = x509_crt_verify( &crt, &ca, &crl, cn_name, &flags, f_vrfy, NULL );
 
     x509_crt_free( &crt );
     x509_crt_free( &ca );
@@ -129,7 +129,7 @@
     x509_crt_init( &crt );
     memset( buf, 0, 2000 );
 
-    TEST_ASSERT( x509parse_crtfile( &crt, crt_file ) == 0 );
+    TEST_ASSERT( x509_crt_parse_file( &crt, crt_file ) == 0 );
     if( strcmp( entity, "subject" ) == 0 )
         res =  x509_dn_gets( buf, 2000, &crt.subject );
     else if( strcmp( entity, "issuer" ) == 0 )
@@ -153,7 +153,7 @@
 
     x509_crt_init( &crt );
 
-    TEST_ASSERT( x509parse_crtfile( &crt, crt_file ) == 0 );
+    TEST_ASSERT( x509_crt_parse_file( &crt, crt_file ) == 0 );
 
     if( strcmp( entity, "valid_from" ) == 0 )
         TEST_ASSERT( x509_time_expired( &crt.valid_from ) == result );
@@ -180,10 +180,10 @@
 
     data_len = unhexify( buf, crt_data );
 
-    TEST_ASSERT( x509parse_crt( &crt, buf, data_len ) == ( result ) );
+    TEST_ASSERT( x509_crt_parse( &crt, buf, data_len ) == ( result ) );
     if( ( result ) == 0 )
     {
-        res = x509parse_cert_info( (char *) output, 2000, "", &crt );
+        res = x509_crt_info( (char *) output, 2000, "", &crt );
 
         TEST_ASSERT( res != -1 );
         TEST_ASSERT( res != -2 );
@@ -209,10 +209,10 @@
 
     data_len = unhexify( buf, crl_data );
 
-    TEST_ASSERT( x509parse_crl( &crl, buf, data_len ) == ( result ) );
+    TEST_ASSERT( x509_crl_parse( &crl, buf, data_len ) == ( result ) );
     if( ( result ) == 0 )
     {
-        res = x509parse_crl_info( (char *) output, 2000, "", &crl );
+        res = x509_crl_info( (char *) output, 2000, "", &crl );
 
         TEST_ASSERT( res != -1 );
         TEST_ASSERT( res != -2 );