-
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.
use array as preferred for credential types (#628)
* use array as preferred for credential types Signed-off-by: Ryan Tate <[email protected]> Co-Authored-By: Joey Silberman <[email protected]> Signed-off-by: Ryan Tate <[email protected]> * resolve failing cargo test (doctest) Signed-off-by: Ryan Tate <[email protected]> * update readme Signed-off-by: Ryan Tate <[email protected]> * fix eip resolve_vc_issue_verify unit test Signed-off-by: Ryan Tate <[email protected]> * Update crates/claims/crates/vc/Cargo.toml --------- Signed-off-by: Ryan Tate <[email protected]> Co-authored-by: Joey Silberman <[email protected]>
- Loading branch information
1 parent
8edeec1
commit 6e7b3b1
Showing
5 changed files
with
14 additions
and
9 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 | ||
|
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
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
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
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 |
---|---|---|
|
@@ -171,6 +171,7 @@ | |
//! # async fn main() { | ||
//! use static_iref::uri; | ||
//! use serde::{Serialize, Deserialize}; | ||
//! use ssi::claims::vc::syntax::NonEmptyVec; | ||
//! use ssi::prelude::*; | ||
//! | ||
//! // Defines the shape of our custom claims. | ||
|
@@ -187,10 +188,10 @@ | |
//! 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. | ||
|
@@ -221,7 +222,7 @@ | |
//! ).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 | ||
|