---
name: "msv.h"
section: "3"
platform: "linux"
package: "libmsv-dev"
version: "1.1.1-4.1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/msv.h"
---

# msv.h(3)

main public libmsv header file

## NAME

msv/msv.h - main public libmsv header file

## SYNOPSIS

`#include <unistd.h>`\

### Data Structures

struct **msv\_query**\
 a query to the MSVA  struct **msv\_response**\
 a response from the MSVA

### Macros

\#define **LIBMSV\_ERROR\_SUCCESS**   0\
 Success or absence of error.  #define **LIBMSV\_ERROR\_INVALID**   1\
 Use of certificate could not be determined valid or was determined invalid.  #define **LIBMSV\_ERROR\_NOENVVAR**   2\
 Environment variable was needed but was not set.  #define **LIBMSV\_ERROR\_CURLINIT\_FAILED**   3\
 curl\_easy\_init() failed for unknown reason  #define **LIBMSV\_ERROR\_CURLCODE**   4\
 an unspecified curl function failed  #define **LIBMSV\_ERROR\_INCOMPATIBLE\_AGENT**   5\
 MSVA was perceived as incompatible.  #define **LIBMSV\_ERROR\_BADARG**   6\
 An argument to the function was invalid.  #define **LIBMSV\_ERROR\_UNEXPECTED\_RESPONSE**   7\
 The response from MSVA was unexpected.  #define **LIBMSV\_ERROR\_NOMEM**   8\
 necessary memory allocation failed  #define **MSV\_DEPRECATED**(X)   X\

### Typedefs

typedef struct msv\_ctxt \* **msv\_ctxt\_t**\
 opaque MSVA context

### Functions

**msv\_ctxt\_t** **msv\_ctxt\_init** (const char \*url)\
 Return an MSV context.  void **msv\_ctxt\_destroy** (**msv\_ctxt\_t** ctx)\
 Destroy an MSV context.  const char \* **msv\_strerror** (**msv\_ctxt\_t** ctx, int error\_code)\
 Return string describing libmsv error code.  int **msv\_check\_msva** (**msv\_ctxt\_t** ctx)\
 Check suitability of Monkeysphere Validation Agent.  int **msv\_query\_agent** (**msv\_ctxt\_t** ctx, struct **msv\_query** q, struct **msv\_response** \*\*response\_ptr)\
 Query validation agent for certificate validity.  void **msv\_response\_destroy** (struct **msv\_response** \*response)\
 Destroy an MSV response.

## Detailed Description

main public libmsv header file

## Macro Definition Documentation

### #define LIBMSV\_ERROR\_CURLCODE 4

an unspecified curl function failed The MSV context retains the curl error code for the last operation run within that context

## Function Documentation

### int msv\_check\_msva (msv\_ctxt\_t ctx)` [extern]`

Check suitability of Monkeysphere Validation Agent.

**Parameters**

*ctx* the MSV context

**Returns**

0 for success, or libmsv error code

### void msv\_ctxt\_destroy (msv\_ctxt\_t ctx)` [extern]`

Destroy an MSV context.

**Parameters**

*ctx* the MSV context to destroy

### msv\_ctxt\_t msv\_ctxt\_init (const char \* url)` [extern]`

Return an MSV context.

**Parameters**

*url* URL for MSVA or NULL to use MONKEYSPHERE\_VALIDATION\_AGENT\_SOCKET environment variable

**Returns**

MSV context

### int msv\_query\_agent (msv\_ctxt\_t ctx, struct msv\_query q, struct msv\_response \*\* response\_ptr)` [extern]`

Query validation agent for certificate validity.

**Parameters**

*ctx* the MSV context \
 *q* **msv\_query** struct representing the MSVA query \
 *response\_ptr* pointer to pointer to **msv\_response** struct that the caller is responsible for destroying via *msv\_response\_destroy*

**Returns**

0 for valid use of certificate, 1 for invalid use of certificate, or libmsv error code

### void msv\_response\_destroy (struct msv\_response \* response)` [extern]`

Destroy an MSV response.

**Parameters**

*response* the MSV response to destroy

### const char \* msv\_strerror (msv\_ctxt\_t ctx, int error\_code)` [extern]`

Return string describing libmsv error code.

**Parameters**

*ctx* the relevant MSV context \
 *error\_code* return value of libmsv function

**Returns**

string describing error

## Author

Generated automatically by Doxygen for libmsv from the source code.
