Hyperledger Aries

Since Camel 3.19

Only producer is supported

The Hyperledger Aries component uses Nessus Aries and transitively the Aries Cloud Agent Java Client to provide access to an ecosystems of Verifiable Credentials (VC). This is part of a larger effort to provide a digital Self Sovereign Identity (SSI), to people, institutions and things - in the end it is all about "Trust over IP".

A good introduction video to this technology space is The Story of Open SSI Standards.

Maven users will need to add the following dependency to their pom.xml for this component:

    <!-- use the same version as your Camel core version -->

URI format


Configuring Options

Camel components are configured on two separate levels:

  • component level

  • endpoint level

Configuring Component Options

The component level is the highest level which holds general and common configurations that are inherited by the endpoints. For example a component may have security settings, credentials for authentication, urls for network connection and so forth.

Some components only have a few options, and others may have many. Because components typically have pre configured defaults that are commonly used, then you may often only need to configure a few options on a component; or none at all.

Configuring components can be done with the Component DSL, in a configuration file (application.properties|yaml), or directly with Java code.

Configuring Endpoint Options

Where you find yourself configuring the most is on endpoints, as endpoints often have many options, which allows you to configure what you need the endpoint to do. The options are also categorized into whether the endpoint is used as consumer (from) or as a producer (to), or used for both.

Configuring endpoints is most often done directly in the endpoint URI as path and query parameters. You can also use the Endpoint DSL as a type safe way of configuring endpoints.

A good practice when configuring options is to use Property Placeholders, which allows to not hardcode urls, port numbers, sensitive information, and other settings. In other words placeholders allows to externalize the configuration from your code, and gives more flexibility and reuse.

The following two sections lists all the options, firstly for the component followed by the endpoint.

Component Options

The Hyperledger Aries component supports 3 options, which are listed below.

Name Description Default Type

lazyStartProducer (producer)

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.



removeWalletsOnShutdown (producer)

Remove wallets from the Agent on shutdown.



autowiredEnabled (advanced)

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.



Endpoint Options

The Hyperledger Aries endpoint is configured using URI syntax:


with the following path and query parameters:

Path Parameters (1 parameters)

Name Description Default Type

walletName (producer)

Required The wallet to connect to.


Query Parameters (5 parameters)

Name Description Default Type

autoSchema (producer)

Allow on-demand schema creation.



schemaName (producer)

A schema name.


schemaVersion (producer)

A schema version.


service (producer)

An API path (e.g. /issue-credential/records).


lazyStartProducer (producer (advanced))

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.



Aries Cloud Agent Connection

This component communicates with an instance of Aries Cloud Agent Python (a.k.a ACA-Py) via REST API, which in turn requires a connection to a Distributed Ledger (e.g. Hyperledger Indy) and a Indy Tails Server for Credential Revocation support.

The easiest way to get started is using the Docker Compose script provided by Nessus Aries

docker compose up --detach && docker compose logs -f acapy

The Camel component uses an AgentConfiguration object to make the connection to ACA-Py. The connection parameters can be configured through these environment variables…​

ACAPY_API_KEY: adminkey


Once the connection with ACA-Py is established we can access various SSI related protocols. Here, we use the classical Alice/Faber example walktrough. Alice, a former student of Faber College ("Knowledge is Good"), connects with the College, is issued a credential about her degree and then uses this verifiable credential to apply for a job with Acme Corp. Acme uses "Trust over IP" to verifiy that Alice actually graduated from Faber and perhaps even more imporantly that Faber is authorized to issue such credentials. Alice gets the job (of course ;-) and can now now use this employment credential to apply for a loan with Thrift Bank. At some point in the future, Alice decides to leave Acme for to pursue other things in life, uppon which, Acme revokes the previously issued credential. The transcript credential from Faber cannot be revoked - the associated cryptographic material remain immutably in the distributed ledger.

The code snipets below are abridged for readability - for the fully working copy have a look at CamelGettingStartedTest.

Working with Wallets

A Wallet primarily holds Credentials and Connections to other peers. The Ledger does not store personal information - instead, it holds cryptographic material, Credential Schemas, public Digital Identities (DID) and so on. The component can work with Wallets that already exist in ACA-Py or alternatively it can create/remove such Wallets


CreateWalletRequest walletRequest = CreateWalletRequest.builder()
        .walletKey(walletName + "Key")

template.requestBodyAndHeaders("direct:admin", walletRequest, Map.of(

Creating Credential Schemas

Credential Schema is the base semantic structure that describes the list of attributes which one particular Credential can contain.

It’s not possible to update an existing Schema. If the Schema needs to be evolved, a new Schema with a new version or name needs to be created.


SchemaSendRequest schemaRequest = SchemaSendRequest.builder()

SchemaSendResponse schemaResponse = template.requestBodyAndHeaders("direct:faber", schemaRequest, Map.of(
        HEADER_SERVICE, "/schemas"),

Creating Credential Definitions

Credential Definition is similar in that the keys that the Issuer uses for the signing of Credentials also satisfies a specific Credential Schema.

It references it’s associated schema, announces who is going to be issuing credentials with that schema, what type of signature method they plan to use (“CL” = “Camenisch Lysyanskya”, the default method used for zero-knowledge proofs by indy), how they plan to handle revocation, and so forth.

It’s not possible to update data in an existing Credential Definition. If a Credential Definition needs to be evolved (for example, a key needs to be rotated), then a new Credential Definition needs to be created by a new Issuer DID.

A Credential Definition can be created and saved in the Ledger by an Endorser.


CredentialDefinitionRequest credDefRequest = CredentialDefinitionRequest.builder()
        .schemaId(ctx.getAttachment(TranscriptSchemaId, String.class))

CredentialDefinitionResponse credDefResponse = template.requestBodyAndHeaders("direct:faber", credDefRequest, Map.of(
        HEADER_SERVICE, "/credential-definitions"),

Create a Peer Connection

When Alice connects to Faber, she doesn’t use Faber’s public DID. Instead, both parties create new DIDs that they use for their Peer Connection.

That A has a trusted connection with B, is of nobody’s business except A and B.

// Inviter creates an invitation (/connections/create-invitation)
UnaryOperator<String> uri = wn -> "direct:" + wn.toLowerCase();
CreateInvitationRequest createInvitationRequest = CreateInvitationRequest.builder().build();
CreateInvitationResponse createInvitationResponse = template.requestBodyAndHeaders("direct:faber",
        createInvitationRequest, Map.of(HEADER_SERVICE, "/connections/create-invitation"),

// This invitation data finds its way to the Invitee somehow (i.e. out-of-band)
ConnectionInvitation invitation = createInvitationResponse.getInvitation();

// Invitee receives the invitation from the Inviter (/connections/receive-invitation)
ReceiveInvitationRequest receiveInvitationRequest = ReceiveInvitationRequest.builder()

ConnectionReceiveInvitationFilter receiveParams = ConnectionReceiveInvitationFilter.builder()

template.requestBodyAndHeaders("direct:alice", receiveInvitationRequest, Map.of(
        HEADER_SERVICE, "/connections/receive-invitation",
        ConnectionReceiveInvitationFilter.class.getName(), receiveParams),

Get a Verifiable Credential

A credential is a piece of information about an identity — a name, an age, a credit score…​ It is information claimed to be true.

Credentials are offered by an Issuer and stored in the Wallet of the Holder.

An issuer may be any identity owner known to the Ledger and any issuer may issue a credential about any identity owner it can identify.

The usefulness and reliability of a credential are tied to the reputation of the issuer with respect to the credential at hand. For Alice to self-issue a credential that she likes chocolate ice cream may be perfectly reasonable, but for her to self-issue a credential that she graduated from Faber College should not impress anyone.

/* 1. Faber sends the Transcript Credential Offer
 * The value of this Transcript Credential is that it is provably issued by Faber College

V1CredentialOfferRequest credentialOffer = V1CredentialOfferRequest.builder()
        .credentialPreview(new CredentialPreview(
                        "first_name", "Alice",
                        "last_name", "Garcia",
                        "ssn", "123-45-6789",
                        "degree", "Bachelor of Science, Marketing",
                        "status", "graduated",
                        "year", "2015",
                        "average", "5"))))

template.requestBodyAndHeaders("direct:faber", credentialOffer, Map.of(
        HEADER_SERVICE, "/issue-credential/send-offer"),

/* 2. Alice inspects the the Transcript Credential Offer

CredentialProposal credentialProposal = holderExchange.getCredentialProposalDict().getCredentialProposal();
CredentialProposalHelper credentialHelper = new CredentialProposalHelper(credentialProposal);
Assertions.assertEquals("Alice", credentialHelper.getAttributeValue("first_name"));
Assertions.assertEquals("Garcia", credentialHelper.getAttributeValue("last_name"));
Assertions.assertEquals("graduated", credentialHelper.getAttributeValue("status"));
Assertions.assertEquals("5", credentialHelper.getAttributeValue("average"));

/* 3. Alice sends the Transcript Credential Request

template.requestBodyAndHeaders("direct:alice", null, Map.of(
        HEADER_SERVICE, "/issue-credential/records/" + holderCredentialExchangeId + "/send-request"),

/* 4. Faber receives the Transcript Credential Request

V1CredentialExchange issuerExchange = issuerEvents.credentialEx()
        .filter(cex -> cex.getState() == CredentialExchangeState.REQUEST_RECEIVED)

/* 5. Faber issues the Transcript Credential

V1CredentialIssueRequest credentialIssueRequest = V1CredentialIssueRequest.builder().build();

template.requestBodyAndHeaders("direct:faber", credentialIssueRequest, Map.of(
        HEADER_SERVICE, "/issue-credential/records/" + issuerCredentialExchangeId + "/issue"),

/* 6. Alice receives the Transcript Credential

holderExchange = holderEvents.credentialEx()
        .filter(cex -> cex.getState() == CredentialExchangeState.CREDENTIAL_RECEIVED)

/* 7. Alice stores the Transcript Credential

V1CredentialStoreRequest credentialStoreRequest = V1CredentialStoreRequest.builder()

template.requestBodyAndHeaders("direct:alice", credentialStoreRequest, Map.of(
        HEADER_SERVICE, "/issue-credential/records/" + holderCredentialExchangeId + "/store"),

Verify a Credential

Above we said, that Credentials are offered by an Issuer and stored in the Wallet of the Holder.

During the Credential verification process, the Verifier may request Proof for some attribute claim from the Proover. In our case, Acme (the Verifier) requests proof from Alice (the Proover) that certain attribute claims in the Transcript Credential are infact true.

/* 1. Acme creates a Job Application Proof Request
 * Notice that some attributes are verifiable and others are not.
 * The proof request says that degree, and graduation status, ssn and year must be formally asserted by an issuer and schema_key.
 * Notice also that the first_name, last_name and phone_number are not required to be verifiable.
 * By not tagging these credentials with a verifiable status, Acme’s credential request is saying it will accept
 * Alice’s own credential about her names and phone number.

PresentProofRequest proofRequest = PresentProofRequest.builder()
                .requestedAttribute("attr1_referent", proofReqAttr.apply("first_name"))
                .requestedAttribute("attr2_referent", proofReqAttr.apply("last_name"))
                .requestedAttribute("attr3_referent", restrictedProofReqAttr.apply("ssn", transcriptCredDefId))
                .requestedAttribute("attr4_referent", restrictedProofReqAttr.apply("degree", transcriptCredDefId))
                .requestedAttribute("attr5_referent", restrictedProofReqAttr.apply("status", transcriptCredDefId))
                .requestedAttribute("attr6_referent", restrictedProofReqAttr.apply("year", transcriptCredDefId))
                .requestedPredicate("pred1_referent", restrictedProofReqPred.apply("average >= 4", transcriptCredDefId))

template.requestBodyAndHeaders("direct:acme", proofRequest, Map.of(
        HEADER_SERVICE, "/present-proof/send-request"),

// 2. Alice searches her Wallet for Credentials that she can use for the creating of Proof for the Job-Application Proof Request

credentials.stream().forEach(cred -> {
    List<String> presentationReferents = cred.getPresentationReferents();
    CredentialInfo credInfo = cred.getCredentialInfo();
    String credDefId = credInfo.getCredentialDefinitionId();
    Map<String, String> attributes = credInfo.getAttrs();
    String referent = credInfo.getReferent();
    log.info("{}", cred);
    log.info("+- CredDefId: {}", credDefId);
    log.info("+- PresentationReferents: {}", presentationReferents);
    log.info("+- Attributes: {}", attributes);
    log.info("+- Referent: {}", referent);

    // Map attribute referents to their respective credential referent
    presentationReferents.stream().forEach(pr -> referentMapping.put(pr, referent));

/* 3. Alice provides Job Application Proof
 * Alice divides these attributes into the three groups:
 * - attributes values of which will be revealed
 * - attributes values of which will be unrevealed
 * - attributes for which creating of verifiable proof is not required

PresentationRequest presentationRequest = PresentationRequest.builder()
                "attr1_referent", "Alice",
                "attr2_referent", "Garcia"))
                "attr3_referent", indyRequestedAttr.apply("attr3_referent", true),
                "attr4_referent", indyRequestedAttr.apply("attr4_referent", true),
                "attr5_referent", indyRequestedAttr.apply("attr5_referent", true),
                "attr6_referent", indyRequestedAttr.apply("attr6_referent", true)))
                "pred1_referent", indyRequestedPred.apply("pred1_referent")))

template.requestBodyAndHeaders("direct:alice", presentationRequest, Map.of(
        HEADER_SERVICE, "/present-proof/records/" + proverExchangeId + "/send-presentation"),

/* 4. Acme verifies the Job Application Proof from Alice

template.requestBodyAndHeaders("direct:acme", null, Map.of(
        HEADER_SERVICE, "/present-proof/records/" + verifierExchangeId + "/verify-presentation"),

verifierExchangeRecord = verifierEvents.presentationEx()
        .filter(pex -> pex.getState() == PresentationExchangeState.VERIFIED)

Assertions.assertTrue(verifierExchangeRecord.isVerified(), "Not VERIFIED");