Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Tate <[email protected]>
  • Loading branch information
Ryanmtate committed Dec 6, 2024
1 parent e94aa52 commit 1c341f0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ yourself.
```rust
use static_iref::uri;
use serde::{Serialize, Deserialize};
use ssi::claims::vc::syntax::NonEmptyVec;
use ssi::prelude::*;

// Defines the shape of our custom claims.
Expand All @@ -183,10 +184,10 @@ let credential = ssi::claims::vc::v1::JsonCredential::<MyCredentialSubject>::new
Some(uri!("https://example.org/#CredentialId").to_owned()), // id
uri!("https://example.org/#Issuer").to_owned().into(), // issuer
DateTime::now(), // issuance date
vec![MyCredentialSubject {
NonEmptyVec::new(MyCredentialSubject {
name: "John Smith".to_owned(),
email: "[email protected]".to_owned()
}]
})
);

// Create a random signing key, and turn its public part into a DID URL.
Expand Down Expand Up @@ -216,7 +217,7 @@ let vc = cryptosuite.sign(
ProofOptions::from_method(verification_method)
).await.expect("signature failed");
```

It is critical that custom claims can be interpreted as Linked-Data. In
the above example this is done by specifying a serialization URL for each
field of `MyCredentialSubject`. This can also be done by creating a custom
Expand Down

0 comments on commit 1c341f0

Please sign in to comment.