pub struct JsonWebKey {
pub id: Id,
pub public_key: String,
pub private_key: String,
pub created_at: OffsetDateTime,
pub expires_at: Option<OffsetDateTime>,
pub alg: Option<String>,
pub crv: Option<String>,
}Expand description
A row of jwks: one signing key pair. The public half is a JWK as JSON; the private half
is a PKCS#8 key encrypted with the app secret (XChaCha20-Poly1305 under a key derived
from it), so a database dump alone can’t mint tokens.
Fields§
§id: IdAlso the kid of the key and of every token it signs.
public_key: StringThe public JWK, as JSON: {"kty":"OKP","crv":"Ed25519","x":"..."}.
private_key: StringThe encrypted private key, base64url.
created_at: OffsetDateTime§expires_at: Option<OffsetDateTime>After this the key no longer signs; the JWKS keeps listing it for the grace period.
alg: Option<String>EdDSA, ES256 or RS256.
crv: Option<String>Ed25519 or P-256; none for RSA.
Implementations§
Source§impl JsonWebKey
impl JsonWebKey
Sourcepub const ID: Col<JsonWebKey, Id>
pub const ID: Col<JsonWebKey, Id>
Also the kid of the key and of every token it signs.
Sourcepub const PUBLIC_KEY: Col<JsonWebKey, String>
pub const PUBLIC_KEY: Col<JsonWebKey, String>
The public JWK, as JSON: {"kty":"OKP","crv":"Ed25519","x":"..."}.
Sourcepub const PRIVATE_KEY: Col<JsonWebKey, String>
pub const PRIVATE_KEY: Col<JsonWebKey, String>
The encrypted private key, base64url.
Sourcepub const CREATED_AT: Col<JsonWebKey, OffsetDateTime>
pub const CREATED_AT: Col<JsonWebKey, OffsetDateTime>
The created_at column.
Sourcepub const EXPIRES_AT: Col<JsonWebKey, Option<OffsetDateTime>>
pub const EXPIRES_AT: Col<JsonWebKey, Option<OffsetDateTime>>
After this the key no longer signs; the JWKS keeps listing it for the grace period.