Show / Hide Table of Contents

    Class AnonCreds

    Provides methods for managing anonymous credentials.

    Inheritance
    System.Object
    AnonCreds
    Namespace: Hyperledger.Indy.AnonCredsApi
    Assembly: Hyperledger.Indy.Sdk.dll
    Syntax
    public static class AnonCreds : Object

    Methods

    CreateRevocationStateAsync(BlobStorageReader, String, String, Int64, String)

    Declaration
    public static Task<string> CreateRevocationStateAsync(BlobStorageReader blobStorageReader, string revRegDef, string revRegDelta, long timestamp, string credRevId)
    Parameters
    Type Name Description
    BlobStorageReader blobStorageReader
    System.String revRegDef
    System.String revRegDelta
    System.Int64 timestamp
    System.String credRevId
    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    IssuerCreateAndStoreCredentialDefAsync(Wallet, String, String, String, String, String)

    Declaration
    public static Task<IssuerCreateAndStoreCredentialDefResult> IssuerCreateAndStoreCredentialDefAsync(Wallet wallet, string issuerDid, string schemaJson, string tag, string type, string configJson)
    Parameters
    Type Name Description
    Wallet wallet
    System.String issuerDid
    System.String schemaJson
    System.String tag
    System.String type
    System.String configJson
    Returns
    Type Description
    System.Threading.Tasks.Task<IssuerCreateAndStoreCredentialDefResult>

    IssuerCreateAndStoreRevocRegAsync(Wallet, String, String, String, String, String, BlobStorageWriter)

    Declaration
    public static Task<IssuerCreateAndStoreRevocRegResult> IssuerCreateAndStoreRevocRegAsync(Wallet wallet, string issuerDid, string type, string tag, string credDefId, string configJson, BlobStorageWriter tailsWriter)
    Parameters
    Type Name Description
    Wallet wallet
    System.String issuerDid
    System.String type
    System.String tag
    System.String credDefId
    System.String configJson
    BlobStorageWriter tailsWriter
    Returns
    Type Description
    System.Threading.Tasks.Task<IssuerCreateAndStoreRevocRegResult>

    IssuerCreateCredentialAsync(Wallet, String, String, String, String, BlobStorageReader)

    Declaration
    public static Task<IssuerCreateCredentialResult> IssuerCreateCredentialAsync(Wallet wallet, string credOfferJson, string credReqJson, string credValuesJson, string revRegId, BlobStorageReader blobStorageReader)
    Parameters
    Type Name Description
    Wallet wallet
    System.String credOfferJson
    System.String credReqJson
    System.String credValuesJson
    System.String revRegId
    BlobStorageReader blobStorageReader
    Returns
    Type Description
    System.Threading.Tasks.Task<IssuerCreateCredentialResult>

    IssuerCreateCredentialOfferAsync(Wallet, String)

    Declaration
    public static Task<string> IssuerCreateCredentialOfferAsync(Wallet wallet, string credDefId)
    Parameters
    Type Name Description
    Wallet wallet
    System.String credDefId
    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    IssuerCreateSchemaAsync(String, String, String, String)

    Declaration
    public static Task<IssuerCreateSchemaResult> IssuerCreateSchemaAsync(string issuerDid, string name, string version, string attrs)
    Parameters
    Type Name Description
    System.String issuerDid
    System.String name
    System.String version
    System.String attrs
    Returns
    Type Description
    System.Threading.Tasks.Task<IssuerCreateSchemaResult>

    IssuerMergeRevocationRegistryDeltasAsync(String, String)

    Declaration
    public static Task<string> IssuerMergeRevocationRegistryDeltasAsync(string revRegDelta, string otherRevRegDelta)
    Parameters
    Type Name Description
    System.String revRegDelta
    System.String otherRevRegDelta
    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    IssuerRevokeCredentialAsync(Wallet, BlobStorageReader, String, String)

    Declaration
    public static Task<string> IssuerRevokeCredentialAsync(Wallet wallet, BlobStorageReader blobStorageReader, string revRegId, string credRevocId)
    Parameters
    Type Name Description
    Wallet wallet
    BlobStorageReader blobStorageReader
    System.String revRegId
    System.String credRevocId
    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    ProverCreateCredentialReqAsync(Wallet, String, String, String, String)

    Declaration
    public static Task<ProverCreateCredentialRequestResult> ProverCreateCredentialReqAsync(Wallet wallet, string proverDid, string credOfferJson, string credDefJson, string masterSecretId)
    Parameters
    Type Name Description
    Wallet wallet
    System.String proverDid
    System.String credOfferJson
    System.String credDefJson
    System.String masterSecretId
    Returns
    Type Description
    System.Threading.Tasks.Task<ProverCreateCredentialRequestResult>

    ProverCreateMasterSecretAsync(Wallet, String)

    Creates a master secret with the specified name and stores it in the provided wallet.

    Declaration
    public static Task<string> ProverCreateMasterSecretAsync(Wallet wallet, string masterSecretId)
    Parameters
    Type Name Description
    Wallet wallet

    The target wallet.

    System.String masterSecretId
    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    An asynchronous System.Threading.Tasks.Task that completes when the operation has completed.

    Remarks

    The name of the master secret must be unique within the wallet.

    ProverCreateProofAsync(Wallet, String, String, String, String, String, String)

    Creates a proof for the provided proof request.

    Declaration
    public static Task<string> ProverCreateProofAsync(Wallet wallet, string proofRequest, string requestedCredentials, string masterSecret, string schemas, string credentialDefs, string revStates)
    Parameters
    Type Name Description
    Wallet wallet

    The target wallet.

    System.String proofRequest
    System.String requestedCredentials
    System.String masterSecret
    System.String schemas
    System.String credentialDefs
    System.String revStates
    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    An asynchronous System.Threading.Tasks.Task<> that, when the operation completes, resolves to a JSON string containing the proof.

    Remarks

    Either a corresponding claim with optionally revealed attributes or self-attested attribute must be provided for each requested attribute - see the Hyperledger.Indy.AnonCredsApi.AnonCreds.ProverGetClaimsForProofReqAsync(Hyperledger.Indy.WalletApi.Wallet,System.String) method. A proof request may request multiple claims from different schema and different issuers. All required schema, public keys and revocation registries must be provided. The proof request also contains a nonce. The proof contains either proof or self-attested attribute value for each requested attribute.

    The proofReqJson parameter expects a JSON string containing a proof request from the party that will verify the proof. E.g.:

     {
        "nonce": string,
        "requested_attr1_referent": <attr_info>,
        "requested_attr2_referent": <attr_info>,
        "requested_attr3_referent": <attr_info>,
        "requested_predicate_1_referent": <predicate_info>,
        "requested_predicate_2_referent": <predicate_info>,
    }

    The requestedClaimsJson parameter should contain either a claim or a self-attested attribute for each attribute requested in the proof request. E.g.:

    {
        "requested_attr1_referent": [claim1_referent_in_wallet, true <reveal_attr>],
        "requested_attr2_referent": [self_attested_attribute],
        "requested_attr3_referent": [claim2_seq_no_in_wallet, false]
        "requested_attr4_referent": [claim2_seq_no_in_wallet, true]
        "requested_predicate_1_referent": [claim2_seq_no_in_wallet],
        "requested_predicate_2_referent": [claim3_seq_no_in_wallet],
    }

    The schemasJson parameter expects the JSON for each schema that participates in the proof request. E.g.:

    {
        "claim1_referent_in_wallet": <schema1>,
        "claim2_referent_in_wallet": <schema2>,
        "claim3_referent_in_wallet": <schema3>,
    }

    The masterSecretName specifies the name of the master secret stored in the wallet.

    The claimDefsJson parameter expects the JSON for each claim definition participating in the proof request. E.g.:

    {
        "claim1_referent_in_wallet": <claim_def1>,
        "claim2_referent_in_wallet": <claim_def2>,
        "claim3_referent_in_wallet": <claim_def3>,
    }

    The revocRegsJson parameter expects the JSON for each revocation registry participating in the proof request. E.g.:

    {
        "claim1_referent_in_wallet": <revoc_reg1>,
        "claim2_referent_in_wallet": <revoc_reg2>,
        "claim3_referent_in_wallet": <revoc_reg3>,
    }

    Upon successful completion the operation will return a JSON string. For each requested attribute either a proof (with optionally revealed attribute value) or self-attested attribute value is provided. Each proof is associated with a claim and corresponding schema_seq_no, issuer_did and revoc_reg_seq_no. There is also aggregated proof part common for all claim proofs.

    {
        "requested": {
            "requested_attr1_id": [claim_proof1_referent, revealed_attr1, revealed_attr1_as_int],
            "requested_attr2_id": [self_attested_attribute],
            "requested_attr3_id": [claim_proof2_referent]
            "requested_attr4_id": [claim_proof2_referent, revealed_attr4, revealed_attr4_as_int],
            "requested_predicate_1_referent": [claim_proof2_referent],
            "requested_predicate_2_referent": [claim_proof3_referent],
            }
        "claim_proofs": {
            "claim_proof1_referent": [<claim_proof>, issuer_did, schema_seq_no, revoc_reg_seq_no],
            "claim_proof2_referent": [<claim_proof>, issuer_did, schema_seq_no, revoc_reg_seq_no],
            "claim_proof3_referent": [<claim_proof>, issuer_did, schema_seq_no, revoc_reg_seq_no]
        },
        "aggregated_proof": <aggregated_proof>
    }

    ProverGetCredentialsAsync(Wallet, String)

    Declaration
    public static Task<string> ProverGetCredentialsAsync(Wallet wallet, string filterJson)
    Parameters
    Type Name Description
    Wallet wallet
    System.String filterJson
    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    ProverGetCredentialsForProofReqAsync(Wallet, String)

    Declaration
    public static Task<string> ProverGetCredentialsForProofReqAsync(Wallet wallet, string proofRequestJson)
    Parameters
    Type Name Description
    Wallet wallet
    System.String proofRequestJson
    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    ProverStoreCredentialAsync(Wallet, String, String, String, String, String)

    Declaration
    public static Task<string> ProverStoreCredentialAsync(Wallet wallet, string credId, string credReqMetadataJson, string credJson, string credDefJson, string revRegDefJson)
    Parameters
    Type Name Description
    Wallet wallet
    System.String credId
    System.String credReqMetadataJson
    System.String credJson
    System.String credDefJson
    System.String revRegDefJson
    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    UpdateRevocationStateAsync(BlobStorageReader, String, String, String, Int64, String)

    Declaration
    public static Task<string> UpdateRevocationStateAsync(BlobStorageReader blobStorageReader, string revState, string revRegDef, string revRegDelta, long timestamp, string credRevId)
    Parameters
    Type Name Description
    BlobStorageReader blobStorageReader
    System.String revState
    System.String revRegDef
    System.String revRegDelta
    System.Int64 timestamp
    System.String credRevId
    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    VerifierVerifyProofAsync(String, String, String, String, String, String)

    Declaration
    public static Task<bool> VerifierVerifyProofAsync(string proofRequest, string proof, string schemas, string credentialDefs, string revocRegDefs, string revocRegs)
    Parameters
    Type Name Description
    System.String proofRequest
    System.String proof
    System.String schemas
    System.String credentialDefs
    System.String revocRegDefs
    System.String revocRegs
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>
    Back to top Copyright © 2017 The Linux Foundation®