2 # Copyright 2015-2023 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
14 use OpenSSL::Test qw/:DEFAULT srctop_file/;
15 use OpenSSL::Test::Utils;
21 require_ok(srctop_file('test', 'recipes', 'tconversion.pl'));
23 ok(run(test(["rsa_test"])), "running rsatest");
25 run_rsa_tests("pkey");
32 ok(run(app([ 'openssl', $cmd, '-check', '-in', srctop_file('test', 'testrsa.pem'), '-noout'])),
36 skip "Skipping Deprecated rsa_x931_test", 1 if disabled("deprecated-3.0");
37 ok(run(test(['rsa_x931_test'])), "RSA X931 test");
41 skip "Skipping $cmd conversion test", 3
44 subtest "$cmd conversions -- private key" => sub {
45 tconversion( -type => $cmd, -prefix => "$cmd-priv",
46 -in => srctop_file("test", "testrsa.pem") );
48 subtest "$cmd conversions -- private key PKCS#8" => sub {
49 tconversion( -type => $cmd, -prefix => "$cmd-pkcs8",
50 -in => srctop_file("test", "testrsa.pem"),
56 skip "Skipping msblob conversion test", 1
57 if disabled($cmd) || $cmd eq 'pkey';
59 subtest "$cmd conversions -- public key" => sub {
60 tconversion( -type => 'msb', -prefix => "$cmd-msb-pub",
61 -in => srctop_file("test", "testrsapub.pem"),
62 -args => ["rsa", "-pubin", "-pubout"] );
66 skip "Skipping PVK conversion test", 1
67 if disabled($cmd) || $cmd eq 'pkey' || disabled("rc4")
68 || disabled ("legacy");
70 subtest "$cmd conversions -- private key" => sub {
71 tconversion( -type => 'pvk', -prefix => "$cmd-pvk",
72 -in => srctop_file("test", "testrsa.pem"),
73 -args => ["rsa", "-passin", "pass:testpass",
74 "-passout", "pass:testpass",
75 "-provider", "default",
76 "-provider", "legacy"] );