1$! TRSA.COM  --  Tests rsa keys
2$
3$	__arch := VAX
4$	if f$getsyi("cpu") .ge. 128 then __arch := AXP
5$	exe_dir := sys$disk:[-.'__arch'.exe.apps]
6$
7$	set noon
8$	define/user sys$output nla0:
9$	mcr 'exe_dir'openssl no-rsa
10$	save_severity=$SEVERITY
11$	set on
12$	if save_severity
13$	then
14$	    write sys$output "skipping RSA conversion test"
15$	    exit
16$	endif
17$
18$	cmd := mcr 'exe_dir'openssl rsa
19$
20$	t := testrsa.pem
21$	if p1 .nes. "" then t = p1
22$
23$	write sys$output "testing RSA conversions"
24$	if f$search("fff.*") .nes "" then delete fff.*;*
25$	if f$search("ff.*") .nes "" then delete ff.*;*
26$	if f$search("f.*") .nes "" then delete f.*;*
27$	convert/fdl=sys$input: 't' fff.p
28RECORD
29	FORMAT STREAM_LF
30$
31$	write sys$output "p -> d"
32$	'cmd' -in fff.p -inform p -outform d -out f.d
33$	if $severity .ne. 1 then exit 3
34$!	write sys$output "p -> t"
35$!	'cmd' -in fff.p -inform p -outform t -out f.t
36$!	if $severity .ne. 1 then exit 3
37$	write sys$output "p -> p"
38$	'cmd' -in fff.p -inform p -outform p -out f.p
39$	if $severity .ne. 1 then exit 3
40$
41$	write sys$output "d -> d"
42$	'cmd' -in f.d -inform d -outform d -out ff.d1
43$	if $severity .ne. 1 then exit 3
44$!	write sys$output "t -> d"
45$!	'cmd' -in f.t -inform t -outform d -out ff.d2
46$!	if $severity .ne. 1 then exit 3
47$	write sys$output "p -> d"
48$	'cmd' -in f.p -inform p -outform d -out ff.d3
49$	if $severity .ne. 1 then exit 3
50$
51$!	write sys$output "d -> t"
52$!	'cmd' -in f.d -inform d -outform t -out ff.t1
53$!	if $severity .ne. 1 then exit 3
54$!	write sys$output "t -> t"
55$!	'cmd' -in f.t -inform t -outform t -out ff.t2
56$!	if $severity .ne. 1 then exit 3
57$!	write sys$output "p -> t"
58$!	'cmd' -in f.p -inform p -outform t -out ff.t3
59$!	if $severity .ne. 1 then exit 3
60$
61$	write sys$output "d -> p"
62$	'cmd' -in f.d -inform d -outform p -out ff.p1
63$	if $severity .ne. 1 then exit 3
64$!	write sys$output "t -> p"
65$!	'cmd' -in f.t -inform t -outform p -out ff.p2
66$!	if $severity .ne. 1 then exit 3
67$	write sys$output "p -> p"
68$	'cmd' -in f.p -inform p -outform p -out ff.p3
69$	if $severity .ne. 1 then exit 3
70$
71$	backup/compare fff.p f.p
72$	if $severity .ne. 1 then exit 3
73$	backup/compare fff.p ff.p1
74$	if $severity .ne. 1 then exit 3
75$!	backup/compare fff.p ff.p2
76$!	if $severity .ne. 1 then exit 3
77$	backup/compare fff.p ff.p3
78$	if $severity .ne. 1 then exit 3
79$
80$!	backup/compare f.t ff.t1
81$!	if $severity .ne. 1 then exit 3
82$!	backup/compare f.t ff.t2
83$!	if $severity .ne. 1 then exit 3
84$!	backup/compare f.t ff.t3
85$!	if $severity .ne. 1 then exit 3
86$
87$	backup/compare f.p ff.p1
88$	if $severity .ne. 1 then exit 3
89$!	backup/compare f.p ff.p2
90$!	if $severity .ne. 1 then exit 3
91$	backup/compare f.p ff.p3
92$	if $severity .ne. 1 then exit 3
93$
94$	delete f.*;*,ff.*;*,fff.*;*
95