-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ryan Tate <[email protected]>
- Loading branch information
Showing
1 changed file
with
4 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
@@ -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. | ||
|
@@ -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 | ||
|