You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let sem_id = SemanticsIdentifier::new_from_enum_mock(IdentityType::PNO, CountryCode::BE);
153
+
154
+
/// Define interactions
155
+
let interactions: Vec<Interaction> = vec![Interaction::confirmation_message("Are you sure to sign document: something.pdf?"), Interaction::diplay_text_and_pin("Sign using ReadMyCards")];
156
+
157
+
/// Create hash
158
+
let hash_type = HashType::SHA256;
159
+
lethash = sha_digest("This is a test string".to_string().into_bytes(), &hash_type)?;
160
+
let b64_hash = base64::engine::general_purpose::STANDARD.encode(hash.as_ref());
161
+
162
+
/// Create verification cod
163
+
let verification_code_for_user = generate_verification_number(hash.as_ref().to_vec())?;
164
+
info!("Verification code for user: {}", verification_code_for_user);
165
+
166
+
/// Ask user to sign
167
+
let res = sign_by_semantic_identifier(&cfg, sem_id, interactions, b64_hash, hash_type).await;
168
+
match res {
169
+
Ok(r) => {
170
+
match validate_response_success(r).map(|res| res.signature)? {
171
+
None => {
172
+
warn!("No signature");
173
+
Ok(())
174
+
}
175
+
Some(signature) => {
176
+
info!("Smart ID signature result {:#?}", signature);
0 commit comments