Signatures/Verification
[Core API]


Functions

ops_create_signature_t * ops_create_signature_new ()
 Creates new ops_create_signature_t.
void ops_create_signature_delete (ops_create_signature_t *sig)
 Free signature and memory associated with it.
ops_boolean_t ops_check_signature (const unsigned char *hash, unsigned length, const ops_signature_t *sig, const ops_public_key_t *signer)
 Checks a signature.
ops_boolean_t ops_check_user_id_certification_signature (const ops_public_key_t *key, const ops_user_id_t *id, const ops_signature_t *sig, const ops_public_key_t *signer, const unsigned char *raw_packet)
 Verify a certification signature.
ops_boolean_t ops_check_user_attribute_certification_signature (const ops_public_key_t *key, const ops_user_attribute_t *attribute, const ops_signature_t *sig, const ops_public_key_t *signer, const unsigned char *raw_packet)
 Verify a certification signature.
ops_boolean_t ops_check_subkey_signature (const ops_public_key_t *key, const ops_public_key_t *subkey, const ops_signature_t *sig, const ops_public_key_t *signer, const unsigned char *raw_packet)
 Verify a subkey signature.
ops_boolean_t ops_check_direct_signature (const ops_public_key_t *key, const ops_signature_t *sig, const ops_public_key_t *signer, const unsigned char *raw_packet)
 Verify a direct signature.
ops_boolean_t ops_check_hash_signature (ops_hash_t *hash, const ops_signature_t *sig, const ops_public_key_t *signer)
 Verify a signature on a hash (the hash will have already been fed the material that was being signed, for example signed cleartext).
void ops_signature_start_key_signature (ops_create_signature_t *sig, const ops_public_key_t *key, const ops_user_id_t *id, ops_sig_type_t type)
 ops_signature_start() creates a V4 public key signature with a SHA1 hash.
void ops_signature_start_cleartext_signature (ops_create_signature_t *sig, const ops_secret_key_t *key, const ops_hash_algorithm_t hash, const ops_sig_type_t type)
 Setup to start a cleartext's signature.
void ops_signature_start_message_signature (ops_create_signature_t *sig, const ops_secret_key_t *key, const ops_hash_algorithm_t hash, const ops_sig_type_t type)
 Setup to start a message's signature.
void ops_signature_add_data (ops_create_signature_t *sig, const void *buf, size_t length)
 Add plaintext data to a signature-to-be.
ops_boolean_t ops_signature_hashed_subpackets_end (ops_create_signature_t *sig)
 Mark the end of the hashed subpackets in the signature.
ops_boolean_t ops_write_signature (ops_create_signature_t *sig, const ops_public_key_t *key, const ops_secret_key_t *skey, ops_create_info_t *info)
 Write out a signature.
ops_boolean_t ops_signature_add_creation_time (ops_create_signature_t *sig, time_t when)
 ops_signature_add_creation_time() adds a creation time to the signature.
ops_boolean_t ops_signature_add_issuer_key_id (ops_create_signature_t *sig, const unsigned char keyid[OPS_KEY_ID_SIZE])
 Adds issuer's key ID to the signature.
void ops_signature_add_primary_user_id (ops_create_signature_t *sig, ops_boolean_t primary)
 Adds primary user ID to the signature.
ops_hash_tops_signature_get_hash (ops_create_signature_t *sig)
 Get the hash structure in use for the signature.

Function Documentation

ops_boolean_t ops_check_direct_signature const ops_public_key_t key,
const ops_signature_t sig,
const ops_public_key_t signer,
const unsigned char *  raw_packet
 

Verify a direct signature.

Parameters:
key The public key which was signed.
sig The signature.
signer The public key of the signer.
raw_packet The raw signature packet.
Returns:
ops_true if OK; else ops_false

ops_boolean_t ops_check_hash_signature ops_hash_t hash,
const ops_signature_t sig,
const ops_public_key_t signer
 

Verify a signature on a hash (the hash will have already been fed the material that was being signed, for example signed cleartext).

Parameters:
hash A hash structure of appropriate type that has been fed the material to be signed. This MUST NOT have been finalised.
sig The signature to be verified.
signer The public key of the signer.
Returns:
ops_true if OK; else ops_false

ops_boolean_t ops_check_signature const unsigned char *  hash,
unsigned  length,
const ops_signature_t sig,
const ops_public_key_t signer
 

Checks a signature.

Parameters:
hash Signature Hash to be checked
length Signature Length
sig The Signature to be checked
signer The signer's public key
Returns:
ops_true if good; else ops_false

ops_boolean_t ops_check_subkey_signature const ops_public_key_t key,
const ops_public_key_t subkey,
const ops_signature_t sig,
const ops_public_key_t signer,
const unsigned char *  raw_packet
 

Verify a subkey signature.

Parameters:
key The public key whose subkey was signed.
subkey The subkey of the public key that was signed.
sig The signature.
signer The public key of the signer.
raw_packet The raw signature packet.
Returns:
ops_true if OK; else ops_false

ops_boolean_t ops_check_user_attribute_certification_signature const ops_public_key_t key,
const ops_user_attribute_t attribute,
const ops_signature_t sig,
const ops_public_key_t signer,
const unsigned char *  raw_packet
 

Verify a certification signature.

Parameters:
key The public key that was signed.
attribute The user attribute that was signed
sig The signature.
signer The public key of the signer.
raw_packet The raw signature packet.
Returns:
ops_true if OK; else ops_false

ops_boolean_t ops_check_user_id_certification_signature const ops_public_key_t key,
const ops_user_id_t id,
const ops_signature_t sig,
const ops_public_key_t signer,
const unsigned char *  raw_packet
 

Verify a certification signature.

Parameters:
key The public key that was signed.
id The user ID that was signed
sig The signature.
signer The public key of the signer.
raw_packet The raw signature packet.
Returns:
ops_true if OK; else ops_false

void ops_create_signature_delete ops_create_signature_t *  sig  ) 
 

Free signature and memory associated with it.

Parameters:
sig struct to free
See also:
ops_create_signature_new()

ops_create_signature_t* ops_create_signature_new void   ) 
 

Creates new ops_create_signature_t.

Returns:
new ops_create_signature_t
Note:
It is the caller's responsibility to call ops_create_signature_delete()
See also:
ops_create_signature_delete()

ops_boolean_t ops_signature_add_creation_time ops_create_signature_t *  sig,
time_t  when
 

ops_signature_add_creation_time() adds a creation time to the signature.

Parameters:
sig 
when 

void ops_signature_add_data ops_create_signature_t *  sig,
const void *  buf,
size_t  length
 

Add plaintext data to a signature-to-be.

Parameters:
sig The signature-to-be.
buf The plaintext data.
length The amount of plaintext data.

ops_boolean_t ops_signature_add_issuer_key_id ops_create_signature_t *  sig,
const unsigned char  keyid[OPS_KEY_ID_SIZE]
 

Adds issuer's key ID to the signature.

Parameters:
sig 
keyid 

void ops_signature_add_primary_user_id ops_create_signature_t *  sig,
ops_boolean_t  primary
 

Adds primary user ID to the signature.

Parameters:
sig 
primary 

ops_hash_t* ops_signature_get_hash ops_create_signature_t *  sig  ) 
 

Get the hash structure in use for the signature.

Parameters:
sig The signature structure.
Returns:
The hash structure.

ops_boolean_t ops_signature_hashed_subpackets_end ops_create_signature_t *  sig  ) 
 

Mark the end of the hashed subpackets in the signature.

Parameters:
sig 

void ops_signature_start_key_signature ops_create_signature_t *  sig,
const ops_public_key_t key,
const ops_user_id_t id,
ops_sig_type_t  type
 

ops_signature_start() creates a V4 public key signature with a SHA1 hash.

Parameters:
sig The signature structure to initialise
key The public key to be signed
id The user ID being bound to the key
type Signature type

ops_boolean_t ops_write_signature ops_create_signature_t *  sig,
const ops_public_key_t key,
const ops_secret_key_t skey,
ops_create_info_t info
 

Write out a signature.

Parameters:
sig 
key 
skey 
info 


Generated on Wed May 22 00:00:03 2013 for OpenPGP:SDK by  doxygen 1.4.6