Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improve didcore VerificationMethod in-memory representation #1170

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion did_core/did_doc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ did_parser_nom = { path = "../did_parser_nom" }
public_key = { path = "../public_key" }
hex = "0.4.3"
multibase = "0.9.1"
pem = "2.0.1"
pem = { version = "2.0.1", features = ["serde"] }
serde = { version = "1.0.159", default-features = false, features = ["derive"] }
serde_json = "1.0.95"
uniresid = { version = "0.1.4", default-features = false, features = ["serde"] }
Expand Down
5 changes: 4 additions & 1 deletion did_core/did_doc/src/schema/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ use crate::schema::{
verification_method::{VerificationMethod, VerificationMethodType},
};

use super::verification_method::PublicKeyFormat;

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, display_as_json::Display)]
#[serde(deny_unknown_fields)]
pub struct LegacyDidDoc {
Expand Down Expand Up @@ -162,8 +164,9 @@ fn construct_new_did_document(
id,
did.clone(),
VerificationMethodType::Ed25519VerificationKey2018,
PublicKeyFormat::Multibase(multibase::Base::Base58Btc),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaking the implementation details to the upper layer. Can we even reliably determine the key format at this point?

)
.add_public_key_multibase(fingerprint.clone())
.add_public_key(fingerprint.clone().as_bytes().to_vec())
.build(),
);
}
Expand Down
Loading