ory_client/models/json_web_key.rs
1/*
2 * Ory APIs
3 *
4 * # Introduction Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. ## SDKs This document describes the APIs available in the Ory Network. The APIs are available as SDKs for the following languages: | Language | Download SDK | Documentation | | -------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------ | | Dart | [pub.dev](https://pub.dev/packages/ory_client) | [README](https://github.com/ory/sdk/blob/master/clients/client/dart/README.md) | | .NET | [nuget.org](https://www.nuget.org/packages/Ory.Client/) | [README](https://github.com/ory/sdk/blob/master/clients/client/dotnet/README.md) | | Elixir | [hex.pm](https://hex.pm/packages/ory_client) | [README](https://github.com/ory/sdk/blob/master/clients/client/elixir/README.md) | | Go | [github.com](https://github.com/ory/client-go) | [README](https://github.com/ory/sdk/blob/master/clients/client/go/README.md) | | Java | [maven.org](https://search.maven.org/artifact/sh.ory/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/java/README.md) | | JavaScript | [npmjs.com](https://www.npmjs.com/package/@ory/client) | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript/README.md) | | JavaScript (With fetch) | [npmjs.com](https://www.npmjs.com/package/@ory/client-fetch) | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript-fetch/README.md) | | PHP | [packagist.org](https://packagist.org/packages/ory/client) | [README](https://github.com/ory/sdk/blob/master/clients/client/php/README.md) | | Python | [pypi.org](https://pypi.org/project/ory-client/) | [README](https://github.com/ory/sdk/blob/master/clients/client/python/README.md) | | Ruby | [rubygems.org](https://rubygems.org/gems/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/ruby/README.md) | | Rust | [crates.io](https://crates.io/crates/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/rust/README.md) |
5 *
6 * The version of the OpenAPI document: v1.22.2
7 * Contact: support@ory.sh
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct JsonWebKey {
16 /// The \"alg\" (algorithm) parameter identifies the algorithm intended for use with the key. The values used should either be registered in the IANA \"JSON Web Signature and Encryption Algorithms\" registry established by [JWA] or be a value that contains a Collision- Resistant Name.
17 #[serde(rename = "alg")]
18 pub alg: String,
19 #[serde(rename = "crv", skip_serializing_if = "Option::is_none")]
20 pub crv: Option<String>,
21 #[serde(rename = "d", skip_serializing_if = "Option::is_none")]
22 pub d: Option<String>,
23 #[serde(rename = "dp", skip_serializing_if = "Option::is_none")]
24 pub dp: Option<String>,
25 #[serde(rename = "dq", skip_serializing_if = "Option::is_none")]
26 pub dq: Option<String>,
27 #[serde(rename = "e", skip_serializing_if = "Option::is_none")]
28 pub e: Option<String>,
29 #[serde(rename = "k", skip_serializing_if = "Option::is_none")]
30 pub k: Option<String>,
31 /// The \"kid\" (key ID) parameter is used to match a specific key. This is used, for instance, to choose among a set of keys within a JWK Set during key rollover. The structure of the \"kid\" value is unspecified. When \"kid\" values are used within a JWK Set, different keys within the JWK Set SHOULD use distinct \"kid\" values. (One example in which different keys might use the same \"kid\" value is if they have different \"kty\" (key type) values but are considered to be equivalent alternatives by the application using them.) The \"kid\" value is a case-sensitive string.
32 #[serde(rename = "kid")]
33 pub kid: String,
34 /// The \"kty\" (key type) parameter identifies the cryptographic algorithm family used with the key, such as \"RSA\" or \"EC\". \"kty\" values should either be registered in the IANA \"JSON Web Key Types\" registry established by [JWA] or be a value that contains a Collision- Resistant Name. The \"kty\" value is a case-sensitive string.
35 #[serde(rename = "kty")]
36 pub kty: String,
37 #[serde(rename = "n", skip_serializing_if = "Option::is_none")]
38 pub n: Option<String>,
39 #[serde(rename = "p", skip_serializing_if = "Option::is_none")]
40 pub p: Option<String>,
41 #[serde(rename = "q", skip_serializing_if = "Option::is_none")]
42 pub q: Option<String>,
43 #[serde(rename = "qi", skip_serializing_if = "Option::is_none")]
44 pub qi: Option<String>,
45 /// Use (\"public key use\") identifies the intended use of the public key. The \"use\" parameter is employed to indicate whether a public key is used for encrypting data or verifying the signature on data. Values are commonly \"sig\" (signature) or \"enc\" (encryption).
46 #[serde(rename = "use")]
47 pub r#use: String,
48 #[serde(rename = "x", skip_serializing_if = "Option::is_none")]
49 pub x: Option<String>,
50 /// The \"x5c\" (X.509 certificate chain) parameter contains a chain of one or more PKIX certificates [RFC5280]. The certificate chain is represented as a JSON array of certificate value strings. Each string in the array is a base64-encoded (Section 4 of [RFC4648] -- not base64url-encoded) DER [ITU.X690.1994] PKIX certificate value. The PKIX certificate containing the key value MUST be the first certificate.
51 #[serde(rename = "x5c", skip_serializing_if = "Option::is_none")]
52 pub x5c: Option<Vec<String>>,
53 #[serde(rename = "y", skip_serializing_if = "Option::is_none")]
54 pub y: Option<String>,
55}
56
57impl JsonWebKey {
58 pub fn new(alg: String, kid: String, kty: String, r#use: String) -> JsonWebKey {
59 JsonWebKey {
60 alg,
61 crv: None,
62 d: None,
63 dp: None,
64 dq: None,
65 e: None,
66 k: None,
67 kid,
68 kty,
69 n: None,
70 p: None,
71 q: None,
72 qi: None,
73 r#use,
74 x: None,
75 x5c: None,
76 y: None,
77 }
78 }
79}
80