ssi_vc/v1/data_integrity.rs
1use ssi_data_integrity::{AnySuite, DataIntegrity, DecodeError};
2
3use super::JsonCredential;
4
5/// Decodes a Data-Integrity credential or presentation from its JSON binary
6/// representation.
7pub fn any_credential_from_json_slice(
8 json: &[u8],
9) -> Result<DataIntegrity<JsonCredential, AnySuite>, DecodeError> {
10 ssi_data_integrity::from_json_slice(json)
11}
12
13/// Decodes a Data-Integrity credential or presentation from its JSON textual
14/// representation.
15pub fn any_credential_from_json_str(
16 json: &str,
17) -> Result<DataIntegrity<JsonCredential, AnySuite>, DecodeError> {
18 ssi_data_integrity::from_json_str(json)
19}