Class PresentProofRequestHelper
- java.lang.Object
-
- org.hyperledger.aries.api.present_proof.PresentProofRequestHelper
-
public class PresentProofRequestHelper extends Object
Helper class that provides some convenience methods to build aPresentProofRequestFor more complex usecases use the builder methods directly in the class.
-
-
Constructor Summary
Constructors Constructor Description PresentProofRequestHelper()
-
Method Summary
-
-
-
Method Detail
-
buildForEachAttribute
public static PresentProofRequest buildForEachAttribute(String connectionId, @NonNull @NonNull Set<String> attributes, @NonNull @NonNull List<PresentProofRequest.ProofRequest.ProofRestrictions> restrictions)
Appends the restrictions for each field in the attribute list"name":"proof_req_2", "version":"0.1", "requested_attributes": { "attr1": { "name":"attr1", "restrictions": [ { "schema_id": "123:2:mySchema:1.0" }, {}] }, "attr2": { "name":"attr2", "restrictions": [ { "schema_id": "123:2:mySchema:1.0" }, {}] } } "requested_predicates": {}- Parameters:
connectionId- The connection idattributes- Set of schema attributesrestrictions- list ofPresentProofRequest.ProofRequest.ProofRestrictions- Returns:
PresentProofRequest
-
buildForEachAttribute
public static PresentProofRequest buildForEachAttribute(String connectionId, @NonNull @NonNull Set<String> attributes, PresentProofRequest.ProofRequest.ProofRestrictions restrictions)
Appends the restriction for each attribute within the list- Parameters:
connectionId- The connection idattributes- Set of schema attributesrestrictions-PresentProofRequest.ProofRequest.ProofRestrictions- Returns:
PresentProofRequest
-
buildForEachAttribute
public static <T> PresentProofRequest buildForEachAttribute(String connectionId, @NonNull @NonNull Class<T> attributes, @Nullable List<PresentProofRequest.ProofRequest.ProofRestrictions> restrictions)
Appends the restrictions for each field of the Pojo class- Type Parameters:
T- Class type- Parameters:
connectionId- The connection idattributes- Pojo class that represents the schema and its attributesrestrictions-PresentProofRequest.ProofRequest.ProofRestrictions- Returns:
PresentProofRequest
-
buildForEachAttribute
public static <T> PresentProofRequest buildForEachAttribute(String connectionId, @NonNull @NonNull Class<T> attributes, @Nullable PresentProofRequest.ProofRequest.ProofRestrictions restrictions)
Appends the restriction for each field of the Pojo class- Type Parameters:
T- Class type- Parameters:
connectionId- The connection idattributes- Pojo class that represents the schema and its attributesrestrictions-PresentProofRequest.ProofRequest.ProofRestrictions- Returns:
PresentProofRequest
-
buildForAllAttributes
public static PresentProofRequest buildForAllAttributes(String connectionId, @NonNull @NonNull Set<String> attributes, @NonNull @NonNull List<PresentProofRequest.ProofRequest.ProofRestrictions> restrictions)
Appends the restrictions to the attribute list- Parameters:
connectionId- The connection idattributes- List of schema attributesrestrictions- list ofPresentProofRequest.ProofRequest.ProofRestrictions- Returns:
PresentProofRequest
-
buildForAllAttributes
public static PresentProofRequest buildForAllAttributes(String connectionId, String attributeGroupName, @NonNull @NonNull Set<String> attributes, @NonNull @NonNull List<PresentProofRequest.ProofRequest.ProofRestrictions> restrictions, PresentProofRequest.ProofRequest.ProofNonRevoked nonRevoked)
Appends the restrictions to the attribute list"name":"proof_req_2", "version":"0.1", "requested_attributes": { "attribute_group_0": { "names":["attr1", "attr2"], "restrictions": [{ "schema_id": "123:2:mySchema:1.0", "issuer_did": "issuer1" }, { "schema_id": "123:2:otherSchema:1.0", "issuer_did": "issuer2" }] }] } "requested_predicates": {}- Parameters:
connectionId- The connection idattributeGroupName- nullable name of the attribute group, will be 'attribute_group_0' if nullattributes- List of schema attributesrestrictions- list ofPresentProofRequest.ProofRequest.ProofRestrictionsnonRevoked-PresentProofRequest.ProofRequest.ProofNonRevoked- Returns:
PresentProofRequest
-
buildForAllAttributes
public static <T> PresentProofRequest buildForAllAttributes(String connectionId, @NonNull @NonNull Class<T> type, @NonNull @NonNull List<PresentProofRequest.ProofRequest.ProofRestrictions> restrictions)
Appends the restrictions to the attribute list- Parameters:
connectionId- The connection idtype- pojo class that will be converted into a list of schema attributesrestrictions- list ofPresentProofRequest.ProofRequest.ProofRestrictions- Returns:
PresentProofRequest
-
buildForAllAttributes
public static <T> PresentProofRequest buildForAllAttributes(String connectionId, @NonNull @NonNull Class<T> type, @NonNull @NonNull List<PresentProofRequest.ProofRequest.ProofRestrictions> restrictions, PresentProofRequest.ProofRequest.ProofNonRevoked nonRevoked)
Appends the restrictions to the attribute list- Parameters:
connectionId- The connection idtype- pojo class that will be converted into a list of schema attributesrestrictions- list ofPresentProofRequest.ProofRequest.ProofRestrictionsnonRevoked-PresentProofRequest.ProofRequest.ProofNonRevoked- Returns:
PresentProofRequest
-
buildAttributeForAll
public static PresentProofRequest.ProofRequest.ProofRequestedAttributes buildAttributeForAll(@NotNull Set<String> attributes, @NotNull List<PresentProofRequest.ProofRequest.ProofRestrictions> restrictions, PresentProofRequest.ProofRequest.ProofNonRevoked nonRevoked)
-
buildProofRequest
public static PresentProofRequest buildProofRequest(String connectionId, @NonNull @NonNull Map<String,PresentProofRequest.ProofRequest.ProofRequestedAttributes> attrs)
-
-