| Lasso Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
LassoServer;
LassoServer* lasso_server_new (const gchar *metadata,
const gchar *private_key,
const gchar *private_key_password,
const gchar *certificate);
LassoServer* lasso_server_new_from_buffers (const gchar *metadata,
const gchar *private_key_content,
const gchar *private_key_password,
const gchar *certificate_content);
LassoServer* lasso_server_new_from_dump (const gchar *dump);
lasso_error_t lasso_server_add_provider (LassoServer *server,
LassoProviderRole role,
const gchar *metadata,
const gchar *public_key,
const gchar *ca_cert_chain);
lasso_error_t lasso_server_add_provider_from_buffer
(LassoServer *server,
LassoProviderRole role,
const gchar *metadata,
const gchar *public_key,
const gchar *ca_cert_chain);
void lasso_server_destroy (LassoServer *server);
gchar* lasso_server_dump (LassoServer *server);
LassoProvider* lasso_server_get_provider (const LassoServer *server,
const gchar *providerID);
lasso_error_t lasso_server_set_encryption_private_key
(LassoServer *server,
const gchar *filename_or_buffer);
lasso_error_t lasso_server_set_encryption_private_key_with_password
(LassoServer *server,
const gchar *filename_or_buffer,
const gchar *password);
lasso_error_t lasso_server_load_affiliation (LassoServer *server,
const gchar *filename);
lasso_error_t lasso_server_saml2_assertion_setup_signature
(LassoServer *server,
LassoSaml2Assertion *saml2_assertion);
It holds the data about a provider, other providers it knows, which certificates to use, etc.
typedef struct {
LassoProvider parent;
GHashTable *providers; /* of LassoProvider */
/* Can actually contain LassoDataService or LassoIdWsf2DataService or any subclass */
gchar *private_key;
gchar *private_key_password;
gchar *certificate;
LassoSignatureMethod signature_method;
} LassoServer;
LassoServer* lasso_server_new (const gchar *metadata, const gchar *private_key, const gchar *private_key_password, const gchar *certificate);
Creates a new LassoServer.
|
path to the provider metadata file or NULL, for a LECP server |
|
path to the the server private key file or NULL |
|
password to private key if it is encrypted, or NULL |
|
path to the server certificate file, or NULL |
Returns : |
a newly created LassoServer object; or NULL if an error occured |
LassoServer* lasso_server_new_from_buffers (const gchar *metadata, const gchar *private_key_content, const gchar *private_key_password, const gchar *certificate_content);
Creates a new LassoServer.
|
NULL terminated string containing the content of an ID-FF 1.2 metadata file |
|
NULL terminated string containing a PEM formatted private key |
|
a NULL terminated string which is the optional password of the private key |
|
NULL terminated string containing a PEM formatted X509 certificate |
Returns : |
a newly created LassoServer object; or NULL if an error occured |
LassoServer* lasso_server_new_from_dump (const gchar *dump);
Restores the dump to a new LassoServer.
|
XML server dump |
Returns : |
a newly created LassoServer; or NULL if an error occured |
lasso_error_t lasso_server_add_provider (LassoServer *server,
LassoProviderRole role,
const gchar *metadata,
const gchar *public_key,
const gchar *ca_cert_chain);
Creates a new LassoProvider and makes it known to the server
|
a LassoServer |
|
provider role, identity provider or service provider |
|
path to the provider metadata file |
|
provider public key file (may be a certificate) or NULL |
|
provider CA certificate chain file or NULL |
Returns : |
0 on success; a negative value if an error occured. |
lasso_error_t lasso_server_add_provider_from_buffer
(LassoServer *server,
LassoProviderRole role,
const gchar *metadata,
const gchar *public_key,
const gchar *ca_cert_chain);
Creates a new LassoProvider and makes it known to the server
|
a LassoServer |
|
provider role, identity provider or service provider |
|
a string buffer containg the metadata file for a new provider |
|
provider public key file (may be a certificate) or NULL |
|
provider CA certificate chain file or NULL |
Returns : |
0 on success; a negative value if an error occured. |
void lasso_server_destroy (LassoServer *server);
Destroys a server.
|
a LassoServer |
gchar* lasso_server_dump (LassoServer *server);
Dumps server content to an XML string.
|
a LassoServer |
Returns : |
the dump string. It must be freed by the caller.. transfer full. |
LassoProvider* lasso_server_get_provider (const LassoServer *server,
const gchar *providerID);
Looks up for a LassoProvider whose ID is providerID and returns it.
|
a LassoServer |
|
the provider ID |
Returns : |
transfer none. transfer none. |
lasso_error_t lasso_server_set_encryption_private_key
(LassoServer *server,
const gchar *filename_or_buffer);
lasso_server_set_encryption_private_key has been deprecated since version 2.3 and should not be used in newly-written code. Use lasso_server_set_encryption_private_key_with_password() instead.
Load an encryption private key from a file and set it in the server object
If filename_or_buffer is NULL, it frees the currently setted key.
|
a LassoServer |
|
file name of the encryption key to load or its content as a NULL-terminated string. |
Returns : |
0 on success; another value if an error occured. |
lasso_error_t lasso_server_set_encryption_private_key_with_password
(LassoServer *server,
const gchar *filename_or_buffer,
const gchar *password);
Load an encryption private key from a file and set it in the server object. If password is
non-NULL try to decrypt the key with it.
If filename_or_buffer is NULL, it frees the currently setted key.
|
a LassoServer |
|
file name of the encryption key to load or its content as a NULL-terminated string. |
|
an optional password to decrypt the encryption key. |
Returns : |
0 on success; another value if an error occured. |
Since 2.3
lasso_error_t lasso_server_load_affiliation (LassoServer *server,
const gchar *filename);
Load an affiliation metadata file into server; this must be called after
providers have been added to server.
|
a LassoServer |
|
file name of the affiliation metadata to load |
Returns : |
0 on success; another value if an error occured. |
lasso_error_t lasso_server_saml2_assertion_setup_signature
(LassoServer *server,
LassoSaml2Assertion *saml2_assertion);
Configure signature on a saml2:Assertion element.
|
a LassoServer object |
|
a LassoSaml2Assertion object |
Returns : |
0 if successfull, an error code otherwise. |