15-test_rsa.t 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #! /usr/bin/env perl
  2. # Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
  3. #
  4. # Licensed under the OpenSSL license (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
  8. use strict;
  9. use warnings;
  10. use File::Spec;
  11. use OpenSSL::Test qw/:DEFAULT srctop_file/;
  12. use OpenSSL::Test::Utils;
  13. setup("test_rsa");
  14. plan tests => 6;
  15. require_ok(srctop_file('test','recipes','tconversion.pl'));
  16. ok(run(test(["rsa_test"])), "running rsatest");
  17. ok(run(app([ 'openssl', 'rsa', '-check', '-in', srctop_file('test', 'testrsa.pem'), '-noout'])), "rsa -check");
  18. SKIP: {
  19. skip "Skipping rsa conversion test", 3
  20. if disabled("rsa");
  21. subtest 'rsa conversions -- private key' => sub {
  22. tconversion("rsa", srctop_file("test","testrsa.pem"));
  23. };
  24. subtest 'rsa conversions -- private key PKCS#8' => sub {
  25. tconversion("rsa", srctop_file("test","testrsa.pem"), "pkey");
  26. };
  27. }
  28. SKIP: {
  29. skip "Skipping msblob conversion test", 1
  30. if disabled("rsa") || disabled("dsa");
  31. subtest 'rsa conversions -- public key' => sub {
  32. tconversion("msb", srctop_file("test","testrsapub.pem"), "rsa",
  33. "-pubin", "-pubout");
  34. };
  35. }