The added `testdata/testkey_with_passwd.key` is generated with: $ openssl pkcs8 -inform DER -in testdata/testkey_with_passwd.pk8 \ -out testdata/testkey_with_passwd.key -passin pass:foo Bug: 123716522 Test: python -m unittest test_apex_utils Change-Id: I7b7f00178ecab35c3e41ecf4d10295fe9bf480ab
22 lines
719 B
Bash
Executable File
22 lines
719 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Copyright (C) 2019 The Android Open Source Project
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
#
|
|
|
|
tmpfile=$(mktemp)
|
|
cat $3 | openssl rsautl -sign -inkey $2 -raw > $tmpfile
|
|
cat $tmpfile > $3
|
|
rm $tmpfile
|