summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/classes/signing.bbclass26
1 files changed, 25 insertions, 1 deletions
diff --git a/meta-oe/classes/signing.bbclass b/meta-oe/classes/signing.bbclass
index 248c6400ed..6fde22bf22 100644
--- a/meta-oe/classes/signing.bbclass
+++ b/meta-oe/classes/signing.bbclass
@@ -54,7 +54,7 @@
54SIGNING_PKCS11_URI ?= "" 54SIGNING_PKCS11_URI ?= ""
55SIGNING_PKCS11_MODULE ?= "" 55SIGNING_PKCS11_MODULE ?= ""
56 56
57DEPENDS += "softhsm-native libp11-native opensc-native openssl-native" 57DEPENDS += "softhsm-native libp11-native opensc-native openssl-native extract-cert-native"
58 58
59def signing_class_prepare(d): 59def signing_class_prepare(d):
60 import os.path 60 import os.path
@@ -453,6 +453,30 @@ signing_get_module() {
453 fi 453 fi
454} 454}
455 455
456# signing_extract_cert_der <role> <der>
457#
458# Export a certificate attached to a role into a DER file.
459# To be used with SoftHSM.
460signing_extract_cert_der() {
461 local role="${1}"
462 local output="${2}"
463
464 extract-cert "$(signing_get_uri $role)" "${output}"
465}
466
467# signing_extract_cert_pem <role> <pem>
468#
469# Export a certificate attached to a role into a PEM file.
470# To be used with SoftHSM.
471signing_extract_cert_pem() {
472 local role="${1}"
473 local output="${2}"
474
475 extract-cert "$(signing_get_uri $role)" "${output}.tmp-der"
476 openssl x509 -inform der -in "${output}.tmp-der" -out "${output}"
477 rm "${output}.tmp-der"
478}
479
456python () { 480python () {
457 signing_class_prepare(d) 481 signing_class_prepare(d)
458} 482}