diff options
-rw-r--r-- | meta-oe/classes/signing.bbclass | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/meta-oe/classes/signing.bbclass b/meta-oe/classes/signing.bbclass index 5992a75be7..ee32cc12f7 100644 --- a/meta-oe/classes/signing.bbclass +++ b/meta-oe/classes/signing.bbclass | |||
@@ -180,6 +180,22 @@ signing_has_ca() { | |||
180 | return $? | 180 | return $? |
181 | } | 181 | } |
182 | 182 | ||
183 | # signing_get_root_cert <cert_name> | ||
184 | # | ||
185 | # return the role/name of the CA root certificate for a given | ||
186 | # <cert_name>, by walking the chain setup with signing_import_set_ca | ||
187 | # all the way to the last in line that doesn't have a CA set - which | ||
188 | # would be the root. | ||
189 | # | ||
190 | # To be used with SoftHSM. | ||
191 | signing_get_root_cert() { | ||
192 | local cert_name="${1}" | ||
193 | while signing_has_ca "${cert_name}"; do | ||
194 | cert_name="$(signing_get_ca ${cert_name})" | ||
195 | done | ||
196 | echo "${cert_name}" | ||
197 | } | ||
198 | |||
183 | # signing_import_cert_chain_from_pem <role> <pem> | 199 | # signing_import_cert_chain_from_pem <role> <pem> |
184 | # | 200 | # |
185 | # Import a certificate *chain* from a PEM file to a role. | 201 | # Import a certificate *chain* from a PEM file to a role. |