namespace WebProvisioning
{
- public IdCard card;
+ IdCard card;
+ IdCard[] cards;
bool
check_stack (SList<string> stack, string[] reference)
}
bool
+ server_cert_handler (SList<string> stack)
+ {
+ string[] server_cert_path = {"server-cert", "trust-anchor", "identity", "identities"};
+
+ return check_stack (stack, server_cert_path);
+ }
+
+ bool
subject_alt_handler (SList<string> stack)
{
string[] subject_alt_path = {"subject-alt", "trust-anchor", "identity", "identities"};
return check_stack (stack, display_name_path);
}
+
+ public void
+ start_element_func (MarkupParseContext context,
+ string element_name,
+ string[] attribute_names,
+ string[] attribute_values) throws MarkupError
+ {
+ debug ("START %s", element_name);
+ }
- public void text_element_func (MarkupParseContext context,
- string text,
- size_t text_len) throws MarkupError
+ public void
+ text_element_func (MarkupParseContext context,
+ string text,
+ size_t text_len) throws MarkupError
{
unowned SList<string> stack = context.get_element_stack ();
}
else if (stack.nth_data(0) == "subject" && subject_handler (stack))
{
+ card.trust_anchor.subject = text;
}
else if (stack.nth_data(0) == "subject-alt" && subject_alt_handler (stack))
{
+ card.trust_anchor.subject_alt = text;
+ }
+ else if (stack.nth_data(0) == "server-cert" && server_cert_handler (stack))
+ {
+ card.trust_anchor.server_cert = text;
}
}
error ("Could not retreive file size");
}
+ card = new IdCard();
+
MarkupParser parser = {null, null, text_element_func, null, null};
var ctx = new MarkupParseContext(parser, 0, null, null);
error ("%s does not exist", args[1]);
}
- card = new IdCard();
-
var webp = new WebProvisionParser (args[1]);
debug ("'%s' '%s' '%s' '%s'", card.display_name, card.username, card.password, card.issuer);