in image/create.go [80:105]
func sigTlvType(key sec.PrivSignKey) uint8 {
key.AssertValid()
if key.Rsa != nil {
pubk := key.Rsa.Public().(*rsa.PublicKey)
switch pubk.Size() {
case 256:
return IMAGE_TLV_RSA2048
case 384:
return IMAGE_TLV_RSA3072
default:
return 0
}
} else if key.Ec != nil {
switch key.Ec.Curve.Params().Name {
case "P-224":
return IMAGE_TLV_ECDSA224
case "P-256":
return IMAGE_TLV_ECDSA256
default:
return 0
}
} else {
return IMAGE_TLV_ED25519
}
}