Class PresentationExchangeRecord

    • Method Detail

      • hasCredentialDefinitionId

        public boolean hasCredentialDefinitionId​(@NonNull
                                                 @NonNull String credentialDefinitionId)
      • hasSchemaId

        public boolean hasSchemaId​(@NonNull
                                   @NonNull String schemaId)
      • getPresentation

        public com.google.gson.JsonObject getPresentation()
      • from

        public <T> T from​(@NonNull
                          @NonNull Class<T> type)
        Sets the received presentation attributes on the instance. Only works for matching names. The AttributeName annotation can be used to exclude fields from processing or to handle different names. The AttributeGroupName annotation can be used to specify the attribute group name of the presentation in case there is more than one.
        Type Parameters:
        T - The class type
        Parameters:
        type - the POJO template to instantiate
        Returns:
        Instance of the POJO with set properties
      • from

        public Map<String,​Object> from​(@NonNull
                                             @NonNull Set<String> names)
        Finds the attribute names in the proof and extracts their corresponding values. Note this is brute force and simply returns the first match found for each name It's recommended to use findRevealedAttributes() or findRevealedAttributeGroups()
        Parameters:
        names - Set of attribute names
        Returns:
        Map containing the attribute names and their corresponding values
      • findRevealedAttributeGroups

        public Map<String,​PresentationExchangeRecord.RevealedAttributeGroup> findRevealedAttributeGroups()
        Low level extractor that maps revealed attributes and values to their group
        
         {
           "bank-account": {
             "revealed_attributes": {
               "bic": "1234",
               "iban": "4321"
             },
             "identifier": {
               "schema_id": "M6Mbe3qx7vB4wpZF4sBRjt:2:bank_account:1.0",
               "cred_def_id": "F6dB7dMVHUQSC64qemnBi7:3:CL:571:mybank",
               "timestamp": "1628609220"
             }
           }
         }
         
         
        Returns:
        revealed attributes mapped to their group
      • findRevealedAttributes

        public Map<String,​Object> findRevealedAttributes()
        Low level extractor that returns a map of all revealed attributes and their values.
        
         {
             "iban": "4321",
             "bic": "1234"
         }
         
         
        Returns:
        revealed attribute to value mapping
      • findRevealedAttributedFull

        public Map<String,​PresentationExchangeRecord.RevealedAttribute> findRevealedAttributedFull()
        Low level extractor that returns a map of all revealed attributes with the all their information. This is useful for all cases where access to the sub proof index is needed to extract the matching identifier from the identifiers list.
        
         "iban": {
             "sub_proof_index": 0,
             "raw": "4321",
             "encoded": "26574491753489267293487534742481789407179815570291479106142274998003667228256"
         },
         "bic": {
             "sub_proof_index": 0,
             "raw": "1234",
             "encoded": "95644933709556837616493211320418578774074706673436554047751118609009445904569"
         }
         
         
        Returns:
        revealed attribute to value mapping
      • getPresentationProposalDict

        public com.google.gson.JsonObject getPresentationProposalDict()
      • getPresentationRequestDict

        public com.google.gson.JsonObject getPresentationRequestDict()
      • setPresentationProposalDict

        public void setPresentationProposalDict​(com.google.gson.JsonObject presentationProposalDict)
      • setPresentationRequestDict

        public void setPresentationRequestDict​(com.google.gson.JsonObject presentationRequestDict)
      • setPresentation

        public void setPresentation​(com.google.gson.JsonObject presentation)