PreviousNext

pkc_crypto_verify_signature(3sec)

Verifies a signature

Synopsis

#include <dce/pkc_base.h>

#include <dce/pkc_crypto_reg.h>

pkc_crypto_verify_signature(

gss_OID algorithm,

sec_pk_gen_data_t data,

sec_pk_data_t public_key,

sec_pk_data_t signature);

Parameters

Input

algorithm
An OID identifying the cryptographic algorithm to be used in verifying the data.

data
The signed data whose signature is to be verified.

public_key
The public key (i.e., public member of a public-private key pair) to be used to verify the signed data.

signature
The signature to be verified.

Description

pkc_crypto_verify_signature(3sec) searches the list of registered algorithms for an implementation of the specified algorithm. If found, the implementation is opened, if necessary, and its verify)( ) function invoked to verify the data and signature passed by the caller.

The routine returns 0 for a correct signature, pkc_invalid_signature for an incorrect signature, or another DCE-defined error status to indicate any other errors.

Using this routine, an application can verify signed data in one simple call. The alternative is to lookup the desired cryptographic module by calling pkc_crypto_lookup_algorithm(3sec) then explicitly call the module's (verify)( ) routine.

Return Values

pkc_s_success
Operation successfully completed.

Errors

Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages.

Related Information

Functions:
pkc_crypto_generate_keypair(3sec)
pkc_crypto_get_registered_algorithms(3sec)
pkc_crypto_lookup_algorithm(3sec)
pkc_crypto_register_signature_alg(3sec)
pkc_crypto_sign(3sec)