---
name: "proxypolicy"
section: "3"
platform: "linux"
package: "libglobus-gsi-proxy-ssl-doc"
version: "4.1-2"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/proxypolicy"
---

# proxypolicy(3)

## NAME

ProxyPolicy -

### Data Structures

struct **PROXYPOLICY\_st**\

### Get a method for ASN1 conversion

ASN1\_METHOD \* **PROXYPOLICY\_asn1\_meth** ()\

### New

**PROXYPOLICY** \* **PROXYPOLICY\_new** ()\

### Free

void **PROXYPOLICY\_free** (**PROXYPOLICY** \*policy)\

### Duplicate

**PROXYPOLICY** \* **PROXYPOLICY\_dup** (**PROXYPOLICY** \*policy)\

### Compare

int **PROXYPOLICY\_cmp** (const **PROXYPOLICY** \*a, const **PROXYPOLICY** \*b)\

### Print to a BIO stream

int **PROXYPOLICY\_print** (BIO \*bp, **PROXYPOLICY** \*policy)\

### Print to a File Stream

int **PROXYPOLICY\_print\_fp** (FILE \*fp, **PROXYPOLICY** \*policy)\

### Set the Policy Language Field

int **PROXYPOLICY\_set\_policy\_language** (**PROXYPOLICY** \*policy, ASN1\_OBJECT \*policy\_language)\

### Get the Policy Language Field

ASN1\_OBJECT \* **PROXYPOLICY\_get\_policy\_language** (**PROXYPOLICY** \*policy)\

### Set the Policy Field

int **PROXYPOLICY\_set\_policy** (**PROXYPOLICY** \*proxypolicy, unsigned char \*policy, int length)\

### Get the Policy Field

unsigned char \* **PROXYPOLICY\_get\_policy** (**PROXYPOLICY** \*policy, int \*length)\

### Convert from Internal to DER encoded form

int **i2d\_PROXYPOLICY** (**PROXYPOLICY** \*a, unsigned char \*\*pp)\

### Convert from DER encoded form to Internal

**PROXYPOLICY** \* **d2i\_PROXYPOLICY** (**PROXYPOLICY** \*\*a, unsigned char \*\*pp, long length)\

## Detailed Description

**Author:**

Sam Meder

Sam Lang

The proxypolicy set of data structures and functions provides an interface to generating a PROXYPOLICY structure which is maintained as a field in the PROXYCERTINFO structure, and ultimately gets written to a DER encoded string.

**See also:**

Further Information about proxy policies is available in the `X.509 Proxy Certificate Profile` document.

## Function Documentation

### ASN1\_METHOD\* PROXYPOLICY\_asn1\_meth ()

Creates an ASN1\_METHOD structure, which contains pointers to routines that convert any PROXYPOLICY structure to its associated ASN1 DER encoded form and vice-versa. **Returns:**

the ASN1\_METHOD object

### PROXYPOLICY\* PROXYPOLICY\_new ()

Allocates and initializes a new PROXYPOLICY structure. **Returns:**

pointer to the new PROXYPOLICY

### void PROXYPOLICY\_free (PROXYPOLICY \*policy)

Frees a PROXYPOLICY. **Parameters:**

*policy* the proxy policy to free

### PROXYPOLICY\* PROXYPOLICY\_dup (PROXYPOLICY \*policy)

Makes a copy of the proxypolicy - this function allocates space for a new PROXYPOLICY, so the returned PROXYPOLICY must be freed when its no longer needed. **Parameters:**

*policy* the proxy policy to copy

**Returns:**

the new PROXYPOLICY

### int PROXYPOLICY\_cmp (const PROXYPOLICY \*a, const PROXYPOLICY \*b)

Compares two PROXYPOLICY structs for equality This function first compares the policy language numeric id's, if they're equal, it then compares the two policies. **Returns:**

0 if equal, nonzero if not

### int PROXYPOLICY\_print (BIO \*bp, PROXYPOLICY \*policy)

Prints the PROXYPOLICY struct using the BIO stream. **Parameters:**

*bp* the BIO stream to print to \
 *policy* the PROXYPOLICY to print

**Returns:**

1 on success, 0 on error

### int PROXYPOLICY\_print\_fp (FILE \*fp, PROXYPOLICY \*policy)

Prints the PROXYPOLICY to the file stream FILE\*. **Parameters:**

*fp* the FILE\* stream to print to \
 *policy* the PROXYPOLICY to print

**Returns:**

number of bytes printed, -2 or -1 on error

### int PROXYPOLICY\_set\_policy\_language (PROXYPOLICY \*policy, ASN1\_OBJECT \*policy\_language)

Sets the policy language of the PROXYPOLICY. **Parameters:**

*policy* the PROXYPOLICY to set the policy language of \
 *policy\_language* the policy language to set it to

**Returns:**

1 on success, 0 on error

### ASN1\_OBJECT\* PROXYPOLICY\_get\_policy\_language (PROXYPOLICY \*policy)

Gets the policy language of the PROXYPOLICY. **Parameters:**

*policy* the proxy policy to get the policy language of

**Returns:**

the policy language as an ASN1\_OBJECT

### int PROXYPOLICY\_set\_policy (PROXYPOLICY \*proxypolicy, unsigned char \*policy, intlength)

Sets the policy of the PROXYPOLICY. **Parameters:**

*proxypolicy* the proxy policy to set the policy of \
 *policy* the policy to set it to \
 *length* the length of the policy

**Returns:**

1 on success, 0 on error

### unsigned char\* PROXYPOLICY\_get\_policy (PROXYPOLICY \*policy, int \*length)

Gets the policy of a PROXYPOLICY. **Parameters:**

*policy* the PROXYPOLICY to get the policy of \
 *length* the length of the returned policy - this value gets set by this function

**Returns:**

the policy

### int i2d\_PROXYPOLICY (PROXYPOLICY \*a, unsigned char \*\*pp)

Converts a PROXYPOLICY from its internal structure to a DER encoded form. **Parameters:**

*a* the PROXYPOLICY to convert \
 *pp* the buffer to put the DER encoding in

**Returns:**

the length of the DER encoding in bytes

### PROXYPOLICY\* d2i\_PROXYPOLICY (PROXYPOLICY \*\*a, unsigned char \*\*pp, longlength)

Converts the PROXYPOLICY from its DER encoded form to an internal PROXYPOLICY structure. **Parameters:**

*a* the PROXYPOLICY struct to set \
 *pp* the DER encoding to get the PROXYPOLICY from \
 *length* the length of the DER encoding

**Returns:**

the resulting PROXYPOLICY in its internal structure form - this variable has been allocated using \_new routines, so it needs to be freed once its no longer used

## Author

Generated automatically by Doxygen for globus gsi proxy ssl from the source code.
