VOMS CC API 1.5.0
Loading...
Searching...
No Matches
vomsdata Struct Reference

#include <voms_api.h>

Public Member Functions

 vomsdata (std::string voms_dir="", std::string cert_dir="")
bool LoadSystemContacts (std::string dir="")
bool LoadUserContacts (std::string dir="")
std::vector< contactdataFindByAlias (std::string alias)
std::vector< contactdataFindByVO (std::string vo)
void Order (std::string att)
void ResetOrder (void)
void AddTarget (std::string target)
std::vector< std::string > ListTargets (void)
void ResetTargets (void)
std::string ServerErrors (void)
bool Retrieve (X509 *cert, STACK_OF(X509) *chain, recurse_type how=RECURSE_CHAIN)
bool Contact (std::string hostname, int port, std::string servsubject, std::string command)
bool Contact (std::string hostname, int port, std::string servsubject, std::string command, int timeout)
bool ContactRaw (std::string hostname, int port, std::string servsubject, std::string command, std::string &raw, int &version)
bool ContactRaw (std::string hostname, int port, std::string servsubject, std::string command, std::string &raw, int &version, int timeout)
void SetVerificationType (verify_type how)
void SetLifetime (int lifetime)
bool Import (std::string buffer)
bool Export (std::string &data)
bool DefaultData (voms &)
std::string ErrorMessage (void)
bool RetrieveFromCtx (gss_ctx_id_t context, recurse_type how)
bool RetrieveFromCred (gss_cred_id_t credential, recurse_type how)
bool Retrieve (X509_EXTENSION *ext)
bool RetrieveFromProxy (recurse_type how)
bool Retrieve (FILE *file, recurse_type how)
bool Retrieve (AC *ac)
 ~vomsdata ()
 vomsdata (const vomsdata &)
void SetRetryCount (int retryCount)
void SetVerificationTime (time_t)
bool LoadCredentials (X509 *, EVP_PKEY *, STACK_OF(X509) *)
bool ContactRESTRaw (const std::string &, int, const std::string &, std::string &, int, int)

Static Public Member Functions

static void SkipSslInitialization ()

Data Fields

verror_type error
std::vector< vomsdata
std::string workvo
std::string extra_data

Detailed Description

Definition at line 197 of file voms_api.h.

Constructor & Destructor Documentation

◆ vomsdata() [1/2]

vomsdata::vomsdata ( std::string voms_dir = "",
std::string cert_dir = "" )
Parameters
voms_dirThe directory which contains the certificate of the VOMS server
cert_dirThe directory which contains the certificate of the CA

If voms_dir is empty, the value of the environment variable X509_VOMS_DIR is taken.

If cert_dir is empty, the value of the environment variable X509_CERT_DIR is taken.

◆ ~vomsdata()

vomsdata::~vomsdata ( )

◆ vomsdata() [2/2]

vomsdata::vomsdata ( const vomsdata & )

Member Function Documentation

◆ AddTarget()

void vomsdata::AddTarget ( std::string target)

Adds a target to the AC.

          \param target The target to be added. it should be a FQDN.

◆ Contact() [1/2]

bool vomsdata::Contact ( std::string hostname,
int port,
std::string servsubject,
std::string command )

Contacts a VOMS server to get a certificate

         It is the equivalent of the voms_proxy_init command, but 
         without the --include functionality.
         \param hostname FQDN of the VOMS server
         \param port the port on which the VOMS server is listening
         \param servsubject the subject of the server's certificate
         \param command the command sent to the server
         \return failure (F) or success (T)

◆ Contact() [2/2]

bool vomsdata::Contact ( std::string hostname,
int port,
std::string servsubject,
std::string command,
int timeout )

Contacts a VOMS server to get a certificate

         It is the equivalent of the voms_proxy_init command, but 
         without the --include functionality.
         \param hostname FQDN of the VOMS server
         \param port the port on which the VOMS server is listening
         \param servsubject the subject of the server's certificate
         \param command the command sent to the server
         \param timeout Timeout for server connections in seconds
         \return failure (F) or success (T)

◆ ContactRaw() [1/2]

bool vomsdata::ContactRaw ( std::string hostname,
int port,
std::string servsubject,
std::string command,
std::string & raw,
int & version )

Same as Contact, however it does not start the verification process, and the message receviedfrom the server is not parsed.

Parameters
hostnameFQDN of the VOMS server
portthe port on which the VOMS server is listening
servsubjectthe subject of the server's certificate
commandthe command sent to the server
rawOUTPUT PARAMETER the answer from the server
versionOUTPUT PARAMETER the version of the answer
Returns
failure (F) or success (T)

◆ ContactRaw() [2/2]

bool vomsdata::ContactRaw ( std::string hostname,
int port,
std::string servsubject,
std::string command,
std::string & raw,
int & version,
int timeout )

Same as Contact, however it does not start the verification process, and the message receviedfrom the server is not parsed.

Parameters
hostnameFQDN of the VOMS server
portthe port on which the VOMS server is listening
servsubjectthe subject of the server's certificate
commandthe command sent to the server
rawOUTPUT PARAMETER the answer from the server
versionOUTPUT PARAMETER the version of the answer
timeoutTimeout for server connections in seconds
Returns
failure (F) or success (T)

◆ ContactRESTRaw()

bool vomsdata::ContactRESTRaw ( const std::string & ,
int ,
const std::string & ,
std::string & ,
int ,
int  )

◆ DefaultData()

bool vomsdata::DefaultData ( voms & )

Get the default data extension from those present in the pseudo certificate

◆ ErrorMessage()

std::string vomsdata::ErrorMessage ( void )

Gets a textual description of the error.

Returns
A string containg the error message.

◆ Export()

bool vomsdata::Export ( std::string & data)

Exports data from vomsdata::data to the format used for inclusion into a certificate.

The function doesn't verify the data

Parameters
dataThe certificate extension
Returns
Failure (F) or Success (T)

◆ FindByAlias()

std::vector< contactdata > vomsdata::FindByAlias ( std::string alias)

Finds servers which share a common alias.

Parameters
aliasThe alias to look for.
Returns
The servers found. The order in which they are returned is unspecified.

◆ FindByVO()

std::vector< contactdata > vomsdata::FindByVO ( std::string vo)

Finds servers which serve a common VO

Parameters
voThe VO name to look for.
Returns
The servers found. The order in which they are returned is unspecified.

◆ Import()

bool vomsdata::Import ( std::string buffer)

Converts data from the format used for inclusion into a certificate to the internal format

The function does verify the data.

Parameters
buffercontains the data to be converted
Returns
Failure (F) or Success (T)

◆ ListTargets()

std::vector< std::string > vomsdata::ListTargets ( void )

Returns the list of targets.

◆ LoadCredentials()

bool vomsdata::LoadCredentials ( X509 * ,
EVP_PKEY * ,
STACK_OF(X509) *  )

◆ LoadSystemContacts()

bool vomsdata::LoadSystemContacts ( std::string dir = "")

Loads the system wide configuration files.

Parameters
dirThe directory in which the files are stored.

If dir is empty, defaults to /opt/edg/etc/vomses.

Returns
True if all went OK, false otherwise.

◆ LoadUserContacts()

bool vomsdata::LoadUserContacts ( std::string dir = "")

Loads the user-specific configuration files.

Parameters
dirThe directory in which the files are stored.

If dir is empty, defaults to $VOMS_USERCONF. If this is empty too, defaults to $HOME/.edg/vomses, or to ~/.edg/vomses as a last resort.

Returns
True if all went OK, false otherwise.

◆ Order()

void vomsdata::Order ( std::string att)

Sets up the ordering of the results.

    Defines the ordering of the data returned by Contact(). Results are
    ordered in the same order as the calls to this function.
    \param att The attribute to be ordered.

◆ ResetOrder()

void vomsdata::ResetOrder ( void )

Resets the ordering.

◆ ResetTargets()

void vomsdata::ResetTargets ( void )

Resets the target list.

◆ Retrieve() [1/4]

bool vomsdata::Retrieve ( AC * ac)

Gets VOMS information from the AC

Parameters
acThe extension to parse.
Returns
failure (F) or success (T)

◆ Retrieve() [2/4]

bool vomsdata::Retrieve ( FILE * file,
recurse_type how )

Gets VOMS information from a proxy saved as a file.

Parameters
filethe file name
howRecursion type
Returns
failure (F) or success (T)

Note: Does NOT verify that the proxy is valid. Such verification must be obtained through other means.

◆ Retrieve() [3/4]

bool vomsdata::Retrieve ( X509 * cert,
STACK_OF(X509) * chain,
recurse_type how = RECURSE_CHAIN )

Extracts the VOMS extension from an X.509 certificate. The function doesn't check the validity of the certificates, but it does check the content of the user data.

Parameters
certThe certificate with the VOMS extensions
chainThe chain of the validation certificates (only the intermediate ones)
howRecursion type
Returns
failure (F) or success (T)

◆ Retrieve() [4/4]

bool vomsdata::Retrieve ( X509_EXTENSION * ext)

Gets VOMS information from the given extension

Parameters
extThe extension to parse.
Returns
failure (F) or success (T)

◆ RetrieveFromCred()

bool vomsdata::RetrieveFromCred ( gss_cred_id_t credential,
recurse_type how )

Gets VOMS information from the given globus credential

Parameters
credentialThe credential from which to retrieve the certificate.
howRecursion type
Returns
failure (F) or success (T)

◆ RetrieveFromCtx()

bool vomsdata::RetrieveFromCtx ( gss_ctx_id_t context,
recurse_type how )

Gets VOMS information from the given globus context

Parameters
contextThe context from which to retrieve the certificate.
howRecursion type
Returns
failure (F) or success (T)

◆ RetrieveFromProxy()

bool vomsdata::RetrieveFromProxy ( recurse_type how)

Gets VOMS information from an existing globus proxy

Parameters
howRecursion type
Returns
failure (F) or success (T)

◆ ServerErrors()

std::string vomsdata::ServerErrors ( void )

Gets the error message returned by the server

◆ SetLifetime()

void vomsdata::SetLifetime ( int lifetime)

Set requested lifetime for the Contact() call.

Parameters
lifetimeRequested lifetime, in seconds

◆ SetRetryCount()

void vomsdata::SetRetryCount ( int retryCount)

◆ SetVerificationTime()

void vomsdata::SetVerificationTime ( time_t )

◆ SetVerificationType()

void vomsdata::SetVerificationType ( verify_type how)

Sets the type of verification done on the data.

Parameters
howThe type of verification.

◆ SkipSslInitialization()

void vomsdata::SkipSslInitialization ( )
static

Field Documentation

◆ data

std::vector<voms> vomsdata::data

User's info, as in the certificate extension. It may contain data gathered from more than one VOMS server,

Definition at line 375 of file voms_api.h.

◆ error

verror_type vomsdata::error

Error code

Definition at line 216 of file voms_api.h.

◆ extra_data

std::string vomsdata::extra_data

The data specified by the user with the –include switch.

Note that this field doesn't contain the result of a request to the VOMS server, but instead data specified by the user.

The reason for the introduction of this extension is to let a user include important data into his proxy certificate, like, for example, a kerberos ticket

Definition at line 379 of file voms_api.h.

◆ workvo

std::string vomsdata::workvo

The value of the -vo option of the voms-proxy-init command

Definition at line 378 of file voms_api.h.


The documentation for this struct was generated from the following file: