public class TrustAnchor : Object
{
- public static const string TYPE_CA_CERT = _("CA Certificate");
- public static const string TYPE_ENTERPRISE = _("Enterprise provisioned");
-
+ public enum TrustAnchorType {
+ CA_CERT,
+ SERVER_CERT
+ }
private string _ca_cert = "";
private string _subject = "";
return ca_cert == "" && subject == "" && subject_alt == "" && server_cert == "";
}
- public string get_anchor_type() {
- return server_cert == "" ? TYPE_CA_CERT : TYPE_ENTERPRISE;
+ public TrustAnchorType get_anchor_type() {
+ return server_cert == "" ? TrustAnchorType.CA_CERT : TrustAnchorType.SERVER_CERT;
}
public int Compare(TrustAnchor other)
update_id_card_label()
{
// !!TODO: Use a table to format the labels and values
- string services_text = "Services: ";
- string service_spacer = "\n ";
+ string services_text = _("Services: ");
+ string service_spacer = _("\n ");
- var label_text = Markup.printf_escaped("<big>%s</big>", this.id_card.display_name);
+ var label_text = Markup.printf_escaped(_("<big>%s</big>"), this.id_card.display_name);
if (is_selected)
{
label_text += "\nUsername: " + id_card.username;
label_text += "\nRealm: " + id_card.issuer;
if (!id_card.trust_anchor.is_empty()) {
- label_text += "\nTrust anchor: " + id_card.trust_anchor.get_anchor_type();
+ label_text += _("\nTrust anchor: Enterprise provisioned");
}
services_text += this.id_card.get_services_string(service_spacer);
- label_text += "\n" + services_text;
+ label_text += _("\n") + services_text;
}
label.set_markup(label_text);
private bool check_and_confirm_trust_anchor(IdCard id)
{
- if (!id.trust_anchor.is_empty() && id.trust_anchor.get_anchor_type() == TrustAnchor.TYPE_ENTERPRISE) {
+ if (!id.trust_anchor.is_empty() && id.trust_anchor.get_anchor_type() == TrustAnchor.TrustAnchorType.SERVER_CERT) {
if (get_string_setting("TrustAnchors", id.nai) != id.trust_anchor.server_cert) {
bool ret = false;