diff --git a/indy-credx/src/ffi/cred_req.rs b/indy-credx/src/ffi/cred_req.rs index 3495725..f442628 100644 --- a/indy-credx/src/ffi/cred_req.rs +++ b/indy-credx/src/ffi/cred_req.rs @@ -12,8 +12,8 @@ use crate::services::{ pub extern "C" fn credx_create_credential_request( prover_did: FfiStr, cred_def: ObjectHandle, - master_secret: ObjectHandle, - master_secret_id: FfiStr, + link_secret: ObjectHandle, + link_secret_id: FfiStr, cred_offer: ObjectHandle, cred_req_p: *mut ObjectHandle, cred_req_meta_p: *mut ObjectHandle, @@ -27,14 +27,14 @@ pub extern "C" fn credx_create_credential_request( .ok_or_else(|| err_msg!("Missing prover DID"))?; DidValue::from_str(did)? }; - let master_secret_id = master_secret_id + let link_secret_id = link_secret_id .as_opt_str() - .ok_or_else(|| err_msg!("Missing master secret ID"))?; + .ok_or_else(|| err_msg!("Missing link secret ID"))?; let (cred_req, cred_req_metadata) = create_credential_request( &prover_did, cred_def.load()?.cast_ref()?, - master_secret.load()?.cast_ref()?, - master_secret_id, + link_secret.load()?.cast_ref()?, + link_secret_id, cred_offer.load()?.cast_ref()?, )?; let cred_req = ObjectHandle::create(cred_req)?; diff --git a/indy-credx/src/ffi/credential.rs b/indy-credx/src/ffi/credential.rs index 21770be..7b679bc 100644 --- a/indy-credx/src/ffi/credential.rs +++ b/indy-credx/src/ffi/credential.rs @@ -177,7 +177,7 @@ pub extern "C" fn credx_encode_credential_attributes( pub extern "C" fn credx_process_credential( cred: ObjectHandle, cred_req_metadata: ObjectHandle, - master_secret: ObjectHandle, + link_secret: ObjectHandle, cred_def: ObjectHandle, rev_reg_def: ObjectHandle, cred_p: *mut ObjectHandle, @@ -192,7 +192,7 @@ pub extern "C" fn credx_process_credential( process_credential( &mut cred, cred_req_metadata.load()?.cast_ref()?, - master_secret.load()?.cast_ref()?, + link_secret.load()?.cast_ref()?, cred_def.load()?.cast_ref()?, rev_reg_def .opt_load()? diff --git a/indy-credx/src/ffi/link_secret.rs b/indy-credx/src/ffi/link_secret.rs new file mode 100644 index 0000000..ffcda3e --- /dev/null +++ b/indy-credx/src/ffi/link_secret.rs @@ -0,0 +1,16 @@ +use super::error::{catch_error, ErrorCode}; +use super::object::ObjectHandle; +use crate::services::{prover::create_link_secret, types::LinkSecret}; + +#[no_mangle] +pub extern "C" fn credx_create_link_secret(link_secret_p: *mut ObjectHandle) -> ErrorCode { + catch_error(|| { + check_useful_c_ptr!(link_secret_p); + let secret = ObjectHandle::create(create_link_secret()?)?; + unsafe { *link_secret_p = secret }; + Ok(()) + }) +} + +impl_indy_object!(LinkSecret, "LinkSecret"); +impl_indy_object_from_json!(LinkSecret, credx_link_secret_from_json); diff --git a/indy-credx/src/ffi/master_secret.rs b/indy-credx/src/ffi/master_secret.rs deleted file mode 100644 index a421919..0000000 --- a/indy-credx/src/ffi/master_secret.rs +++ /dev/null @@ -1,16 +0,0 @@ -use super::error::{catch_error, ErrorCode}; -use super::object::ObjectHandle; -use crate::services::{prover::create_master_secret, types::MasterSecret}; - -#[no_mangle] -pub extern "C" fn credx_create_master_secret(master_secret_p: *mut ObjectHandle) -> ErrorCode { - catch_error(|| { - check_useful_c_ptr!(master_secret_p); - let secret = ObjectHandle::create(create_master_secret()?)?; - unsafe { *master_secret_p = secret }; - Ok(()) - }) -} - -impl_indy_object!(MasterSecret, "MasterSecret"); -impl_indy_object_from_json!(MasterSecret, credx_master_secret_from_json); diff --git a/indy-credx/src/ffi/mod.rs b/indy-credx/src/ffi/mod.rs index 717df33..b44cabc 100644 --- a/indy-credx/src/ffi/mod.rs +++ b/indy-credx/src/ffi/mod.rs @@ -29,7 +29,7 @@ mod cred_def; mod cred_offer; mod cred_req; mod credential; -mod master_secret; +mod link_secret; mod pres_req; mod presentation; mod revocation; diff --git a/indy-credx/src/ffi/presentation.rs b/indy-credx/src/ffi/presentation.rs index 81c91eb..c29b246 100644 --- a/indy-credx/src/ffi/presentation.rs +++ b/indy-credx/src/ffi/presentation.rs @@ -63,7 +63,7 @@ pub extern "C" fn credx_create_presentation( credentials_prove: FfiList, self_attest_names: FfiStrList, self_attest_values: FfiStrList, - master_secret: ObjectHandle, + link_secret: ObjectHandle, schemas: FfiList, cred_defs: FfiList, presentation_p: *mut ObjectHandle, @@ -151,7 +151,7 @@ pub extern "C" fn credx_create_presentation( pres_req.load()?.cast_ref()?, present_creds, self_attested, - master_secret.load()?.cast_ref()?, + link_secret.load()?.cast_ref()?, &schemas.refs_map()?, &cred_defs.refs_map()?, )?; diff --git a/indy-credx/src/services/helpers.rs b/indy-credx/src/services/helpers.rs index f1a9d90..aa7ba94 100644 --- a/indy-credx/src/services/helpers.rs +++ b/indy-credx/src/services/helpers.rs @@ -7,8 +7,8 @@ use indy_data_types::anoncreds::{ }; use crate::anoncreds_clsignatures::{ - hash_credential_attribute, CredentialSchema, CredentialValues as CryptoCredentialValues, - Issuer as ClIssuer, MasterSecret as CryptoMasterSecret, NonCredentialSchema, SubProofRequest, + hash_credential_attribute, CredentialSchema, CredentialValues as ClCredentialValues, + Issuer as ClIssuer, MasterSecret as ClMasterSecret, NonCredentialSchema, SubProofRequest, Verifier as ClVerifier, }; use crate::error::Result; @@ -45,8 +45,8 @@ pub fn build_non_credential_schema() -> Result { pub fn build_credential_values( credential_values: &HashMap, - master_secret: Option<&CryptoMasterSecret>, -) -> Result { + link_secret: Option<&ClMasterSecret>, +) -> Result { trace!( "build_credential_values >>> credential_values: {:?}", credential_values @@ -56,7 +56,7 @@ pub fn build_credential_values( for (attr, values) in credential_values { credential_values_builder.add_dec_known(&attr_common_view(attr), &values.encoded)?; } - if let Some(ms) = master_secret { + if let Some(ms) = link_secret { credential_values_builder.add_value_hidden("master_secret", &ms.value()?)?; } diff --git a/indy-credx/src/services/prover.rs b/indy-credx/src/services/prover.rs index 37bba7f..5f07ee1 100644 --- a/indy-credx/src/services/prover.rs +++ b/indy-credx/src/services/prover.rs @@ -20,21 +20,21 @@ use indy_utils::{Qualifiable, Validatable}; use super::tails::TailsReader; -pub fn create_master_secret() -> Result { - MasterSecret::new().map_err(err_map!(Unexpected)) +pub fn create_link_secret() -> Result { + LinkSecret::new().map_err(err_map!(Unexpected)) } pub fn create_credential_request( prover_did: &DidValue, cred_def: &CredentialDefinition, - master_secret: &MasterSecret, - master_secret_id: &str, + link_secret: &LinkSecret, + link_secret_id: &str, credential_offer: &CredentialOffer, ) -> Result<(CredentialRequest, CredentialRequestMetadata)> { trace!( - "create_credential_request >>> cred_def: {:?}, master_secret: {:?}, credential_offer: {:?}", + "create_credential_request >>> cred_def: {:?}, link_secret: {:?}, credential_offer: {:?}", cred_def, - secret!(&master_secret), + secret!(&link_secret), credential_offer ); @@ -46,7 +46,7 @@ pub fn create_credential_request( cred_def.value.revocation.as_ref(), )?; let mut credential_values_builder = ClIssuer::new_credential_values_builder()?; - credential_values_builder.add_value_hidden("master_secret", &master_secret.value.value()?)?; + credential_values_builder.add_value_hidden("master_secret", &link_secret.value.value()?)?; let cred_values = credential_values_builder.finalize()?; let nonce = new_nonce()?; @@ -71,7 +71,7 @@ pub fn create_credential_request( let credential_request_metadata = CredentialRequestMetadata { master_secret_blinding_data, nonce: nonce_copy, - master_secret_name: master_secret_id.to_string(), + master_secret_name: link_secret_id.to_string(), }; trace!( @@ -86,12 +86,12 @@ pub fn create_credential_request( pub fn process_credential( credential: &mut Credential, cred_request_metadata: &CredentialRequestMetadata, - master_secret: &MasterSecret, + link_secret: &LinkSecret, cred_def: &CredentialDefinition, rev_reg_def: Option<&RevocationRegistryDefinition>, ) -> Result<()> { - trace!("process_credential >>> credential: {:?}, cred_request_metadata: {:?}, master_secret: {:?}, cred_def: {:?}, rev_reg_def: {:?}", - credential, cred_request_metadata, secret!(&master_secret), cred_def, rev_reg_def); + trace!("process_credential >>> credential: {:?}, cred_request_metadata: {:?}, link_secret: {:?}, cred_def: {:?}, rev_reg_def: {:?}", + credential, cred_request_metadata, secret!(&link_secret), cred_def, rev_reg_def); let cred_def = match cred_def { CredentialDefinition::CredentialDefinitionV1(cd) => cd, @@ -101,7 +101,7 @@ pub fn process_credential( cred_def.value.revocation.as_ref(), )?; let credential_values = - build_credential_values(&credential.values.0, Some(&master_secret.value))?; + build_credential_values(&credential.values.0, Some(&link_secret.value))?; let rev_pub_key = match rev_reg_def { Some(RevocationRegistryDefinition::RevocationRegistryDefinitionV1(def)) => { Some(&def.value.public_keys.accum_key) @@ -130,12 +130,12 @@ pub fn create_presentation( pres_req: &PresentationRequest, credentials: PresentCredentials, self_attested: Option>, - master_secret: &MasterSecret, + link_secret: &LinkSecret, schemas: &HashMap, cred_defs: &HashMap, ) -> Result { - trace!("create_proof >>> credentials: {:?}, pres_req: {:?}, credentials: {:?}, self_attested: {:?}, master_secret: {:?}, schemas: {:?}, cred_defs: {:?}", - credentials, pres_req, credentials, &self_attested, secret!(&master_secret), schemas, cred_defs); + trace!("create_proof >>> credentials: {:?}, pres_req: {:?}, credentials: {:?}, self_attested: {:?}, link_secret: {:?}, schemas: {:?}, cred_defs: {:?}", + credentials, pres_req, credentials, &self_attested, secret!(&link_secret), schemas, cred_defs); if credentials.is_empty() && self_attested @@ -192,7 +192,7 @@ pub fn create_presentation( let credential_schema = build_credential_schema(&schema.attr_names.0)?; let credential_values = - build_credential_values(&credential.values.0, Some(&master_secret.value))?; + build_credential_values(&credential.values.0, Some(&link_secret.value))?; let (req_attrs, req_predicates) = prepare_credential_for_proving( present.requested_attributes, present.requested_predicates, diff --git a/indy-credx/src/services/types.rs b/indy-credx/src/services/types.rs index 8fc4eee..2f476f9 100644 --- a/indy-credx/src/services/types.rs +++ b/indy-credx/src/services/types.rs @@ -9,7 +9,7 @@ pub use indy_data_types::{ cred_offer::CredentialOffer, cred_request::{CredentialRequest, CredentialRequestMetadata}, credential::{AttributeValues, Credential, CredentialValues}, - master_secret::MasterSecret, + link_secret::LinkSecret, pres_request::PresentationRequest, presentation::Presentation, rev_reg::{RevocationRegistry, RevocationRegistryDelta}, diff --git a/indy-credx/tests/anoncreds_demos.rs b/indy-credx/tests/anoncreds_demos.rs index e217157..e41f395 100644 --- a/indy-credx/tests/anoncreds_demos.rs +++ b/indy-credx/tests/anoncreds_demos.rs @@ -24,7 +24,7 @@ fn anoncreds_works_for_single_issuer_single_prover() { // Create Issuer pseudo wallet let mut issuer_wallet = IssuerWallet::default(); - // Create Prover pseudo wallet and master secret + // Create Prover pseudo wallet and link secret let mut prover_wallet = ProverWallet::default(); // Issuer creates Schema - would be published to the ledger @@ -65,7 +65,7 @@ fn anoncreds_works_for_single_issuer_single_prover() { let (cred_request, cred_request_metadata) = prover::create_credential_request( &prover_wallet.did, &*gvt_cred_def, - &prover_wallet.master_secret, + &prover_wallet.link_secret, "default", &cred_offer, ) @@ -100,7 +100,7 @@ fn anoncreds_works_for_single_issuer_single_prover() { prover::process_credential( &mut recv_cred, &cred_request_metadata, - &prover_wallet.master_secret, + &prover_wallet.link_secret, &*gvt_cred_def, None, ) @@ -160,7 +160,7 @@ fn anoncreds_works_for_single_issuer_single_prover() { &pres_request, present, Some(self_attested), - &prover_wallet.master_secret, + &prover_wallet.link_secret, &schemas, &cred_defs, ) @@ -220,7 +220,7 @@ fn anoncreds_works_for_single_issuer_single_prover_unrevoked() { // Create Issuer pseudo wallet let mut issuer_wallet = IssuerWallet::default(); - // Create Prover pseudo wallet and master secret + // Create Prover pseudo wallet and link secret let mut prover_wallet = ProverWallet::default(); // Issuer creates Schema - would be published to the ledger @@ -280,7 +280,7 @@ fn anoncreds_works_for_single_issuer_single_prover_unrevoked() { let (cred_request, cred_request_metadata) = prover::create_credential_request( &prover_wallet.did, &gvt_cred_def, - &prover_wallet.master_secret, + &prover_wallet.link_secret, "default", &cred_offer, ) @@ -321,7 +321,7 @@ fn anoncreds_works_for_single_issuer_single_prover_unrevoked() { prover::process_credential( &mut recv_cred, &cred_request_metadata, - &prover_wallet.master_secret, + &prover_wallet.link_secret, &*gvt_cred_def, Some(&rev_reg_def), ) @@ -393,7 +393,7 @@ fn anoncreds_works_for_single_issuer_single_prover_unrevoked() { &pres_request, present, Some(self_attested), - &prover_wallet.master_secret, + &prover_wallet.link_secret, &schemas, &cred_defs, ) diff --git a/indy-credx/tests/utils/anoncreds.rs b/indy-credx/tests/utils/anoncreds.rs index a01c6b2..4cbf60e 100644 --- a/indy-credx/tests/utils/anoncreds.rs +++ b/indy-credx/tests/utils/anoncreds.rs @@ -2,7 +2,7 @@ use indy_credx::types::{CredentialDefinitionPrivate, CredentialKeyCorrectnessPro use indy_data_types::anoncreds::cred_def::CredentialDefinition; use indy_data_types::anoncreds::credential::Credential; -use indy_data_types::anoncreds::master_secret::MasterSecret; +use indy_data_types::anoncreds::link_secret::LinkSecret; use indy_utils::did::DidValue; pub const ISSUER_DID: &'static str = "NcYxiDXkpYi6ov5FcYDi1e"; @@ -56,16 +56,16 @@ impl Default for IssuerWallet { pub struct ProverWallet { pub did: DidValue, pub credentials: Vec, - pub master_secret: MasterSecret, + pub link_secret: LinkSecret, } impl Default for ProverWallet { fn default() -> Self { - let master_secret = MasterSecret::new().expect("Error creating prover master secret"); + let link_secret = LinkSecret::new().expect("Error creating prover link secret"); Self { did: DidValue::from(PROVER_DID.to_string()), credentials: vec![], - master_secret, + link_secret, } } } diff --git a/indy-data-types/src/anoncreds/master_secret.rs b/indy-data-types/src/anoncreds/link_secret.rs similarity index 88% rename from indy-data-types/src/anoncreds/master_secret.rs rename to indy-data-types/src/anoncreds/link_secret.rs index 82d4bd5..cad690b 100644 --- a/indy-data-types/src/anoncreds/master_secret.rs +++ b/indy-data-types/src/anoncreds/link_secret.rs @@ -6,11 +6,11 @@ use crate::anoncreds_clsignatures::{MasterSecret as ClMasterSecret, Prover as Cl use crate::ConversionError; #[derive(Serialize, Deserialize)] -pub struct MasterSecret { +pub struct LinkSecret { pub value: ClMasterSecret, } -impl MasterSecret { +impl LinkSecret { #[cfg(any(feature = "cl", feature = "cl_native"))] #[inline] pub fn new() -> Result { @@ -27,9 +27,9 @@ impl MasterSecret { } } -impl fmt::Debug for MasterSecret { +impl fmt::Debug for LinkSecret { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("MasterSecret") + f.debug_tuple("LinkSecret") .field(if cfg!(test) { &self.value } else { &"" }) .finish() } diff --git a/indy-data-types/src/anoncreds/mod.rs b/indy-data-types/src/anoncreds/mod.rs index af04a83..3e6598b 100644 --- a/indy-data-types/src/anoncreds/mod.rs +++ b/indy-data-types/src/anoncreds/mod.rs @@ -13,9 +13,9 @@ pub mod cred_request; /// Credentials pub mod credential; -/// Identity master secret +/// Identity link secret #[cfg(any(feature = "cl", feature = "cl_native"))] -pub mod master_secret; +pub mod link_secret; /// Nonce used in presentation requests pub mod nonce; diff --git a/wrappers/python/demo/test.py b/wrappers/python/demo/test.py index 1d066d0..eb8d8de 100644 --- a/wrappers/python/demo/test.py +++ b/wrappers/python/demo/test.py @@ -12,7 +12,7 @@ PresentationRequest, Presentation, PresentCredentials, - MasterSecret, + LinkSecret, RevocationRegistryDefinition, Schema, ) @@ -45,15 +45,15 @@ ) = RevocationRegistryDefinition.create(test_did, cred_def, "default", "CL_ACCUM", 100) # print("Tails file hash:", rev_reg_def.tails_hash) -master_secret = MasterSecret.create() -master_secret_id = "my id" +link_secret = LinkSecret.create() +link_secret_id = "my id" cred_offer = CredentialOffer.create(schema.id, cred_def, key_proof) # print("Credential offer:") # print(cred_offer.to_json()) cred_req, cred_req_metadata = CredentialRequest.create( - test_did, cred_def, master_secret, master_secret_id, cred_offer + test_did, cred_def, link_secret, link_secret_id, cred_offer ) # print("Credential request:") # print(cred_req.to_json()) @@ -78,7 +78,7 @@ # print("Issued credential:") # print(cred.to_json()) -cred_received = cred.process(cred_req_metadata, master_secret, cred_def, rev_reg_def) +cred_received = cred.process(cred_req_metadata, link_secret, cred_def, rev_reg_def) # print("Processed credential:") # print(cred_received.to_json()) @@ -116,7 +116,7 @@ ) presentation = Presentation.create( - pres_req, present_creds, {}, master_secret, [schema], [cred_def] + pres_req, present_creds, {}, link_secret, [schema], [cred_def] ) # print(presentation.to_json()) @@ -156,7 +156,7 @@ cred_received, "reft", reveal=True, timestamp=timestamp, rev_state=rev_state ) presentation_2 = Presentation.create( - pres_req, present_creds, {}, master_secret, [schema], [cred_def] + pres_req, present_creds, {}, link_secret, [schema], [cred_def] ) verified = presentation.verify( diff --git a/wrappers/python/indy_credx/__init__.py b/wrappers/python/indy_credx/__init__.py index 115b955..2832c27 100644 --- a/wrappers/python/indy_credx/__init__.py +++ b/wrappers/python/indy_credx/__init__.py @@ -12,7 +12,7 @@ CredentialOffer, CredentialRequest, CredentialRequestMetadata, - MasterSecret, + LinkSecret, PresentationRequest, Presentation, PresentCredentials, @@ -38,7 +38,7 @@ "CredentialOffer", "CredentialRequest", "CredentialRequestMetadata", - "MasterSecret", + "LinkSecret", "PresentationRequest", "Presentation", "PresentCredentials", diff --git a/wrappers/python/indy_credx/bindings.py b/wrappers/python/indy_credx/bindings.py index 08100c2..8e02a6a 100644 --- a/wrappers/python/indy_credx/bindings.py +++ b/wrappers/python/indy_credx/bindings.py @@ -18,7 +18,6 @@ c_int64, c_size_t, c_ubyte, - c_void_p, pointer, ) from ctypes.util import find_library @@ -668,7 +667,7 @@ def encode_credential_attributes( def process_credential( cred: ObjectHandle, cred_req_metadata: ObjectHandle, - master_secret: ObjectHandle, + link_secret: ObjectHandle, cred_def: ObjectHandle, rev_reg_def: Optional[ObjectHandle], ) -> ObjectHandle: @@ -677,7 +676,7 @@ def process_credential( "credx_process_credential", cred, cred_req_metadata, - master_secret, + link_secret, cred_def, rev_reg_def or ObjectHandle(), byref(result), @@ -724,8 +723,8 @@ def create_credential_offer( def create_credential_request( prover_did: str, cred_def: ObjectHandle, - master_secret: ObjectHandle, - master_secret_id: str, + link_secret: ObjectHandle, + link_secret_id: str, cred_offer: ObjectHandle, ) -> Tuple[ObjectHandle, ObjectHandle]: cred_req, cred_req_metadata = ObjectHandle(), ObjectHandle() @@ -733,8 +732,8 @@ def create_credential_request( "credx_create_credential_request", encode_str(prover_did), cred_def, - master_secret, - encode_str(master_secret_id), + link_secret, + encode_str(link_secret_id), cred_offer, byref(cred_req), byref(cred_req_metadata), @@ -742,10 +741,10 @@ def create_credential_request( return (cred_req, cred_req_metadata) -def create_master_secret() -> ObjectHandle: +def create_link_secret() -> ObjectHandle: secret = ObjectHandle() do_call( - "credx_create_master_secret", + "credx_create_link_secret", byref(secret), ) return secret @@ -756,7 +755,7 @@ def create_presentation( credentials: Sequence[CredentialEntry], credentials_prove: Sequence[CredentialProve], self_attest: Mapping[str, str], - master_secret: ObjectHandle, + link_secret: ObjectHandle, schemas: Sequence[ObjectHandle], cred_defs: Sequence[ObjectHandle], ) -> ObjectHandle: @@ -774,7 +773,7 @@ def create_presentation( prove_list, FfiStrList.create(self_attest.keys()), FfiStrList.create(self_attest.values()), - master_secret, + link_secret, FfiObjectHandleList.create(schemas), FfiObjectHandleList.create(cred_defs), byref(present), diff --git a/wrappers/python/indy_credx/types.py b/wrappers/python/indy_credx/types.py index ee22ba4..e3d90c9 100644 --- a/wrappers/python/indy_credx/types.py +++ b/wrappers/python/indy_credx/types.py @@ -106,21 +106,21 @@ def create( cls, prover_did: str, cred_def: Union[JsonType, CredentialDefinition], - master_secret: Union[JsonType, "MasterSecret"], - master_secret_id: str, + link_secret: Union[JsonType, "LinkSecret"], + link_secret_id: str, cred_offer: Union[JsonType, CredentialOffer], ) -> Tuple["CredentialRequest", "CredentialRequestMetadata"]: if not isinstance(cred_def, bindings.IndyObject): cred_def = CredentialDefinition.load(cred_def) - if not isinstance(master_secret, bindings.IndyObject): - master_secret = MasterSecret.load(master_secret) + if not isinstance(link_secret, bindings.IndyObject): + link_secret = LinkSecret.load(link_secret) if not isinstance(cred_offer, bindings.IndyObject): cred_offer = CredentialOffer.load(cred_offer) cred_def, cred_def_metadata = bindings.create_credential_request( prover_did, cred_def.handle, - master_secret.handle, - master_secret_id, + link_secret.handle, + link_secret_id, cred_offer.handle, ) return CredentialRequest(cred_def), CredentialRequestMetadata(cred_def_metadata) @@ -142,15 +142,15 @@ def load(cls, value: JsonType) -> "CredentialRequestMetadata": ) -class MasterSecret(bindings.IndyObject): +class LinkSecret(bindings.IndyObject): @classmethod - def create(cls) -> "MasterSecret": - return MasterSecret(bindings.create_master_secret()) + def create(cls) -> "LinkSecret": + return LinkSecret(bindings.create_link_secret()) @classmethod - def load(cls, value: JsonType) -> "MasterSecret": - return MasterSecret( - bindings._object_from_json("credx_master_secret_from_json", value) + def load(cls, value: JsonType) -> "LinkSecret": + return LinkSecret( + bindings._object_from_json("credx_link_secret_from_json", value) ) @@ -230,14 +230,14 @@ def create( def process( self, cred_req_metadata: Union[JsonType, CredentialRequestMetadata], - master_secret: Union[JsonType, MasterSecret], + link_secret: Union[JsonType, LinkSecret], cred_def: Union[JsonType, CredentialDefinition], rev_reg_def: Optional[Union[JsonType, "RevocationRegistryDefinition"]] = None, ) -> "Credential": if not isinstance(cred_req_metadata, bindings.IndyObject): cred_req_metadata = CredentialRequestMetadata.load(cred_req_metadata) - if not isinstance(master_secret, bindings.IndyObject): - master_secret = MasterSecret.load(master_secret) + if not isinstance(link_secret, bindings.IndyObject): + link_secret = LinkSecret.load(link_secret) if not isinstance(cred_def, bindings.IndyObject): cred_def = CredentialDefinition.load(cred_def) if rev_reg_def and not isinstance(rev_reg_def, bindings.IndyObject): @@ -246,7 +246,7 @@ def process( bindings.process_credential( self.handle, cred_req_metadata.handle, - master_secret.handle, + link_secret.handle, cred_def.handle, rev_reg_def.handle if rev_reg_def else None, ) @@ -366,14 +366,14 @@ def create( pres_req: Union[JsonType, PresentationRequest], present_creds: PresentCredentials, self_attest: Optional[Mapping[str, str]], - master_secret: Union[JsonType, MasterSecret], + link_secret: Union[JsonType, LinkSecret], schemas: Sequence[Union[JsonType, Schema]], cred_defs: Sequence[Union[JsonType, CredentialDefinition]], ) -> "Presentation": if not isinstance(pres_req, bindings.IndyObject): pres_req = PresentationRequest.load(pres_req) - if not isinstance(master_secret, bindings.IndyObject): - master_secret = MasterSecret.load(master_secret) + if not isinstance(link_secret, bindings.IndyObject): + link_secret = LinkSecret.load(link_secret) schemas = [ (Schema.load(s) if not isinstance(s, bindings.IndyObject) else s).handle for s in schemas @@ -410,7 +410,7 @@ def create( creds, creds_prove, self_attest, - master_secret.handle, + link_secret.handle, schemas, cred_defs, )