Re: how to obtain an org's root CA certificate in application chaincode?


qs meng <qsmeng@...>
 

"or just let chaincde retrieve from internet", How to do this?


At 2019-05-07 09:28:00, "Baohua Yang" <yangbaohua@...> wrote:
Correct, other than the stub APIs, all other information should be passed as invoke parameters or just let chaincode retrieve from Internet.

On Tue, May 7, 2019 at 9:07 AM meng <qsmeng@...> wrote:
Baohua, now I see what you mean. Even I can put some sdk in chaincoded, the sdk wont work because  the chaincode only run in a  container, only can commnicate with  peers, but peers dont know how to deal with the sdk.
Thank you.
regards,
meng




At 2019-05-06 16:46:16, "Baohua Yang" <yangbaohua@...> wrote:
The chaincode cannot get the msp info from peer.

You can only use the stub APIs in chaincode.

On Mon, May 6, 2019 at 12:07 PM qs meng <qsmeng@...> wrote:
hi, 
    suppose one application certificate is issued by one fabric org's ca and the certificate needs being verified in  an application chaincode. 
    One way is to get the org's root ca certificate. But I do not know how to obtain the root certificate.
     Another way:  similar to forming a proposal, the application certificate is passed in chaincde as a creator,  and  use identity.Validate() to validate.  To do that, the chaincode including the following code:
      channelID := stub.GetChannelID()
     creatorByte, _ := stub.GetCreator()
     mspObj := mspmgmt.GetIdentityDeserializer(channelID)
     creator, err := mspObj.DeserializeIdentity(creatorByte)
     err = creator.Validate()
    return shim.Error("[error] return:" + err.Error())
after the successful import mgmt package and instantiation, the chaincode runs timeout.
  How to solve this problem? Thank you.
  Best regards,
qs meng


 



--
Best wishes!

Baohua Yang


 



--
Best wishes!

Baohua Yang


 

Join fabric@lists.hyperledger.org to automatically receive all group messages.