syedelec opened a new issue, #103:
URL: https://github.com/apache/incubator-teaclave-trustzone-sdk/issues/103

   Hello
   
   I want to create a persistent object from an initialized transient object 
however it did not seem to work and unfortunately there are no examples, the 
only examples concern creating a persistent object with initial data.
   
   According to code documentation, this should be possible. Refer to 
[code](https://github.com/apache/incubator-teaclave-trustzone-sdk/blob/master/optee-utee/src/object.rs#L937-L938).
   
   Here is a sample code:
   
   ```
   let mut obj_id = [1u8; 1];
   let obj_data_flag = DataFlag::ACCESS_READ | DataFlag::ACCESS_WRITE | 
DataFlag::ACCESS_WRITE_META;
   
   let mut ec_key = 
TransientObject::allocate(TransientObjectType::EcdsaKeypair, 256).unwrap();
   let attr_curve = AttributeValue::from_value(AttributeId::EccCurve, 
ElementId::EccCurveNistP256 as u32, 0);
   ec_key.generate_key(256, &[attr_curve.into()])?;
   
   match PersistentObject::create(
       ObjectStorageConstants::Private,
       &mut obj_id,
       obj_data_flag,
       Some(ec_key), // Do not work. What to put here?
       b"",
   ) {
       Err(e) => {
           return Err(e);
       }
   
       Ok(mut object) => {
           trace_println!("success");
       },
   }
   ```
   
   Thanks for your help.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@teaclave.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@teaclave.apache.org
For additional commands, e-mail: dev-h...@teaclave.apache.org

Reply via email to