sign_node_identity_bundle

Function sign_node_identity_bundle 

Source
pub async fn sign_node_identity_bundle(
    secret_key: Vec<u8>,
    profile: NodeIdentityProfileRecord,
) -> Result<Vec<u8>, MobileError>
Expand description

Build and sign a node-identity bundle from a supplied secret key.

The encoding inverse of decode_node_identity, for composing bundles that describe a node other than the caller: fixtures, and the iOS app’s staging mode, which needs nodes that report a location. The live advertisement path keeps a position out of the durable bundle it signs on purpose — a frozen position goes stale and then travels wherever the QR is pasted — so a located bundle cannot be obtained from it.

This grants nothing a holder of the secret key does not already have: signing a statement about a key is what holding that key means. The name is truncated to the same 24 octets the advertisement path applies, so a bundle built here describes a node that could have sent it.