Hi all,

Have to use ECDSA_sign and ECDSA_verify() with EC_privatekey and certificate
in DER format ? There are some has experience with ECDSA can tell this
stuff?

Many thanks for reply.
Nguyen.


/** ECDSA_sign
 * computes ECDSA signature of a given hash value using the supplied
 * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
 * \param type this parameter is ignored
 * \param dgst pointer to the hash value to sign
 * \param dgstlen length of the hash value
 * \param sig buffer to hold the DER encoded signature
 * \param siglen pointer to the length of the returned signature
 * \param eckey pointer to the EC_KEY object containing a private EC key
 * \return 1 on success and 0 otherwise
 */
int      ECDSA_sign(int type, const unsigned char *dgst, int dgstlen,
        unsigned char *sig, unsigned int *siglen, EC_KEY *eckey);



/** ECDSA_verify
 * verifies that the given signature is valid ECDSA signature
 * of the supplied hash value using the specified public key.
 * \param type this parameter is ignored
 * \param dgst pointer to the hash value
 * \param dgstlen length of the hash value
 * \param sig  pointer to the DER encoded signature
 * \param siglen length of the DER encoded signature
 * \param eckey pointer to the EC_KEY object containing a public EC key
 * \return 1 if the signature is valid, 0 if the signature is invalid and -1
on error
 */
int       ECDSA_verify(int type, const unsigned char *dgst, int dgstlen,
        const unsigned char *sig, int siglen, EC_KEY *eckey);

Reply via email to