aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/crypto.h
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-08-14 20:19:38 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-08-14 20:19:38 +0000
commit37c8c59ba52b2024374715f9853a90e5bb100ed3 (patch)
treecdad27b4b0d247b7189c65c7863f13dfce778291 /include/asterisk/crypto.h
parent0b290bde6e4966a2a0ecad1cac504ff610383d2d (diff)
Create binary versions of signature functions
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3607 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/crypto.h')
-rwxr-xr-xinclude/asterisk/crypto.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/asterisk/crypto.h b/include/asterisk/crypto.h
index 4aac31b1d..d222e46b8 100755
--- a/include/asterisk/crypto.h
+++ b/include/asterisk/crypto.h
@@ -53,6 +53,17 @@ extern int ast_key_init(int fd);
*/
extern int ast_check_signature(struct ast_key *key, char *msg, char *sig);
+//! Check the authenticity of a message signature using a given public key
+/*!
+ * \param key a public key to use to verify
+ * \param msg the message that has been signed
+ * \param sig the proposed valid signature in raw binary representation
+ *
+ * Returns 0 if the signature is valid, or -1 otherwise
+ *
+ */
+extern int ast_check_signature_bin(struct ast_key *key, char *msg, unsigned char *sig);
+
/*!
* \param key a private key to use to create the signature
* \param msg the message to sign
@@ -63,6 +74,16 @@ extern int ast_check_signature(struct ast_key *key, char *msg, char *sig);
*
*/
extern int ast_sign(struct ast_key *key, char *msg, char *sig);
+/*!
+ * \param key a private key to use to create the signature
+ * \param msg the message to sign
+ * \param sig a pointer to a buffer of at least 128 bytes in which the
+ * raw encoded signature will be stored
+ *
+ * Returns 0 on success or -1 on failure.
+ *
+ */
+extern int ast_sign_bin(struct ast_key *key, char *msg, unsigned char *sig);
#if defined(__cplusplus) || defined(c_plusplus)
}