pub fn add_sub_proof_request(&mut self,
                                 sub_proof_request: &SubProofRequest,
                                 credential_schema: &CredentialSchema,
                                 non_credential_schema: &NonCredentialSchema,
                                 credential_pub_key: &CredentialPublicKey,
                                 rev_key_pub: Option<&RevocationKeyPublic>,
                                 rev_reg: Option<&RevocationRegistry>) -> Result<(), IndyCryptoError> {
        ProofVerifier::_check_add_sub_proof_request_params_consistency(sub_proof_request, credential_schema)?;

        self.credentials.push(VerifiableCredential {
            pub_key: credential_pub_key.clone()?,
            sub_proof_request: sub_proof_request.clone(),
            credential_schema: credential_schema.clone(),
            non_credential_schema: non_credential_schema.clone(),
            rev_key_pub: rev_key_pub.map(Clone::clone),
            rev_reg: rev_reg.map(Clone::clone)
        });
        Ok(())
    }
/// Add sub proof request to proof verifier.
/// The order of sub-proofs is important: both Prover and Verifier should use the same order.
///
/// # Arguments
/// * `proof_verifier` - Proof verifier.
/// * `credential_schema` - Credential schema.
/// * `credential_pub_key` - Credential public key.
/// * `rev_reg_pub` - Revocation registry public key.
/// * `sub_proof_request` - Requested attributes and predicates instance pointer.
///
/// #Example
/// ```
/// use indy_crypto::cl::issuer::Issuer;
/// use indy_crypto::cl::verifier::Verifier;
///
/// let mut credential_schema_builder = Issuer::new_credential_schema_builder().unwrap();
/// credential_schema_builder.add_attr("sex").unwrap();
/// let credential_schema = credential_schema_builder.finalize().unwrap();
///
/// let mut non_credential_schema_builder = Issuer::new_non_credential_schema_builder().unwrap();
/// non_credential_schema_builder.add_attr("master_secret").unwrap();
/// let non_credential_schema = non_credential_schema_builder.finalize().unwrap();
///
/// let (credential_pub_key, credential_priv_key, cred_key_correctness_proof) = Issuer::new_credential_def(&credential_schema, &non_credential_schema, false).unwrap();
///
/// let (credential_pub_key, _credential_priv_key, _credential_key_correctness_proof) = Issuer::new_credential_def(&credential_schema, &non_credential_schema, false).unwrap();
///
/// let mut sub_proof_request_builder = Verifier::new_sub_proof_request_builder().unwrap();
/// sub_proof_request_builder.add_revealed_attr("sex").unwrap();
/// let sub_proof_request = sub_proof_request_builder.finalize().unwrap();
///
/// let mut proof_verifier = Verifier::new_proof_verifier().unwrap();
///
/// proof_verifier.add_sub_proof_request(&sub_proof_request,
///                                      &credential_schema,
///                                      &non_credential_schema,
///                                      &credential_pub_key,
///                                      None,
///                                      None).unwrap();
/// ```
Add sub proof request to proof verifier.
The order of sub-proofs is important: both Prover and Verifier should use the same order.
Add sub proof request to proof verifier . The order of sub - proofs is important : both Prover and Verifier should use the same order .
pub fn add_sub_proof_request(&mut self,
                                 sub_proof_request: &SubProofRequest,
                                 credential_schema: &CredentialSchema,
                                 non_credential_schema: &NonCredentialSchema,
                                 credential_pub_key: &CredentialPublicKey,
                                 rev_key_pub: Option<&RevocationKeyPublic>,
                                 rev_reg: Option<&RevocationRegistry>) -> Result<(), IndyCryptoError> {
        ProofVerifier::_check_add_sub_proof_request_params_consistency(sub_proof_request, credential_schema)?;
        self.credentials.push(VerifiableCredential {
            pub_key: credential_pub_key.clone()?,
            sub_proof_request: sub_proof_request.clone(),
            credential_schema: credential_schema.clone(),
            non_credential_schema: non_credential_schema.clone(),
            rev_key_pub: rev_key_pub.map(Clone::clone),
            rev_reg: rev_reg.map(Clone::clone)
        });
        Ok(())
    }
pub fn add_sub_proof_request ( & mut self , sub_proof_request : & SubProofRequest , credential_schema : & CredentialSchema , non_credential_schema : & NonCredentialSchema , credential_pub_key : & CredentialPublicKey , rev_key_pub : Option < & RevocationKeyPublic > , rev_reg : Option < & RevocationRegistry > ) -> Result < ( ) , IndyCryptoError > { ProofVerifier :: _check_add_sub_proof_request_params_consistency ( sub_proof_request , credential_schema ) ? ; self . credentials . push ( VerifiableCredential { pub_key : credential_pub_key . clone ( ) ? , sub_proof_request : sub_proof_request . clone ( ) , credential_schema : credential_schema . clone ( ) , non_credential_schema : non_credential_schema . clone ( ) , rev_key_pub : rev_key_pub . map ( Clone :: clone ) , rev_reg : rev_reg . map ( Clone :: clone ) } ) ; Ok ( ( ) ) }
Add sub proof request to proof verifier.
Add sub proof request to proof verifier .
&mut self
sub_proof_request
&SubProofRequest
credential_schema
&CredentialSchema
non_credential_schema
&NonCredentialSchema
credential_pub_key
&CredentialPublicKey
rev_key_pub
Option<&RevocationKeyPublic>
rev_reg
Option<&RevocationRegistry>
&mut self
sub_proof_request
&SubProofRequest
credential_schema
&CredentialSchema
non_credential_schema
&NonCredentialSchema
credential_pub_key
&CredentialPublicKey
rev_key_pub
Option<&RevocationKeyPublic>
rev_reg
Option<&RevocationRegistry>
example
```
use indy_crypto::cl::issuer::Issuer;
use indy_crypto::cl::verifier::Verifier.





let (credential_pub_key, credential_priv_key, cred_key_correctness_proof) = Issuer::new_credential_def(&credential_schema, &non_credential_schema, false).unwrap().

let (credential_pub_key, _credential_priv_key, _credential_key_correctness_proof) = Issuer::new_credential_def(&credential_schema, &non_credential_schema, false).unwrap().



let mut proof_verifier = Verifier::new_proof_verifier().unwrap().

proof_verifier.add_sub_proof_request(⊂_proof_request,
&credential_schema,
&non_credential_schema,
&credential_pub_key,
None,
None).unwrap();
```
` ` ` use indy_crypto :: cl :: issuer :: Issuer ; use indy_crypto :: cl :: verifier :: Verifier . let ( credential_pub_key credential_priv_key cred_key_correctness_proof ) = Issuer :: new_credential_def ( &credential_schema &non_credential_schema false ) . unwrap () . let ( credential_pub_key _credential_priv_key _credential_key_correctness_proof ) = Issuer :: new_credential_def ( &credential_schema &non_credential_schema false ) . unwrap () . let mut proof_verifier = Verifier :: new_proof_verifier () . unwrap () . proof_verifier . add_sub_proof_request ( ⊂_proof_request &credential_schema &non_credential_schema &credential_pub_key None None ) . unwrap () ; ` ` `