Search in sources :

Example 1 with SignatureHeader

use of org.hyperledger.fabric.protos.common.Common.SignatureHeader in project fabric-sdk-java by hyperledger.

the class ProtoUtils method createSeekInfoEnvelope.

public static Envelope createSeekInfoEnvelope(TransactionContext transactionContext, SeekInfo seekInfo, byte[] tlsCertHash) throws CryptoException {
    ChannelHeader seekInfoHeader = createChannelHeader(Common.HeaderType.DELIVER_SEEK_INFO, transactionContext.getTxID(), transactionContext.getChannelID(), transactionContext.getEpoch(), transactionContext.getFabricTimestamp(), null, tlsCertHash);
    SignatureHeader signatureHeader = SignatureHeader.newBuilder().setCreator(transactionContext.getIdentity().toByteString()).setNonce(transactionContext.getNonce()).build();
    Common.Header seekHeader = Common.Header.newBuilder().setSignatureHeader(signatureHeader.toByteString()).setChannelHeader(seekInfoHeader.toByteString()).build();
    Payload seekPayload = Payload.newBuilder().setHeader(seekHeader).setData(seekInfo.toByteString()).build();
    return Envelope.newBuilder().setSignature(transactionContext.signByteString(seekPayload.toByteArray())).setPayload(seekPayload.toByteString()).build();
}
Also used : ChannelHeader(org.hyperledger.fabric.protos.common.Common.ChannelHeader) SignatureHeader(org.hyperledger.fabric.protos.common.Common.SignatureHeader) Payload(org.hyperledger.fabric.protos.common.Common.Payload) Common(org.hyperledger.fabric.protos.common.Common)

Aggregations

Common (org.hyperledger.fabric.protos.common.Common)1 ChannelHeader (org.hyperledger.fabric.protos.common.Common.ChannelHeader)1 Payload (org.hyperledger.fabric.protos.common.Common.Payload)1 SignatureHeader (org.hyperledger.fabric.protos.common.Common.SignatureHeader)1