/* Return the public key from the payload */
SilcPublicKey
-silc_message_signed_get_public_key(SilcMessageSignedPayload sig)
+silc_message_signed_get_public_key(SilcMessageSignedPayload sig,
+ unsigned char **pk_data,
+ SilcUInt32 *pk_data_len)
{
SilcPublicKey pk;
sig->pk_len, &pk))
return NULL;
+ if (pk_data)
+ *pk_data = sig->pk_data;
+ if (pk_data_len)
+ *pk_data_len = sig->pk_len;
+
return pk;
}
*
* DESCRIPTION
*
- * Returns the public key from the SilcMessageSignedPayload Payload
- * or NULL if it does not include public key. The caller must free
- * the returned public key.
+ * Returns the decoded SilcPublicKey from the SilcMessageSignedPayload
+ * Payload or NULL if it does not include public key. The caller must
+ * free the returned public key pointer. This also returns the raw
+ * public key (before decoding) into `pk_data' and `pk_data_len' if
+ * they are provided. The caller must not free these pointers.
*
***/
SilcPublicKey
-silc_message_signed_get_public_key(SilcMessageSignedPayload sig);
+silc_message_signed_get_public_key(SilcMessageSignedPayload sig,
+ unsigned char **pk_data,
+ SilcUInt32 *pk_data_len);
#endif /* SILCMESSAGE_H */