I have a question regarding a method in plugin.go, found here
<https://github.com/hyperledger/fabric/blob/release-1.3/core/handlers/endorsement/plugin/plugin.go#L42>
within
the Hyperledger fabric library.
// Endorse signs the given payload(ProposalResponsePayload bytes), and
optionally mutates it.
// Returns:
// The Endorsement: A signature over the payload, and an identity that is used
to verify the signature
// The payload that was given as input (could be modified within this function)
// Or error on failure
func (e *DefaultEndorsement) Endorse(prpBytes []byte, sp *peer.SignedProposal)
(*peer.Endorsement, []byte, error) {
signer, err := e.SigningIdentityForRequest(sp)
if err != nil {
return nil, nil, errors.New(fmt.Sprintf("failed fetching signing
identity: %v", err))
}
// serialize the signing identity
identityBytes, err := signer.Serialize()
if err != nil {
return nil, nil, errors.New(fmt.Sprintf("could not serialize the
signing identity: %v", err))
}
// sign the concatenation of the proposal response and the serialized
endorser identity with this endorser's key
signature, err := signer.Sign(append(prpBytes, identityBytes...))
if err != nil {
return nil, nil, errors.New(fmt.Sprintf("could not sign the proposal
response payload: %v", err))
}
endorsement := &peer.Endorsement{Signature: signature, Endorser:
identityBytes}
return endorsement, prpBytes, nil
}
How can I deserialize the argument prpBytes to the object original?
prpBytes is type ProposalResponsePayload protobuf message
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.