// Get node authority-discovery public session key from keystore
let authority_discovery_pubkey: Vec<sr25519::Public> = SyncCryptoStore::sr25519_public_keys(
&*keystore_container.sync_keystore(),
AUTHORITY_DISCOVERY_KEY_TYPE,
)
.iter()
.map(|k| sr25519::Public::from(k.clone()))
.collect();
// Use authority-discovery session key to sign a message (should use a different ECDSA session key KEY_TYPE instead)
let signature = SyncCryptoStore::sign_with(
&*keystore_container.sync_keystore(),
AUTHORITY_DISCOVERY_KEY_TYPE,
&authority_discovery_pubkey[0].into(),
"My Signed Message".as_bytes()
).unwrap();
match signature {
Some(sig) => println!("Signature: {:?}", H512::from_slice(&sig)),
_ => {},
};
and a similar method, SyncCryptoStore::verify should be available.
Use it to implement signature production & verification in the poi "module".
Checkout the code :
and a similar method, SyncCryptoStore::verify should be available. Use it to implement signature production & verification in the poi "module".