aboutsummaryrefslogtreecommitdiffstats
path: root/adenosine-pds/src/did.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-11-03 16:41:15 -0700
committerBryan Newbold <bnewbold@robocracy.org>2022-11-03 16:41:15 -0700
commit59622a58131789b450b1a7b920a6324a4f75f5eb (patch)
treed537d9c54e4cdc56e6b9d970b92280a0025289c0 /adenosine-pds/src/did.rs
parent9b4a5c6bfd2b816fc9b281bdd12e67a0e0245f4c (diff)
downloadadenosine-59622a58131789b450b1a7b920a6324a4f75f5eb.tar.gz
adenosine-59622a58131789b450b1a7b920a6324a4f75f5eb.zip
pds: progress on account creation
Diffstat (limited to 'adenosine-pds/src/did.rs')
-rw-r--r--adenosine-pds/src/did.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/adenosine-pds/src/did.rs b/adenosine-pds/src/did.rs
index f33f512..109a717 100644
--- a/adenosine-pds/src/did.rs
+++ b/adenosine-pds/src/did.rs
@@ -12,7 +12,7 @@ use serde_json::json;
#[allow(non_snake_case)]
#[derive(Debug, DagCbor, PartialEq, Eq, Clone)]
-struct CreateOp {
+pub struct CreateOp {
#[ipld(rename = "type")]
pub op_type: String,
pub signingKey: String,
@@ -50,7 +50,7 @@ impl UnsignedCreateOp {
}
impl CreateOp {
- fn new(
+ pub fn new(
username: String,
atp_pds: String,
keypair: &KeyPair,
@@ -72,7 +72,7 @@ impl CreateOp {
unsigned.into_signed(sig)
}
- fn did_plc(&self) -> String {
+ pub fn did_plc(&self) -> String {
// dump DAG-CBOR
let block = Block::<DefaultParams>::encode(DagCborCodec, Code::Sha2_256, self)
.expect("encode DAG-CBOR");
@@ -89,7 +89,7 @@ impl CreateOp {
format!("did:plc:{}", &digest_b32[0..24])
}
- fn did_doc(&self) -> serde_json::Value {
+ pub fn did_doc(&self) -> serde_json::Value {
let did = self.did_plc();
// TODO:
let user_url = format!("https://{}.test", self.username);
@@ -140,7 +140,7 @@ impl CreateOp {
}
/// This method only makes sense on the "genesis" create object
- fn verify_self(&self) -> Result<()> {
+ pub fn verify_self(&self) -> Result<()> {
let key = PubKey::from_did_key(&self.signingKey)?;
let unsigned = {
let cpy = (*self).clone();