handleAGENTC_SIGN_REQUEST method
Signs challenge authenticating a descendent channel.
Implementation
void handleAGENTC_SIGN_REQUEST(Channel channel, AGENTC_SIGN_REQUEST msg) {
if (tracePrint != null) {
tracePrint('$hostport: agent channel: AGENTC_SIGN_REQUEST');
}
SerializableInput keyStream = SerializableInput(msg.key);
String keyType = deserializeString(keyStream);
Uint8List sig =
identity.signMessage(Key.id(keyType), msg.data, getSecureRandom());
if (sig != null) {
sendToChannel(channel, AGENT_SIGN_RESPONSE(sig).toRaw());
} else {
sendToChannel(channel, AGENT_FAILURE().toRaw());
}
}