mirror of https://github.com/breard-r/acmed.git
Rodolphe Breard
5 years ago
5 changed files with 38 additions and 69 deletions
-
59acme_common/src/crypto/openssl_keys.rs
-
4acmed/src/acme_proto/structs/authorization.rs
-
6acmed/src/jws.rs
-
7acmed/src/jws/algorithms.rs
-
31acmed/src/jws/jwk.rs
@ -1,31 +0,0 @@ |
|||
use serde::Serialize;
|
|||
|
|||
#[derive(Serialize)]
|
|||
#[serde(untagged)]
|
|||
pub enum Jwk {
|
|||
Es256(Es256Jwk),
|
|||
}
|
|||
|
|||
#[derive(Serialize)]
|
|||
pub struct Es256Jwk {
|
|||
kty: String,
|
|||
#[serde(rename = "use")]
|
|||
jwk_use: String,
|
|||
crv: String,
|
|||
alg: String,
|
|||
x: String,
|
|||
y: String,
|
|||
}
|
|||
|
|||
impl Es256Jwk {
|
|||
pub fn new(x: &str, y: &str) -> Self {
|
|||
Es256Jwk {
|
|||
kty: "EC".into(),
|
|||
jwk_use: "sig".into(),
|
|||
crv: "P-256".into(),
|
|||
alg: "ES256".into(),
|
|||
x: x.to_string(),
|
|||
y: y.to_string(),
|
|||
}
|
|||
}
|
|||
}
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue