| # Copyright 2019 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| template("genopenssl_key") { |
| forward_variables_from(invoker, |
| [ |
| "openssl_pem_in_dir", |
| "openssl_pem_out_dir", |
| "openssl_pem_algorithm", |
| ]) |
| if (!defined(openssl_pem_in_dir)) { |
| openssl_pem_in_dir = "." |
| } |
| if (!defined(openssl_pem_algorithm)) { |
| openssl_pem_algorithm = "rsa" |
| } |
| openssl_pem_in_dir = rebase_path(openssl_pem_in_dir) |
| pem_dir = "${root_gen_dir}/${openssl_pem_out_dir}" |
| |
| action_foreach(target_name) { |
| sources = invoker.sources |
| script = "//common-mk/file_generator_wrapper.py" |
| outputs = [ "${pem_dir}/{{source_name_part}}.pub.pem" ] |
| args = [ |
| "openssl", |
| "${openssl_pem_algorithm}", |
| "-in", |
| "${openssl_pem_in_dir}/{{source_file_part}}", |
| "-pubout", |
| "-out", |
| "${pem_dir}/{{source_name_part}}.pub.pem", |
| ] |
| } |
| } |