summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/classes/signing.bbclass16
1 files changed, 16 insertions, 0 deletions
diff --git a/meta-oe/classes/signing.bbclass b/meta-oe/classes/signing.bbclass
index 04bd92bc03..2a94f5f5b3 100644
--- a/meta-oe/classes/signing.bbclass
+++ b/meta-oe/classes/signing.bbclass
@@ -194,6 +194,22 @@ signing_has_ca() {
194 return $? 194 return $?
195} 195}
196 196
197# signing_get_root_cert <cert_name>
198#
199# return the role/name of the CA root certificate for a given
200# <cert_name>, by walking the chain setup with signing_import_set_ca
201# all the way to the last in line that doesn't have a CA set - which
202# would be the root.
203#
204# To be used with SoftHSM.
205signing_get_root_cert() {
206 local cert_name="${1}"
207 while signing_has_ca "${cert_name}"; do
208 cert_name="$(signing_get_ca ${cert_name})"
209 done
210 echo "${cert_name}"
211}
212
197# signing_import_cert_chain_from_pem <role> <pem> 213# signing_import_cert_chain_from_pem <role> <pem>
198# 214#
199# Import a certificate *chain* from a PEM file to a role. 215# Import a certificate *chain* from a PEM file to a role.