-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #271 from DSRCorporation/anoncreds-wc3
AnonCreds Credentials using the W3C Standard - implementation
- Loading branch information
Showing
41 changed files
with
6,224 additions
and
1,773 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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use once_cell::sync::Lazy; | ||
use std::collections::HashSet; | ||
|
||
use crate::data_types::w3c::credential::{Contexts, Types}; | ||
use crate::data_types::w3c::uri::URI; | ||
|
||
// Contexts | ||
pub const W3C_CONTEXT: &str = "https://www.w3.org/2018/credentials/v1"; | ||
pub const W3C_ANONCREDS_CONTEXT: &str = "https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"; | ||
|
||
// Types | ||
pub const W3C_CREDENTIAL_TYPE: &str = "VerifiableCredential"; | ||
pub const W3C_PRESENTATION_TYPE: &str = "VerifiablePresentation"; | ||
pub const W3C_ANONCREDS_CREDENTIAL_TYPE: &str = "AnonCredsCredential"; | ||
pub const W3C_ANONCREDS_PRESENTATION_TYPE: &str = "AnonCredsPresentation"; | ||
|
||
pub(crate) static ANONCREDS_CONTEXTS: Lazy<Contexts> = Lazy::new(|| { | ||
Contexts(HashSet::from([ | ||
URI::from(W3C_CONTEXT), | ||
URI::from(W3C_ANONCREDS_CONTEXT), | ||
])) | ||
}); | ||
|
||
pub(crate) static ANONCREDS_CREDENTIAL_TYPES: Lazy<Types> = Lazy::new(|| { | ||
Types(HashSet::from([ | ||
String::from(W3C_CREDENTIAL_TYPE), | ||
String::from(W3C_ANONCREDS_CREDENTIAL_TYPE), | ||
])) | ||
}); | ||
|
||
pub(crate) static ANONCREDS_PRESENTATION_TYPES: Lazy<Types> = Lazy::new(|| { | ||
Types(HashSet::from([ | ||
String::from(W3C_PRESENTATION_TYPE), | ||
String::from(W3C_ANONCREDS_PRESENTATION_TYPE), | ||
])) | ||
}); |
Oops, something went wrong.