xref: /aosp_15_r20/external/vboot_reference/scripts/keygeneration/make_keyblock.sh (revision 8617a60d3594060b7ecbd21bc622a7c14f3cf2bc)
1#!/bin/bash
2# Copyright 2011 The ChromiumOS Authors
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5#
6# Generates a keyblock containing a public key and signed using the given
7# signing key.
8
9# Load common constants and functions.
10# shellcheck source=common.sh
11. "$(dirname "$0")/common.sh"
12
13if [ $# -ne 4 ]; then
14  cat <<EOF
15Usage: $0 <in_public_key> <in_signing_key> <flags> <out_keyblock>
16
17Emits <out_keyblock>.keyblock containing <in_public_key>.vbpubk signed with
18<in_signing_key>.vbprivk with the given keyblock <flags>.
19EOF
20  exit 1
21fi
22
23in_pubkey=$1
24in_signkey=$2
25keyblock_flags=$3
26out_keyblock=$4
27
28make_keyblock $out_keyblock $keyblock_flags $in_pubkey $in_signkey
29