bool -> SilcBool.
[silc.git] / lib / silcutil / silcapputil.h
index f054fa4d2b90be617d44a78be7c32186b3090eec..8b9039313f17acec81de992019a38708b01e17f9 100644 (file)
  *
  * SYNOPSIS
  *
- *    bool silc_create_key_pair(const char *pkcs_name,
+ *    SilcBool silc_create_key_pair(const char *pkcs_name,
  *                              SilcUInt32 key_len_bits,
  *                              const char *pub_filename,
  *                              const char *prv_filename,
  *                              const char *pub_identifier,
+ *                              const char *passphrase,
  *                              SilcPKCS *return_pkcs,
  *                              SilcPublicKey *return_public_key,
  *                              SilcPrivateKey *return_private_key,
- *                              bool interactive);
+ *                              SilcBool interactive);
  *
  * DESCRIPTION
  *
  *    "UN=foobar, HN=hostname"), or if NULL the routine generates it
  *    automatically.
  *
+ *    The `passphrase' is the passphrase that is used to encrypt the
+ *    private key file.  It is recommended that you would protect your
+ *    private key file with a passphrase.
+ *
  *    The routine returns FALSE if error occurs during key generation.
  *    Function returns TRUE when success and returns the created SilcPKCS
  *    object, which can be used to perform public key cryptography into
  *    silc_pkcs_register_default function.
  *
  ***/
-bool silc_create_key_pair(const char *pkcs_name,
+SilcBool silc_create_key_pair(const char *pkcs_name,
                          SilcUInt32 key_len_bits,
                          const char *pub_filename,
                          const char *prv_filename,
                          const char *pub_identifier,
+                         const char *passphrase,
                          SilcPKCS *return_pkcs,
                          SilcPublicKey *return_public_key,
                          SilcPrivateKey *return_private_key,
-                         bool interactive);
+                         SilcBool interactive);
 
 /****f* silcutil/SilcAppUtil/silc_load_key_pair
  *
  * SYNOPSIS
  *
- *    bool silc_load_key_pair(const char *pub_filename,
+ *    SilcBool silc_load_key_pair(const char *pub_filename,
  *                            const char *prv_filename,
+ *                            const char *passphrase,
  *                            SilcPKCS *return_pkcs,
  *                            SilcPublicKey *return_public_key,
  *                            SilcPrivateKey *return_private_key);
@@ -107,11 +114,13 @@ bool silc_create_key_pair(const char *pkcs_name,
  *    public key into `return_public_key' pointer, private key into
  *    `return_private_key' pointer and the SilcPKCS object to the
  *    `return_pkcs'.  The SilcPKCS can be used to perform public key
- *    cryptographic operations.
+ *    cryptographic operations.  The `passphrase' is the passphrase
+ *    which will be used to decrypt the private key file.
  *
  ***/
-bool silc_load_key_pair(const char *pub_filename,
+SilcBool silc_load_key_pair(const char *pub_filename,
                        const char *prv_filename,
+                       const char *passphrase,
                        SilcPKCS *return_pkcs,
                        SilcPublicKey *return_public_key,
                        SilcPrivateKey *return_private_key);
@@ -120,7 +129,7 @@ bool silc_load_key_pair(const char *pub_filename,
  *
  * SYNOPSIS
  *
- *    bool silc_show_public_key(const char *pub_filename);
+ *    SilcBool silc_show_public_key(const char *pub_filename);
  *
  * DESCRIPTION
  *
@@ -129,6 +138,26 @@ bool silc_load_key_pair(const char *pub_filename,
  *    into human readable form into stdout.  Returns FALSE on error.
  *
  ***/
-bool silc_show_public_key(const char *pub_filename);
+SilcBool silc_show_public_key(const char *pub_filename);
+
+/****f* silcutil/SilcAppUtil/silc_change_private_key_passphrase
+ *
+ * SYNOPSIS
+ *
+ *    SilcBool silc_change_private_key_passphrase(const char *prv_filename,
+ *                                            const char *old_passphrase,
+ *                                            const char *new_passphrase);
+ *
+ * DESCRIPTION
+ *
+ *    This routine can be used to change the passphrase of the private
+ *    key file, which is used to encrypt the private key.  If the old
+ *    and new passphrase is not provided for this function this will
+ *    prompt for them.
+ *
+ ***/
+SilcBool silc_change_private_key_passphrase(const char *prv_filename,
+                                       const char *old_passphrase,
+                                       const char *new_passphrase);
 
 #endif /* SILCAPPUTIL_H */