<%args> $workflow_type => undef $role => undef $profile => undef $subject_style => undef $keygen => undef $subject => undef $subject_alt_name => undef $info => undef $spkac => undef $pkcs10 => undef $key => undef <%init> my %params = (CONFIG => $CONFIG); ## which workflow type $params{workflow_type} = $m->comp ('/service/create_csr/get_workflow_type.mhtml', %params, 'workflow_type' => $workflow_type); return if (not defined $params{workflow_type}); ## which role $params{role} = $m->comp ('/service/create_csr/get_role.mhtml', %params, 'role' => $role); return if (not defined $params{role} or not length ($params{role})); ## which profile $params{profile} = $m->comp ('/service/create_csr/get_profile.mhtml', %params, 'profile' => $profile); return if (not defined $params{profile} or not length ($params{profile})); ## which subject style $params{subject_style} = $m->comp ('/service/create_csr/get_subject_style.mhtml', %params, 'subject_style' => $subject_style); return if (not defined $params{subject_style}); ## which key generation ## this is necessary in this phase ## because PKCS#10 parsing must before subject reading $params{keygen} = $m->comp ('/service/create_csr/get_keygen.mhtml', %params, 'keygen' => $keygen); return if (not defined $params{keygen}); ## get PKCS#10 if available if ($params{keygen} eq "PKCS10") { ## get the CSR ($params{pkcs10}, $subject) = $m->comp ('/service/create_csr/get_pkcs10.mhtml', %params, 'pkcs10' => $pkcs10, 'subject' => $subject); return if (not $params{pkcs10}); } ## get subject $params{subject} = $m->comp ('/service/create_csr/get_subject.mhtml', %params, 'subject' => $subject); return if (not $params{subject}); ## get subject alt name $params{subject_alt_name} = $m->comp ('/service/create_csr/get_subject_alt_name.mhtml', %params, 'subject_alt_name' => $subject_alt_name); return if (not $params{subject_alt_name}); ## get additional_infos $params{info} = $m->comp ('/service/create_csr/get_info.mhtml', %params, 'info' => $info); return if (not $params{info}); ## get generated request my $msg = undef; if ($params{keygen} eq "SPKAC") { $msg = $m->comp ('/service/create_csr/get_spkac.mhtml', %params, 'spkac' => $spkac); } elsif ($params{keygen} eq "SERVERSIDE") { ## serverside $params{key} = $m->comp ('/service/create_csr/get_server_key.mhtml', %params); return if (not $params{key}); $msg = $m->comp ('/service/create_csr/get_server_pkcs10.mhtml', %params); } else { if ($params{keygen} eq "IE") { $params{pkcs10} = $m->comp ('/service/create_csr/get_ie_pkcs10.mhtml', %params, 'pkcs10' => $pkcs10); return if (not $params{pkcs10}); } $msg = $m->comp ('/service/create_csr/store_pkcs10.mhtml', %params); return if (not $msg); } return if (not defined $msg); ## if we reach this point then the workflow is already created ## store and display CSR $m->comp ('/service/workflow/show_instance.html', 'msg' => $msg); <%once> my $CONFIG = { "ou_style" => { ROLE => [ "User", "RA Operator" ], KEY_GENERATION => ["SPKAC", "IE", "SERVERSIDE", "AUTO"], SUBJECT => [ [ ## 1.RDN { NAME => "uid", LABEL => "I18N_OPENXPKI_HTML_UID", DESCRIPTION => "I18N_OPENXPKI_HTML_UID_DESCRIPTION", MAXIMUM => "8", MINIMUM => "4", TYPE => "ascii", DEFAULT => "I18N_OPENXPKI_HTML_DEFAULT_UID" }, { NAME => "cn", LABEL => "I18N_OPENXPKI_HTML_COMMON_NAME", DESCRIPTION => "I18N_OPENXPKI_HTML_COMMON_NAME_DESCRIPTION", MAXIMUM => "64", MINIMUM => "2", TYPE => "utf8", DEFAULT => "I18N_OPENXPKI_HTML_DEFAULT_CN" }, ], [ ## 2.RDN { NAME => "ou", LABEL => "I18N_OPENXPKI_HTML_OU", DESCRIPTION => "I18N_OPENXPKI_HTML_OU_DESCRIPTION", MAXIMUM => "64", MINIMUM => "1", TYPE => "utf8", DEFAULT => ["IT Service"], SELECT => [{LABEL => "Sales", VALUE => "Sales"}, {LABEL => "Marketing", VALUE => "Marketing"}, {LABEL => "IT Service", VALUE => "IT Service"}] } ], [ ## 3.RDN { NAME => "o", LABEL => "I18N_OPENXPKI_HTML_ORGANIZATION", DESCRIPTION => "I18N_OPENXPKI_HTML_ORGANIZATION_DESCRIPTION", VALUE => "OpenXPKI" } ], [ ## 4.RDN { NAME => "c", LABEL => "I18N_OPENXPKI_HTML_COUNTRY", DESCRIPTION => "I18N_OPENXPKI_HTML_COUNTRY_DESCRIPTION", VALUE => "DE" } ], ], SUBJECT_ALT_NAME => ["email", "email", "UPN", "GUID", "DNS", "IP", "IP", "URI", "RID", "DirName"], INFOS => [ {NAME => "telephoneNumber", LABEL => "I18N_OPENXPKI_HTML_TELEPHONE_NUMBER", DESCRIPTION => "I18N_OPENXPKI_HTML_TELEPHONE_NUMBER_DESCRIPTION", TYPE => "text"}, {NAME => "faxNumber", LABEL => "I18N_OPENXPKI_HTML_FAX_NUMBER", DESCRIPTION => "I18N_OPENXPKI_HTML_FAX_NUMBER_DESCRIPTION", TYPE => "text"}, {NAME => "comment", LABEL => "I18N_OPENXPKI_HTML_COMMENT", DESCRIPTION => "I18N_OPENXPKI_HTML_COMMENT_DESCRIPTION", TYPE => "textarea"} ] }, "dc_style" => { ROLE => [ "User", "RA Operator" ], KEY_GENERATION => ["SPKAC", "IE", "SERVERSIDE", "PKCS10", "AUTO"], SUBJECT => [ [ ## 1.RDN { NAME => "uid", LABEL => "I18N_OPENXPKI_HTML_UID", DESCRIPTION => "I18N_OPENXPKI_HTML_UID_DESCRIPTION", MAXIMUM => "8", MINIMUM => "4", TYPE => "ascii", DEFAULT => "I18N_OPENXPKI_HTML_DEFAULT_UID" }, { NAME => "cn", LABEL => "I18N_OPENXPKI_HTML_COMMON_NAME", DESCRIPTION => "I18N_OPENXPKI_HTML_COMMON_NAME_DESCRIPTION", MAXIMUM => "64", MINIMUM => "2", TYPE => "utf8", DEFAULT => "I18N_OPENXPKI_HTML_DEFAULT_CN" }, ], [ ## 2.RDN { NAME => "ou", LABEL => "I18N_OPENXPKI_HTML_OU", DESCRIPTION => "I18N_OPENXPKI_HTML_OU_DESCRIPTION", MAXIMUM => "64", MINIMUM => "1", TYPE => "utf8", DEFAULT => ["Development"], SELECT => [{LABEL => "Development", VALUE => "Development"}, {LABEL => "Marketing", VALUE => "Marketing"}, {LABEL => "Support", VALUE => "Support"}, {LABEL => "Customers", VALUE => "Customers"}] } ], [ ## 3.RDN { NAME => "dc", LABEL => "I18N_OPENXPKI_HTML_ORGANIZATION", DESCRIPTION => "I18N_OPENXPKI_HTML_ORGANIZATION_DESCRIPTION", VALUE => "OpenXPKI" } ], [ ## 4.RDN { NAME => "dc", LABEL => "I18N_OPENXPKI_HTML_DOMAIN_COMPONENT", DESCRIPTION => "I18N_OPENXPKI_HTML_DOMAIN_COMPONENT_DESCRIPTION", VALUE => "org" } ], ], SUBJECT_ALT_NAME => ["email", "email", "UPN", "GUID", "DNS", "IP", "IP", "URI", "RID", "DirName"], INFOS => [ {NAME => "telephoneNumber", LABEL => "I18N_OPENXPKI_HTML_TELEPHONE_NUMBER", DESCRIPTION => "I18N_OPENXPKI_HTML_TELEPHONE_NUMBER_DESCRIPTION", TYPE => "text"}, {NAME => "faxNumber", LABEL => "I18N_OPENXPKI_HTML_FAX_NUMBER", DESCRIPTION => "I18N_OPENXPKI_HTML_FAX_NUMBER_DESCRIPTION", TYPE => "text"}, {NAME => "comment", LABEL => "I18N_OPENXPKI_HTML_COMMENT", DESCRIPTION => "I18N_OPENXPKI_HTML_COMMENT_DESCRIPTION", TYPE => "textarea"} ] }, };