File: wss_keys.vspx

package info (click to toggle)
virtuoso-opensource 6.1.6+dfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 260,992 kB
  • ctags: 125,220
  • sloc: ansic: 652,748; sql: 458,419; xml: 282,834; java: 61,031; sh: 40,031; cpp: 36,890; cs: 25,240; php: 12,692; yacc: 9,523; lex: 7,018; makefile: 6,157; jsp: 4,484; awk: 1,643; perl: 1,013; ruby: 1,003; python: 326
file content (155 lines) | stat: -rw-r--r-- 5,941 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?xml version="1.0"?>
<!--
 -
 -  $Id$
 -  
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -  
 -  Copyright (C) 1998-2012 OpenLink Software
 -  
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -  
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -  
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -  
 -  
-->
<v:page name="plinks_page" decor="bpel_decor.vspx" style="bpel_style_new.xsl" xmlns:v="http://www.openlinksw.com/vspx/"  xmlns:vm="http://www.openlinksw.com/vspx/macro">

  <v:on-init><![CDATA[
      set isolation='committed';
      self.get_keys ('');
    ]]></v:on-init>
  <v:method name="get_keys" arglist="in nam any"><![CDATA[
    declare opts, keys any;
    opts := coalesce (DB.DBA.USER_GET_OPTION ('BPEL', 'keys'), vector ());
    keys := '<keys>';
    foreach (any k in opts) do
      {
        if (isstring (k))
	  keys := keys || sprintf ('<key name="%s"/>', k);
      }
    if (length (nam))
      keys := keys || sprintf ('<key name="%s"/>', nam);
    keys := keys || '</keys>';
    self.keys := xtree_doc (keys);
    ]]></v:method>

<vm:pagewrapper>
  <v:variable name="keys" type="any" default="null" />

  <vm:pagetitle>OpenLink BPEL Process Manager Security Tokens</vm:pagetitle>

  <vm:pagebody>
    <v:form name="upl" type="simple" method="POST" action="" xhtml_enctype="multipart/form-data">
      <table width="100%" border="0" cellpadding="0" cellspacing="0" id="content">
	<tr>
	  <td>
	    <table border="0" cellpadding="0" cellspacing="0" id="contentlist">
	<tr>
	  <th class="info" colspan="2">Security tokens </th>
	</tr>
        <tr>
          <td colspan="2">
            <?vsp http(sprintf('<a target="_blank" href="help.vspx?id=wss_keys&sid=%s&realm=%s\r\n"><img title="Help" alt="Help" src="i/help_24.gif" border="0" /></a>', self.sid ,self.realm));?>
            <?vsp http(sprintf('<a target="_blank" href="help.vspx?id=wss_keys&sid=%s&realm=%s\r\n"> Help</a>', self.sid ,self.realm));?>
          </td>
        </tr>
	<tr>
	  <td colspan="2" style="color:red"><v:error-summary/></td>
	</tr>
	<tr>
	  <td align="right">
            <v:url name="wXCERT" value="X.509 Certificate file" url="--sprintf('help.vspx?id=wss_keys&name=pu_xcert')" xhtml_target="_blank"/>
          </td>
	  <td>
	    <v:text name="certin" value="" type="file" xhtml_class="m_e" xhtml_size="50" error-glyph="*"/>
	  </td>
	</tr>
	<tr>
	  <td align="right">
            <v:url name="wFTYPE" value="File type" url="--sprintf('help.vspx?id=wss_keys&name=pu_ftype')" xhtml_target="_blank"/>
          </td>
	  <td>
	    <v:select-list name="certty" xhtml_class="m_e">
	      <v:item name="PKCS12" value="PKCS12"/>
	      <v:item name="DER" value="DER"/>
	      <v:item name="PEM" value="PEM"/>
	    </v:select-list>
	  </td>
	</tr>
	<tr>
	  <td align="right">
            <v:url name="wPWSD" value="Password for Private key unlocking type" url="--sprintf('help.vspx?id=wss_keys&name=pu_pswd')" xhtml_target="_blank"/>
          </td>
	  <td>
	    <v:text name="certpass" value="" type="password" xhtml_size="50"/>
	  </td>
	</tr>
	<tr>
          <td align="right">&nbsp;</td>
	  <td>
	    <v:button name="upl1" action="simple" value="i/import_data_16.png" style="image" xhtml_title="Upload" xhtml_alt="Upload" text="&#160;Upload">
	      <v:on-post>
		declare cf, nam, ty any;
		nam := get_keyword ('filename', get_keyword ('attr-certin', e.ve_params, vector ()));
		--dbg_obj_print (nam);
		ty := case self.certty.ufl_value when 'PKCS12' then 2 when 'DER' then 1 else 0 end;
		cf := get_certificate_info (6, self.certin.ufl_value, ty, self.certpass.ufl_value);
		if (cf is null)
		  {
		    self.certin.vc_error_message := 'Invalid certificate file or wrong password';
		    self.vc_is_valid := 0;
		  }
		else
		  {
		    self.get_keys (nam);
		    self.wkey.ufl_value := null;
		    self.wkey.vc_data_bind (e);
		    set_user_id ('BPEL');
		    DB.DBA.USER_KEY_LOAD (nam, self.certin.ufl_value,
		    'X.509', self.certty.ufl_value, self.certpass.ufl_value, null, 1);
		  }
	     </v:on-post>
	   </v:button>
	 </td>
       </tr>
	<tr>
	  <td align="right">
            <v:url name="wEKEY" value="Select existing key" url="--sprintf('help.vspx?id=wss_keys&name=pu_wkey')" xhtml_target="_blank"/>
          </td>
	  <td>
	    <v:data-list name="wkey"
	      list-document="--self.keys" list-match="/keys/key" list-key-path="@name" list-value-path="@name"
	      value="--case when e.ve_is_post = 0 then get_keyword ('wskey',e.ve_params) else control.ufl_value end"
	      xhtml_class="m_e"/>
	  </td>
	</tr>
	<tr>
	  <td colspan="2">
            <v:button action="simple" name="bt2" xhtml_onclick="window.close();" value="i/back_16.png" style="image" xhtml_title="Back" xhtml_alt="Back"/>
            <v:url name="Backs" value="Back" url="#" xhtml_onclick="window.close();"/>
	    <v:button action="return" name="bt1" value="i/save_16.png" style="image" xhtml_title="Save" xhtml_alt="Save" text="&#160;Save">
	      <v:field name="wskey" ref="wkey"/>
	    </v:button>
            <v:button action="simple" name="bt3" xhtml_onclick="window.close();" value="i/cancl_16.png" xhtml_title="Cancel" style="image" xhtml_alt="Cancel"/>
            <v:url name="Cancels" value="Cancel" url="#" xhtml_onclick="window.close();"/>
	  </td>
	</tr>
    </table>
  </td>
</tr>
      </table>
    </v:form>
  </vm:pagebody>
</vm:pagewrapper>
</v:page>