Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Jan 15, 2024
1 parent fe6a0d7 commit cb55590
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 16 deletions.
Binary file modified agent/dependencies/aries-framework-openid4vc-v0.4.2.tgz
Binary file not shown.
36 changes: 28 additions & 8 deletions agent/src/did/cheqd.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
import { agent } from "../agent";
import { CheqdDidCreateOptions } from "@aries-framework/cheqd";
import {
DidDocumentBuilder,
utils,
KeyType,
getEd25519VerificationKey2018,
} from "@aries-framework/core";

export async function createDidCheqd() {
// NOTE: we need to pass custom document for cheqd if we want to add it to `assertionMethod`

const did = `did:cheqd:testnet:${utils.uuid()}`;
const key = await agent.wallet.createKey({
keyType: KeyType.Ed25519,
});

const ed25519VerificationMethod = getEd25519VerificationKey2018({
key,
id: `${did}#key-1`,
controller: did,
});

const didDocument = new DidDocumentBuilder(did)
.addContext("https://w3id.org/security/suites/ed25519-2018/v1")
.addVerificationMethod(ed25519VerificationMethod)
.addAssertionMethod(ed25519VerificationMethod.id)
.addAuthentication(ed25519VerificationMethod.id)
.build();

const didResult = await agent.dids.create<CheqdDidCreateOptions>({
method: "cheqd",
didDocument,
options: {
network: "testnet",
methodSpecificIdAlgo: "base58btc",
},
secret: {
// FIXME: verificationMethod should be optional in AFJ for cheqd
verificationMethod: {
id: "key-1",
type: "Ed25519VerificationKey2020",
},
},
secret: {},
});

if (didResult.didState.state === "failed") {
Expand Down
12 changes: 6 additions & 6 deletions agent/src/issuerMetadata.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { JwaSignatureAlgorithm } from "@aries-framework/core";
import {
OpenId4VciCredentialSupportedWithId,
OpenIdCredentialFormatProfile,
OpenId4VciCredentialFormatProfile,
OpenId4VciIssuerMetadataDisplay,
} from "@aries-framework/openid4vc";

// FIXME: type needs to be exported from AFJ
export const issuerDisplay = [
{
background_color: "#FFFFFF",
Expand All @@ -17,11 +17,11 @@ export const issuerDisplay = [
},
text_color: "#E17471", // animo red
},
];
] satisfies OpenId4VciIssuerMetadataDisplay[];

export const animoOpenId4VcPlaygroundCredentialSdJwtVcDid = {
id: "AnimoOpenId4VcPlaygroundSdJwtVcDid",
format: OpenIdCredentialFormatProfile.SdJwtVc,
format: OpenId4VciCredentialFormatProfile.SdJwtVc,
vct: "AnimoOpenId4VcPlayground",
cryptographic_binding_methods_supported: ["did:key", "did:jwk"],
cryptographic_suites_supported: [JwaSignatureAlgorithm.EdDSA],
Expand All @@ -38,7 +38,7 @@ export const animoOpenId4VcPlaygroundCredentialSdJwtVcDid = {

export const animoOpenId4VcPlaygroundCredentialSdJwtVcJwk = {
id: "AnimoOpenId4VcPlaygroundSdJwtVcJwk",
format: OpenIdCredentialFormatProfile.SdJwtVc,
format: OpenId4VciCredentialFormatProfile.SdJwtVc,
vct: "AnimoOpenId4VcPlayground",
cryptographic_binding_methods_supported: ["jwk"],
cryptographic_suites_supported: [JwaSignatureAlgorithm.EdDSA],
Expand All @@ -55,7 +55,7 @@ export const animoOpenId4VcPlaygroundCredentialSdJwtVcJwk = {

export const animoOpenId4VcPlaygroundCredentialJwtVc = {
id: "AnimoOpenId4VcPlayground",
format: OpenIdCredentialFormatProfile.JwtVcJson,
format: OpenId4VciCredentialFormatProfile.JwtVcJson,
types: ["AnimoOpenId4VcPlayground"],
cryptographic_binding_methods_supported: ["did:key", "did:jwk"],
cryptographic_suites_supported: [JwaSignatureAlgorithm.EdDSA],
Expand Down
3 changes: 2 additions & 1 deletion app/components/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ export function Main() {
<AlertTitle>Warning</AlertTitle>
<AlertDescription>
Currently, only issuance of JWT credentials (not SD-JWT
credentials) is supported when issuing to the{" "}
credentials) using a did method other than{" "}
<code>did:cheqd</code> is supported when issuing to the{" "}
<a
className="underline"
href="https://linktr.ee/paradym_id"
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cb55590

Please sign in to comment.