diff options
| -rw-r--r-- | meta-oe/classes/signing.bbclass | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/meta-oe/classes/signing.bbclass b/meta-oe/classes/signing.bbclass index 2a94f5f5b3..248c6400ed 100644 --- a/meta-oe/classes/signing.bbclass +++ b/meta-oe/classes/signing.bbclass | |||
| @@ -194,6 +194,27 @@ signing_has_ca() { | |||
| 194 | return $? | 194 | return $? |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | # signing_get_intermediate_certs <cert_name> | ||
| 198 | # | ||
| 199 | # return a list of role/name intermediary CA certificates for a given | ||
| 200 | # <cert_name> by walking the chain setup with signing_import_set_ca. | ||
| 201 | # | ||
| 202 | # The returned list will not include the the root CA, and can | ||
| 203 | # potentially be empty. | ||
| 204 | # | ||
| 205 | # To be used with SoftHSM. | ||
| 206 | signing_get_intermediate_certs() { | ||
| 207 | local cert_name="${1}" | ||
| 208 | local intermediary="" | ||
| 209 | while signing_has_ca "${cert_name}"; do | ||
| 210 | cert_name="$(signing_get_ca ${cert_name})" | ||
| 211 | if signing_has_ca "${cert_name}"; then | ||
| 212 | intermediary="${intermediary} ${cert_name}" | ||
| 213 | fi | ||
| 214 | done | ||
| 215 | echo "${intermediary}" | ||
| 216 | } | ||
| 217 | |||
| 197 | # signing_get_root_cert <cert_name> | 218 | # signing_get_root_cert <cert_name> |
| 198 | # | 219 | # |
| 199 | # return the role/name of the CA root certificate for a given | 220 | # return the role/name of the CA root certificate for a given |
