OpenVAS Libraries  9.0.1
Functions
nasl_signature.h File Reference
#include <glib.h>
#include "../base/gpgme_util.h"

Go to the source code of this file.

Functions

int nasl_verify_signature (const char *filename)
 

Function Documentation

◆ nasl_verify_signature()

int nasl_verify_signature ( const char *  filename)

Checks the detached OpenPGP signature of the file given by FILENAME. The name of the signature file is derived from FILENAME by appending ".asc".

If a signature file exists and it contains only fully valid signatures, the function returns 0. If any of the signatures is not valid or was made by an unknown or untrusted key, the function returns 1. If an error occurs or the file does not have a corresponding detached signature the function returns -1.

Parameters
filenameFilename (e.g. 1.txt) for which to check signature (e.g. 1.txt.asc).
Returns
Zero, if files exists and all signatures are fully trusted. 1 if at least one signature from invalid or untrusted key. -1 on missing file or error.