Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

CODEX_Client::Interface Namespace Reference

This nested namespace holds a singleton Interface which is only needed for building interfaces to C or other languages that support C hooks but not C++. More...


Compounds

struct  codex_binding_t
 C representation of a CODEX name binding. More...

struct  codex_credentials_t
 C representation of a CODEX credentials object. More...

struct  codex_policy_t
 C representation of a CODEX policy. More...

class  Interface
 This class is a singleton instance of CODEX_Client::Client. More...


Functions

void codex_zero_policy (codex_policy_t *policy)
 Zero the elements of a codex_policy_t.

void codex_zero_credentials (codex_credentials_t *credentials)
 Zero the elements of a codex_credentials_t.

void codex_zero_binding (codex_binding_t *binding)
 Zero the elements of a codex_binding_t.

codex_policy_tcodex_new_policy ()
 Allocate a new codex_policy_t.

codex_credentials_tcodex_new_credentials ()
 Allocate a new codex_credentials_t.

codex_binding_tcodex_new_binding ()
 Allocate a new codex_binding_t.

void codex_clear_policy (codex_policy_t *policy)
 Clear a codex_policy_t.

void codex_clear_credentials (codex_credentials_t *credentials)
 Clear a codex_credentials_t.

void codex_clear_binding (codex_binding_t *binding)
 Clear a codex_binding_t.

void codex_free_policy (codex_policy_t *policy)
 Free a codex_policy_t.

void codex_free_credentials (codex_credentials_t *credentials)
 Free a codex_credentials_t.

void codex_free_binding (codex_binding_t *binding)
 Free a codex_binding_t.

int codex_parse_binding (codex_binding_t *binding)
 Parse the binding returned from codex_create_key to fill the various fields.

int codex_set_server (const char *name, int port)
 Set the remote server.

int codex_set_service_key (const X509 *cert)
 Set the service's RSA public key certificate.

int codex_set_key_pair (const X509 *cert, const RSA *key)
 Set the client's RSA public/private key pair.

int codex_create_policy (const RSA *policy_pub_key, const RSA *owner_priv_key, codex_policy_t *policy)
 Create a read/write policy.

int codex_issue_credentials (const RSA *client_pub_key, const RSA *policy_priv_key, codex_credentials_t *credentials)
 Create read/write credentials.

int codex_create_key (const unsigned char *name, int length, const X509 *owner_cert, const codex_policy_t *read_policy, const codex_policy_t *write_policy, codex_binding_t *binding)
 Bind a name and access control policies.

int codex_write_key (const unsigned char *name, int length, const BIGNUM *key_value, const codex_credentials_t *credentials, const RSA *cred_private_key, const codex_binding_t *binding)
 Associate a value with a name.

int codex_read_key (const unsigned char *name, int length, const codex_credentials_t *credentials, const RSA *cred_private_key, BIGNUM **returned_key_value)
 Retrieve the value associate with a name.

int codex_to_file (const char *fname)
 Save the client's state to a file.

int codex_from_file (const char *fname)
 Read the client's state from a file.

void codex_clean_up ()
 Clean up the local state.


Detailed Description

This nested namespace holds a singleton Interface which is only needed for building interfaces to C or other languages that support C hooks but not C++.

An example of this might be a SWIG interface from which to build packages for Perl, Python, or Tcl.


Function Documentation

void CODEX_Client::Interface::codex_clear_binding codex_binding_t   binding
 

Clear a codex_binding_t.

This goes through an existing binding structure and clears all of the elements.

Parameters:
binding  A pointer to the structure to clear.

Definition at line 98 of file client_functions.cc.

References codex_free_policy(), codex_zero_binding(), CODEX_Client::Interface::codex_binding_t::data, CODEX_Client::Interface::codex_binding_t::name, CODEX_Client::Interface::codex_binding_t::owner, CODEX_Client::Interface::codex_binding_t::read_policy, CODEX_Client::Interface::codex_binding_t::signature, and CODEX_Client::Interface::codex_binding_t::write_policy.

Referenced by codex_create_key(), codex_free_binding(), and codex_parse_binding().

void CODEX_Client::Interface::codex_clear_credentials codex_credentials_t   credentials
 

Clear a codex_credentials_t.

This goes through an existing credentials structure and clears all of the elements.

Parameters:
credentials  A pointer to the structure to clear.

Definition at line 90 of file client_functions.cc.

References codex_zero_credentials(), and CODEX_Client::Interface::codex_credentials_t::data.

Referenced by codex_free_credentials(), and codex_issue_credentials().

void CODEX_Client::Interface::codex_clear_policy codex_policy_t   policy
 

Clear a codex_policy_t.

This goes through an existing policy structure and clears all of the elements.

Parameters:
policy  A pointer to the structure to clear.

Definition at line 83 of file client_functions.cc.

References codex_zero_policy(), and CODEX_Client::Interface::codex_policy_t::data.

Referenced by codex_create_policy(), and codex_free_policy().

int CODEX_Client::Interface::codex_create_key const unsigned char *    name,
int    length,
const X509 *    owner_cert,
const codex_policy_t   read_policy,
const codex_policy_t   write_policy,
codex_binding_t   binding
 

Bind a name and access control policies.

Bug:
Have to cast away const for X509_dup

Have to cast away const for unmarshal

Definition at line 395 of file client_functions.cc.

References codex_clear_binding(), CODEX_Client::Client::createKey(), CODEX_Client::Interface::codex_binding_t::data, CODEX_Client::Interface::codex_policy_t::data, CODEX_Client::Interface::codex_binding_t::length, CODEX_Client::Interface::codex_policy_t::length, and CODEX_Ciphers::Policy::unmarshal().

int CODEX_Client::Interface::codex_create_policy const RSA *    policy_pub_key,
const RSA *    owner_priv_key,
codex_policy_t   policy
 

Create a read/write policy.

Parameters:
policy_pub_key  The public key specifying the access policy.
owner_priv_key  The owner's private key, which will be used to sign policy_pub_key.
policy  A pointer to an allocated policy struct.
Return values:
1  The policy was created.
0  An error occurred.

Definition at line 304 of file client_functions.cc.

References codex_clear_policy(), CODEX_Client::Client::createPolicy(), CODEX_Client::Interface::codex_policy_t::data, CODEX_Client::Interface::codex_policy_t::length, and CODEX_Ciphers::Policy::marshal().

void CODEX_Client::Interface::codex_free_binding codex_binding_t   binding
 

Free a codex_binding_t.

This will free the memory held by the structure as well as the structure itself, and should only be used with dynamically allocated codex_binding_ts. Statically allocated structures should just call codex_clear_binding.

Parameters:
binding  The dynamically allocated binding to free.

Definition at line 233 of file client_functions.cc.

References codex_clear_binding().

void CODEX_Client::Interface::codex_free_credentials codex_credentials_t   credentials
 

Free a codex_credentials_t.

This will free the memory held by the structure as well as the structure itself, and should only be used with dynamically allocated codex_credentials_ts. Statically allocated structures should just call codex_clear_credentials.

Parameters:
credentials  The dynamically allocated credentials to free.

Definition at line 225 of file client_functions.cc.

References codex_clear_credentials().

void CODEX_Client::Interface::codex_free_policy codex_policy_t   policy
 

Free a codex_policy_t.

This will free the memory held by the structure as well as the structure itself, and should only be used with dynamically allocated codex_policy_ts. Statically allocated structures should just call codex_clear_policy.

Parameters:
policy  The dynamically allocated policy to free.

Definition at line 218 of file client_functions.cc.

References codex_clear_policy().

Referenced by codex_clear_binding().

int CODEX_Client::Interface::codex_from_file const char *    fname
 

Read the client's state from a file.

Parameters:
fname  The name of the file.
Return values:
1  The state information was successfully read.
0  An error occurred.
See also:
CODEX_Client::Client::fromFile()

Definition at line 599 of file client_functions.cc.

References CODEX_Client::Client::fromFile().

int CODEX_Client::Interface::codex_issue_credentials const RSA *    client_pub_key,
const RSA *    policy_priv_key,
codex_credentials_t   credentials
 

Create read/write credentials.

Parameters:
client_pub_key  The public key of the credentials holder.
policy_priv_key  The private key for the access policy, which will be used to sign policy_pub_key.
credentials  A pointer to an allocated credentials struct.
Return values:
1  The credentials were created.
0  An error occurred.

Definition at line 348 of file client_functions.cc.

References codex_clear_credentials(), CODEX_Client::Interface::codex_credentials_t::data, CODEX_Client::Client::issueCredentials(), CODEX_Client::Interface::codex_credentials_t::length, and CODEX_Ciphers::Credentials::marshal().

int CODEX_Client::Interface::codex_parse_binding codex_binding_t   binding
 

Parse the binding returned from codex_create_key to fill the various fields.

Bug:
Have to cast away const for X509_dup

Definition at line 139 of file client_functions.cc.

References codex_clear_binding(), CODEX_Client::Interface::codex_policy_t::data, CODEX_Client::Interface::codex_binding_t::data, CODEX_Client::Interface::codex_policy_t::length, CODEX_Client::Interface::codex_binding_t::length, CODEX_Client::Interface::codex_binding_t::name, CODEX_Client::Interface::codex_binding_t::namelen, CODEX_Client::Interface::codex_binding_t::owner, CODEX_Client::Interface::codex_binding_t::read_policy, CODEX_Client::Interface::codex_binding_t::signature, and CODEX_Client::Interface::codex_binding_t::write_policy.

int CODEX_Client::Interface::codex_read_key const unsigned char *    name,
int    length,
const codex_credentials_t   credentials,
const RSA *    cred_private_key,
BIGNUM **    returned_key_value
 

Retrieve the value associate with a name.

Bug:
Have to cast away const for unmarshal

Definition at line 526 of file client_functions.cc.

References CODEX_Client::Interface::codex_credentials_t::data, CODEX_Client::Interface::codex_credentials_t::length, CODEX_Client::Client::readKey(), and CODEX_Ciphers::Credentials::unmarshal().

int CODEX_Client::Interface::codex_set_key_pair const X509 *    cert,
const RSA *    key
 

Set the client's RSA public/private key pair.

Bug:
Have to cast away const for X509_dup

Definition at line 280 of file client_functions.cc.

References CODEX_Client::Client::setKeyPair().

int CODEX_Client::Interface::codex_set_server const char *    name,
int    port
 

Set the remote server.

Parameters:
name  Null-terminated string containing remote host name.
port  Port on the remote server to contact.
Return values:
1  Server information was successfully set up.
0  An error occurred.

Definition at line 241 of file client_functions.cc.

References CODEX_Client::Client::setRemoteServer().

int CODEX_Client::Interface::codex_set_service_key const X509 *    cert
 

Set the service's RSA public key certificate.

Parameters:
cert  The certificate identifying the service.
Return values:
1  The key was set.
0  An error occurred.

Definition at line 260 of file client_functions.cc.

References CODEX_Client::Client::setServiceKey().

int CODEX_Client::Interface::codex_to_file const char *    fname
 

Save the client's state to a file.

Parameters:
fname  The name of the file.
Return values:
1  The state information was successfully written.
0  An error occurred.
See also:
CODEX_Client::Client::toFile()

Definition at line 580 of file client_functions.cc.

References CODEX_Client::Client::toFile().

int CODEX_Client::Interface::codex_write_key const unsigned char *    name,
int    length,
const BIGNUM *    key_value,
const codex_credentials_t   credentials,
const RSA *    cred_private_key,
const codex_binding_t   binding
 

Associate a value with a name.

Bug:
Have to cast away const for unmarshal

Definition at line 464 of file client_functions.cc.

References CODEX_Client::Interface::codex_binding_t::data, CODEX_Client::Interface::codex_credentials_t::data, CODEX_Client::Interface::codex_binding_t::length, CODEX_Client::Interface::codex_credentials_t::length, CODEX_Ciphers::Credentials::unmarshal(), and CODEX_Client::Client::writeKey().

void CODEX_Client::Interface::codex_zero_binding codex_binding_t   binding
 

Zero the elements of a codex_binding_t.

This does not do any memory management, it just provides a convenient single-call way to zero out everything. This is useful for statically allocated structures, just to make sure they're properly initialized.

Parameters:
binding  The binding to zero.

Definition at line 69 of file client_functions.cc.

References CODEX_Client::Interface::codex_binding_t::data, CODEX_Client::Interface::codex_binding_t::length, CODEX_Client::Interface::codex_binding_t::name, CODEX_Client::Interface::codex_binding_t::namelen, CODEX_Client::Interface::codex_binding_t::owner, CODEX_Client::Interface::codex_binding_t::read_policy, CODEX_Client::Interface::codex_binding_t::signature, and CODEX_Client::Interface::codex_binding_t::write_policy.

Referenced by codex_clear_binding(), and codex_new_binding().

void CODEX_Client::Interface::codex_zero_credentials codex_credentials_t   credentials
 

Zero the elements of a codex_credentials_t.

This does not do any memory management, it just provides a convenient single-call way to zero out everything. This is useful for statically allocated structures, just to make sure they're properly initialized.

Parameters:
credentials  The credentials to zero.

Definition at line 61 of file client_functions.cc.

References CODEX_Client::Interface::codex_credentials_t::data, and CODEX_Client::Interface::codex_credentials_t::length.

Referenced by codex_clear_credentials(), and codex_new_credentials().

void CODEX_Client::Interface::codex_zero_policy codex_policy_t   policy
 

Zero the elements of a codex_policy_t.

This does not do any memory management, it just provides a convenient single-call way to zero out everything. This is useful for statically allocated structures, just to make sure they're properly initialized.

Parameters:
policy  The policy to zero.

Definition at line 54 of file client_functions.cc.

References CODEX_Client::Interface::codex_policy_t::data, and CODEX_Client::Interface::codex_policy_t::length.

Referenced by codex_clear_policy(), and codex_new_policy().


Generated on Wed Jun 2 16:33:06 2004 for COrnell Data EXchange (CODEX) by doxygen1.2.18