Recent pkg accepts keys in the format "/path" or "${type}:/path", where the latter incurs a lookup in the pkgsign table for a supported signer to use the key. Unprefixed paths are assumed to be RSA to maintain a semblance of backwards compatibility.
Add a pair of functions to parse out the components of the PKG_REPO_SIGNING_KEY so that one can just use the same key spec that pkg would accept. We don't try to do any validation here so that we can just leave the source of truth of what's accepted in pkg to offer some flexibility in the future.
This is carefully designed to avoid using pkg-key(8) or a keyfile prefix if we're just using rsa, so that we don't force a new pkg version on the user until they want ecc support.
Recent pkg accepts keys in the format "/path" or "${type}:/path", where the latter incurs a lookup in the pkgsign table for a supported signer to use the key. Unprefixed paths are assumed to be RSA to maintain a semblance of backwards compatibility.
Add a pair of functions to parse out the components of the PKG_REPO_SIGNING_KEY so that one can just use the same key spec that pkg would accept. We don't try to do any validation here so that we can just leave the source of truth of what's accepted in pkg to offer some flexibility in the future.
This is carefully designed to avoid using pkg-key(8) or a keyfile prefix if we're just using rsa, so that we don't force a new pkg version on the user until they want ecc support.