Skip to content

Commit

Permalink
Add IC canister signature to JwsAlgorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and przydatek committed May 28, 2024
1 parent f3015f2 commit a1d153d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions identity_jose/src/jws/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ pub enum JwsAlgorithm {
NONE,
/// EdDSA signature algorithms
EdDSA,
/// IC canister signature
IcCs,
}

impl JwsAlgorithm {
Expand All @@ -65,6 +67,7 @@ impl JwsAlgorithm {
Self::ES256K,
Self::NONE,
Self::EdDSA,
Self::IcCs,
];

/// Returns the JWS algorithm as a `str` slice.
Expand All @@ -85,6 +88,7 @@ impl JwsAlgorithm {
Self::ES256K => "ES256K",
Self::NONE => "none",
Self::EdDSA => "EdDSA",
Self::IcCs => "IcCs",
}
}
}
Expand All @@ -109,6 +113,7 @@ impl FromStr for JwsAlgorithm {
"ES256K" => Ok(Self::ES256K),
"none" => Ok(Self::NONE),
"EdDSA" => Ok(Self::EdDSA),
"IcCs" => Ok(Self::IcCs),
_ => Err(Error::JwsAlgorithmParsingError),
}
}
Expand Down

0 comments on commit a1d153d

Please sign in to comment.