![]() |
![]() |
![]() |
Lasso Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
enum LassoMessageFormat; enum LassoSignatureType; enum LassoSignatureMethod; LassoNodeClassData; struct LassoNode; LassoNode * lasso_node_new (void
); LassoNode * lasso_node_new_from_dump (const char *dump
); LassoNode * lasso_node_new_from_soap (const char *soap
); LassoNode * lasso_node_new_from_xmlNode (xmlNode *node
); void lasso_node_cleanup_original_xmlnodes (LassoNode *node
); void lasso_node_destroy (LassoNode *node
); char * lasso_node_dump (LassoNode *node
); char * lasso_node_debug (LassoNode *node
,int level
); char * lasso_node_export_to_base64 (LassoNode *node
); char * lasso_node_export_to_query (LassoNode *node
,LassoSignatureMethod sign_method
,const char *private_key_file
); char * lasso_node_export_to_query_with_password (LassoNode *node
,LassoSignatureMethod sign_method
,const char *private_key_file
,const char *private_key_file_password
); char * lasso_node_export_to_soap (LassoNode *node
); gchar * lasso_node_export_to_xml (LassoNode *node
); char * lasso_node_export_to_paos_request (LassoNode *node
,const char *issuer
,const char *responseConsumerURL
,const char *relay_state
); char * lasso_node_export_to_ecp_soap_response (LassoNode *node
,const char *assertionConsumerURL
); xmlNode * lasso_node_get_xmlNode (LassoNode *node
,gboolean lasso_dump
); const char * lasso_node_get_name (LassoNode *node
); xmlNode * lasso_node_get_original_xmlnode (LassoNode *node
); void lasso_node_set_original_xmlnode (LassoNode *node
,xmlNode *xmlnode
); void lasso_node_set_custom_namespace (LassoNode *node
,const char *prefix
,const char *href
); void lasso_node_set_custom_nodename (LassoNode *node
,const char *nodename
); const char * lasso_node_get_namespace (LassoNode *node
); LassoMessageFormat lasso_node_init_from_message (LassoNode *node
,const char *message
); gboolean lasso_node_init_from_query (LassoNode *node
,const char *query
); lasso_error_t lasso_node_init_from_xml (LassoNode *node
,xmlNode *xmlnode
); const char * lasso_strerror (int error_code
);
LassoNode is the base class for Lasso objects; just a step over GObject as defined in glib.
typedef enum { LASSO_MESSAGE_FORMAT_XSCHEMA_ERROR = -2, LASSO_MESSAGE_FORMAT_ERROR = -1, LASSO_MESSAGE_FORMAT_UNKNOWN, LASSO_MESSAGE_FORMAT_XML, LASSO_MESSAGE_FORMAT_BASE64, LASSO_MESSAGE_FORMAT_QUERY, LASSO_MESSAGE_FORMAT_SOAP } LassoMessageFormat;
Return code for lasso_node_init_from_message; it describes the type of the message that was passed to that function.
typedef enum { LASSO_SIGNATURE_TYPE_NONE = 0, LASSO_SIGNATURE_TYPE_SIMPLE, LASSO_SIGNATURE_TYPE_WITHX509, LASSO_SIGNATURE_TYPE_LAST } LassoSignatureType;
Signature type.
typedef enum { LASSO_SIGNATURE_METHOD_RSA_SHA1 = 1, LASSO_SIGNATURE_METHOD_DSA_SHA1, LASSO_SIGNATURE_METHOD_LAST } LassoSignatureMethod;
Signature method.
struct LassoNode { GObject parent; };
Base type for all XML contents, or for object using serialization to XML.
LassoNode * lasso_node_new (void
);
Creates a new LassoNode.
Returns : |
a newly created LassoNode object |
LassoNode * lasso_node_new_from_dump (const char *dump
);
Restores the dump
to a new LassoNode subclass.
|
XML object dump |
Returns : |
a newly created object; or NULL if an error occured. |
LassoNode * lasso_node_new_from_soap (const char *soap
);
Parses SOAP message and creates a new Lasso object with the right class.
|
the SOAP message |
Returns : |
node if success; NULL otherwise |
LassoNode * lasso_node_new_from_xmlNode (xmlNode *node
);
Builds a new LassoNode from an xmlNode.
|
an xmlNode |
Returns : |
a new node |
void lasso_node_cleanup_original_xmlnodes
(LassoNode *node
);
node
: a LassoNode
Traverse the LassoNode tree starting at Node and remove keeped xmlNode if one is found.
Returns : |
None |
void lasso_node_destroy (LassoNode *node
);
Destroys the LassoNode.
|
a LassoNode |
char * lasso_node_dump (LassoNode *node
);
Dumps node
. All datas in object are dumped in an XML format.
|
a LassoNode |
Returns : |
a full XML dump of node . The string must be freed by the
caller. [transfer full]
|
char * lasso_node_debug (LassoNode *node
,int level
);
Create a debug dump for node
, it is pretty printed so any contained signature will be
uncheckable.
|
a LassoNode |
|
the indentation depth, i.e. the depth of the last nodes to be indented. [default 10] |
Returns : |
a full indented and so human readable dump of node . The string must be freed by
the caller. [transfer full]
|
char * lasso_node_export_to_base64 (LassoNode *node
);
Exports node
to a base64-encoded message.
|
a LassoNode |
Returns : |
a base64-encoded export of node . The string must be freed by
the caller. |
char * lasso_node_export_to_query (LassoNode *node
,LassoSignatureMethod sign_method
,const char *private_key_file
);
Exports node
to a HTTP query string. If private_key_file
is NULL,
query won't be signed.
|
a LassoNode |
|
the Signature transform method. [default 1] |
|
the path to the private key (may be NULL) |
Returns : |
a HTTP query export of node . The string must be freed by the
caller. |
char * lasso_node_export_to_query_with_password (LassoNode *node
,LassoSignatureMethod sign_method
,const char *private_key_file
,const char *private_key_file_password
);
Exports node
to a HTTP query string. If private_key_file
is NULL,
query won't be signed.
|
a LassoNode |
|
the Signature transform method. [default 1] |
|
the path to the private key (may be NULL) |
|
the password needed to decrypt the private key |
Returns : |
a HTTP query export of node . The string must be freed by the
caller. |
char * lasso_node_export_to_soap (LassoNode *node
);
Exports node
to a SOAP message.
|
a LassoNode |
Returns : |
a SOAP export of node . The string must be freed by the
caller. |
gchar * lasso_node_export_to_xml (LassoNode *node
);
Exports node
to an xml message.
|
a LassoNode |
Returns : |
an xml export of node . The string must be freed by the
caller. |
char * lasso_node_export_to_paos_request (LassoNode *node
,const char *issuer
,const char *responseConsumerURL
,const char *relay_state
);
Exports node
to a PAOS message.
|
a LassoNode |
Returns : |
a PAOS export of node . The string must be freed by the
caller. |
char * lasso_node_export_to_ecp_soap_response (LassoNode *node
,const char *assertionConsumerURL
);
Exports node
to a ECP SOAP message.
|
a LassoNode |
Returns : |
a ECP SOAP export of node . The string must be freed by the
caller. |
xmlNode * lasso_node_get_xmlNode (LassoNode *node
,gboolean lasso_dump
);
Builds an XML representation of node
.
|
a LassoNode |
|
whether to include lasso-specific nodes |
Returns : |
a new xmlNode. It must be freed by the caller. |
const char * lasso_node_get_name (LassoNode *node
);
Return the XML element name for this object, the one that would be used in the XML dump of this object.
|
a LassoNode |
Returns : |
the name of the object, the value must not be stored. |
xmlNode * lasso_node_get_original_xmlnode (LassoNode *node
);
Retrieve the original xmlNode eventually associated to this LassoNode.
|
a LassoNode |
Returns : |
an xmlNodePtr or NULL. |
void lasso_node_set_original_xmlnode (LassoNode *node
,xmlNode *xmlnode
);
Set the underlying XML representation of the object.
|
the LassoNode object |
|
an xmlNode |
void lasso_node_set_custom_namespace (LassoNode *node
,const char *prefix
,const char *href
);
Set a custom namespace for an object instance, use it with object existing a lot of revision of the nearly same namespace.
|
a LassoNode object |
|
the prefix to use for the definition |
|
the URI of the namespace |
void lasso_node_set_custom_nodename (LassoNode *node
,const char *nodename
);
Set a custom nodename for an object instance, use it with object implement a schema type and not a real element.
|
a LassoNode object |
|
the name to use for the node |
LassoMessageFormat lasso_node_init_from_message (LassoNode *node
,const char *message
);
Parses message
and initialiazes node
fields with data from it. Message
type may be base64, SOAP, XML or query string, correct type is found
automatically.
|
a LassoNode (or derived class) |
|
a Liberty message |
Returns : |
a LassoMessageFormat value. |
gboolean lasso_node_init_from_query (LassoNode *node
,const char *query
);
Initialiazes node
fields with data from query
string.
lasso_error_t lasso_node_init_from_xml (LassoNode *node
,xmlNode *xmlnode
);
Initialiazes node
fields with data from xmlnode
XML node.
|
a LassoNode (or derived class) |
|
the libxml2 node |
Returns : |
0 on success; or a negative value otherwise. |