5. serializeWithTemplate

    1. String weId = "did:weid:0x0106595955ce4713fd169bfa68e599eb99ca2e9f";
    2. List<String> verifierWeIdList = new ArrayList<String>();
    3. verifierWeIdList.add(weId);
    4.  
    5. PresentationE presentation;
    6. WeIdAuthentication weIdAuthentication = new WeIdAuthentication();
    7.  
    8. //原文方式调用
    9. ResponseData<byte[]> result1 =
    10. .newPdfTransportation()
    11. .specify(verifierWeIdList)
    12. .serializeWithTemplate(
    13. presentation,
    14. new ProtocolProperty(EncodeType.ORIGINAL),
    15. weIdAuthentication,
    16. "./test-template.pdf",
    17. "./");
    18.  
    19. ResponseData<byte[]> result2 =
    20. TransportationFactory
    21. .newPdfTransportation()
    22. .specify(verifierWeIdList)
    23. .serializeWithTemplate(
    24. presentation,
    25. new ProtocolProperty(EncodeType.CIPHER),
    26. weIdAuthentication,
    27. "./test-template.pdf",