@sphereon/ssi-sdk.kms-rest-client 0.34.1-feature.IDK.11.294

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +369 -0
  3. package/dist/index.cjs +3924 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +3927 -0
  6. package/dist/index.d.ts +3927 -0
  7. package/dist/index.js +3903 -0
  8. package/dist/index.js.map +1 -0
  9. package/package.json +60 -0
  10. package/plugin.schema.json +1004 -0
  11. package/src/agent/KmsRestClient.ts +468 -0
  12. package/src/index.ts +8 -0
  13. package/src/models/AwsAssumeRoleCredentials.ts +90 -0
  14. package/src/models/AwsClientConfiguration.ts +69 -0
  15. package/src/models/AwsKmsSetting.ts +112 -0
  16. package/src/models/AwsStaticCredentials.ts +90 -0
  17. package/src/models/AwsWebIdentityTokenCredentials.ts +91 -0
  18. package/src/models/AzureClientSecretCredentialOpts.ts +85 -0
  19. package/src/models/AzureCredentialOpts.ts +65 -0
  20. package/src/models/AzureKeyVaultSetting.ts +101 -0
  21. package/src/models/CoseKey.ts +137 -0
  22. package/src/models/CoseKeyPair.ts +73 -0
  23. package/src/models/CoseKeyType.ts +52 -0
  24. package/src/models/CreateKeyProvider.ts +101 -0
  25. package/src/models/CreateRawSignature.ts +74 -0
  26. package/src/models/CreateRawSignatureResponse.ts +62 -0
  27. package/src/models/CreateSimpleSignature.ts +86 -0
  28. package/src/models/CryptoAlg.ts +52 -0
  29. package/src/models/Curve.ts +56 -0
  30. package/src/models/DigestAlg.ts +55 -0
  31. package/src/models/ErrorResponse.ts +79 -0
  32. package/src/models/GenerateKey.ts +92 -0
  33. package/src/models/GenerateKeyGlobal.ts +100 -0
  34. package/src/models/GenerateKeyResponse.ts +65 -0
  35. package/src/models/GetKeyResponse.ts +65 -0
  36. package/src/models/IdentifierMethod.ts +53 -0
  37. package/src/models/JoseKeyPair.ts +73 -0
  38. package/src/models/Jwk.ts +231 -0
  39. package/src/models/JwkKeyType.ts +52 -0
  40. package/src/models/JwkUse.ts +50 -0
  41. package/src/models/KeyEncoding.ts +50 -0
  42. package/src/models/KeyInfo.ts +144 -0
  43. package/src/models/KeyOperations.ts +56 -0
  44. package/src/models/KeyProvider.ts +74 -0
  45. package/src/models/KeyProviderResponse.ts +74 -0
  46. package/src/models/KeyProviderType.ts +51 -0
  47. package/src/models/KeyResolver.ts +85 -0
  48. package/src/models/KeyType.ts +51 -0
  49. package/src/models/KeyVisibility.ts +50 -0
  50. package/src/models/ListKeyProvidersResponse.ts +65 -0
  51. package/src/models/ListKeysResponse.ts +65 -0
  52. package/src/models/ListResolversResponse.ts +65 -0
  53. package/src/models/LookupMode.ts +51 -0
  54. package/src/models/ManagedKeyInfo.ts +147 -0
  55. package/src/models/ManagedKeyPair.ts +102 -0
  56. package/src/models/MaskGenFunction.ts +49 -0
  57. package/src/models/ProviderCapabilities.ts +106 -0
  58. package/src/models/ResolvePublicKey.ts +91 -0
  59. package/src/models/ResolvedKeyInfo.ts +145 -0
  60. package/src/models/Resolver.ts +85 -0
  61. package/src/models/SignInput.ts +87 -0
  62. package/src/models/SignOutput.ts +73 -0
  63. package/src/models/Signature.ts +92 -0
  64. package/src/models/SignatureAlgorithm.ts +60 -0
  65. package/src/models/StoreKey.ts +73 -0
  66. package/src/models/StoreKeyResponse.ts +65 -0
  67. package/src/models/UpdateKeyProvider.ts +90 -0
  68. package/src/models/VerifyRawSignature.ts +83 -0
  69. package/src/models/VerifyRawSignatureResponse.ts +62 -0
  70. package/src/models/VerifySimpleSignature.ts +76 -0
  71. package/src/models/index.ts +60 -0
  72. package/src/types/IKmsRestClient.ts +134 -0
@@ -0,0 +1,92 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * KMS REST Server API
5
+ * A REST API for managing cryptographic keys and performing signing and verification operations.
6
+ *
7
+ * The version of the OpenAPI document: 0.0.1
8
+ * Contact: support@sphereon.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import type { KeyOperations } from './KeyOperations'
16
+ import { KeyOperationsFromJSON, KeyOperationsToJSON } from './KeyOperations'
17
+ import type { SignatureAlgorithm } from './SignatureAlgorithm'
18
+ import { SignatureAlgorithmFromJSON, SignatureAlgorithmToJSON } from './SignatureAlgorithm'
19
+ import type { JwkUse } from './JwkUse'
20
+ import { JwkUseFromJSON, JwkUseToJSON } from './JwkUse'
21
+
22
+ /**
23
+ * Parameters for key generation.
24
+ * @export
25
+ * @interface GenerateKey
26
+ */
27
+ export interface GenerateKey {
28
+ /**
29
+ * Alias for the generated key.
30
+ * @type {string}
31
+ * @memberof GenerateKey
32
+ */
33
+ alias?: string
34
+ /**
35
+ *
36
+ * @type {JwkUse}
37
+ * @memberof GenerateKey
38
+ */
39
+ use?: JwkUse
40
+ /**
41
+ *
42
+ * @type {Array<KeyOperations>}
43
+ * @memberof GenerateKey
44
+ */
45
+ keyOperations?: Array<KeyOperations>
46
+ /**
47
+ *
48
+ * @type {SignatureAlgorithm}
49
+ * @memberof GenerateKey
50
+ */
51
+ alg?: SignatureAlgorithm
52
+ }
53
+
54
+ /**
55
+ * Check if a given object implements the GenerateKey interface.
56
+ */
57
+ export function instanceOfGenerateKey(value: object): value is GenerateKey {
58
+ return true
59
+ }
60
+
61
+ export function GenerateKeyFromJSON(json: any): GenerateKey {
62
+ return GenerateKeyFromJSONTyped(json, false)
63
+ }
64
+
65
+ export function GenerateKeyFromJSONTyped(json: any, ignoreDiscriminator: boolean): GenerateKey {
66
+ if (json == null) {
67
+ return json
68
+ }
69
+ return {
70
+ alias: json['alias'] == null ? undefined : json['alias'],
71
+ use: json['use'] == null ? undefined : JwkUseFromJSON(json['use']),
72
+ keyOperations: json['keyOperations'] == null ? undefined : (json['keyOperations'] as Array<any>).map(KeyOperationsFromJSON),
73
+ alg: json['alg'] == null ? undefined : SignatureAlgorithmFromJSON(json['alg']),
74
+ }
75
+ }
76
+
77
+ export function GenerateKeyToJSON(json: any): GenerateKey {
78
+ return GenerateKeyToJSONTyped(json, false)
79
+ }
80
+
81
+ export function GenerateKeyToJSONTyped(value?: GenerateKey | null, ignoreDiscriminator: boolean = false): any {
82
+ if (value == null) {
83
+ return value
84
+ }
85
+
86
+ return {
87
+ alias: value['alias'],
88
+ use: JwkUseToJSON(value['use']),
89
+ keyOperations: value['keyOperations'] == null ? undefined : (value['keyOperations'] as Array<any>).map(KeyOperationsToJSON),
90
+ alg: SignatureAlgorithmToJSON(value['alg']),
91
+ }
92
+ }
@@ -0,0 +1,100 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * KMS REST Server API
5
+ * A REST API for managing cryptographic keys and performing signing and verification operations.
6
+ *
7
+ * The version of the OpenAPI document: 0.0.1
8
+ * Contact: support@sphereon.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import type { KeyOperations } from './KeyOperations'
16
+ import { KeyOperationsFromJSON, KeyOperationsToJSON } from './KeyOperations'
17
+ import type { SignatureAlgorithm } from './SignatureAlgorithm'
18
+ import { SignatureAlgorithmFromJSON, SignatureAlgorithmToJSON } from './SignatureAlgorithm'
19
+ import type { JwkUse } from './JwkUse'
20
+ import { JwkUseFromJSON, JwkUseToJSON } from './JwkUse'
21
+
22
+ /**
23
+ * Parameters for global key generation with optional provider specification.
24
+ * @export
25
+ * @interface GenerateKeyGlobal
26
+ */
27
+ export interface GenerateKeyGlobal {
28
+ /**
29
+ * Alias for the generated key.
30
+ * @type {string}
31
+ * @memberof GenerateKeyGlobal
32
+ */
33
+ alias?: string
34
+ /**
35
+ *
36
+ * @type {JwkUse}
37
+ * @memberof GenerateKeyGlobal
38
+ */
39
+ use?: JwkUse
40
+ /**
41
+ *
42
+ * @type {Array<KeyOperations>}
43
+ * @memberof GenerateKeyGlobal
44
+ */
45
+ keyOperations?: Array<KeyOperations>
46
+ /**
47
+ *
48
+ * @type {SignatureAlgorithm}
49
+ * @memberof GenerateKeyGlobal
50
+ */
51
+ alg?: SignatureAlgorithm
52
+ /**
53
+ * Optional provider ID. If not specified, the default provider will be used.
54
+ * @type {string}
55
+ * @memberof GenerateKeyGlobal
56
+ */
57
+ providerId?: string
58
+ }
59
+
60
+ /**
61
+ * Check if a given object implements the GenerateKeyGlobal interface.
62
+ */
63
+ export function instanceOfGenerateKeyGlobal(value: object): value is GenerateKeyGlobal {
64
+ return true
65
+ }
66
+
67
+ export function GenerateKeyGlobalFromJSON(json: any): GenerateKeyGlobal {
68
+ return GenerateKeyGlobalFromJSONTyped(json, false)
69
+ }
70
+
71
+ export function GenerateKeyGlobalFromJSONTyped(json: any, ignoreDiscriminator: boolean): GenerateKeyGlobal {
72
+ if (json == null) {
73
+ return json
74
+ }
75
+ return {
76
+ alias: json['alias'] == null ? undefined : json['alias'],
77
+ use: json['use'] == null ? undefined : JwkUseFromJSON(json['use']),
78
+ keyOperations: json['keyOperations'] == null ? undefined : (json['keyOperations'] as Array<any>).map(KeyOperationsFromJSON),
79
+ alg: json['alg'] == null ? undefined : SignatureAlgorithmFromJSON(json['alg']),
80
+ providerId: json['providerId'] == null ? undefined : json['providerId'],
81
+ }
82
+ }
83
+
84
+ export function GenerateKeyGlobalToJSON(json: any): GenerateKeyGlobal {
85
+ return GenerateKeyGlobalToJSONTyped(json, false)
86
+ }
87
+
88
+ export function GenerateKeyGlobalToJSONTyped(value?: GenerateKeyGlobal | null, ignoreDiscriminator: boolean = false): any {
89
+ if (value == null) {
90
+ return value
91
+ }
92
+
93
+ return {
94
+ alias: value['alias'],
95
+ use: JwkUseToJSON(value['use']),
96
+ keyOperations: value['keyOperations'] == null ? undefined : (value['keyOperations'] as Array<any>).map(KeyOperationsToJSON),
97
+ alg: SignatureAlgorithmToJSON(value['alg']),
98
+ providerId: value['providerId'],
99
+ }
100
+ }
@@ -0,0 +1,65 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * KMS REST Server API
5
+ * A REST API for managing cryptographic keys and performing signing and verification operations.
6
+ *
7
+ * The version of the OpenAPI document: 0.0.1
8
+ * Contact: support@sphereon.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import type { ManagedKeyPair } from './ManagedKeyPair'
16
+ import { ManagedKeyPairFromJSON, ManagedKeyPairToJSON } from './ManagedKeyPair'
17
+
18
+ /**
19
+ * Response body containing a generated key pair.
20
+ * @export
21
+ * @interface GenerateKeyResponse
22
+ */
23
+ export interface GenerateKeyResponse {
24
+ /**
25
+ *
26
+ * @type {ManagedKeyPair}
27
+ * @memberof GenerateKeyResponse
28
+ */
29
+ keyPair: ManagedKeyPair
30
+ }
31
+
32
+ /**
33
+ * Check if a given object implements the GenerateKeyResponse interface.
34
+ */
35
+ export function instanceOfGenerateKeyResponse(value: object): value is GenerateKeyResponse {
36
+ if (!('keyPair' in value) || value['keyPair'] === undefined) return false
37
+ return true
38
+ }
39
+
40
+ export function GenerateKeyResponseFromJSON(json: any): GenerateKeyResponse {
41
+ return GenerateKeyResponseFromJSONTyped(json, false)
42
+ }
43
+
44
+ export function GenerateKeyResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GenerateKeyResponse {
45
+ if (json == null) {
46
+ return json
47
+ }
48
+ return {
49
+ keyPair: ManagedKeyPairFromJSON(json['keyPair']),
50
+ }
51
+ }
52
+
53
+ export function GenerateKeyResponseToJSON(json: any): GenerateKeyResponse {
54
+ return GenerateKeyResponseToJSONTyped(json, false)
55
+ }
56
+
57
+ export function GenerateKeyResponseToJSONTyped(value?: GenerateKeyResponse | null, ignoreDiscriminator: boolean = false): any {
58
+ if (value == null) {
59
+ return value
60
+ }
61
+
62
+ return {
63
+ keyPair: ManagedKeyPairToJSON(value['keyPair']),
64
+ }
65
+ }
@@ -0,0 +1,65 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * KMS REST Server API
5
+ * A REST API for managing cryptographic keys and performing signing and verification operations.
6
+ *
7
+ * The version of the OpenAPI document: 0.0.1
8
+ * Contact: support@sphereon.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import type { ManagedKeyInfo } from './ManagedKeyInfo'
16
+ import { ManagedKeyInfoFromJSON, ManagedKeyInfoToJSON } from './ManagedKeyInfo'
17
+
18
+ /**
19
+ * Response body containing a managed key.
20
+ * @export
21
+ * @interface GetKeyResponse
22
+ */
23
+ export interface GetKeyResponse {
24
+ /**
25
+ *
26
+ * @type {ManagedKeyInfo}
27
+ * @memberof GetKeyResponse
28
+ */
29
+ keyInfo: ManagedKeyInfo
30
+ }
31
+
32
+ /**
33
+ * Check if a given object implements the GetKeyResponse interface.
34
+ */
35
+ export function instanceOfGetKeyResponse(value: object): value is GetKeyResponse {
36
+ if (!('keyInfo' in value) || value['keyInfo'] === undefined) return false
37
+ return true
38
+ }
39
+
40
+ export function GetKeyResponseFromJSON(json: any): GetKeyResponse {
41
+ return GetKeyResponseFromJSONTyped(json, false)
42
+ }
43
+
44
+ export function GetKeyResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetKeyResponse {
45
+ if (json == null) {
46
+ return json
47
+ }
48
+ return {
49
+ keyInfo: ManagedKeyInfoFromJSON(json['keyInfo']),
50
+ }
51
+ }
52
+
53
+ export function GetKeyResponseToJSON(json: any): GetKeyResponse {
54
+ return GetKeyResponseToJSONTyped(json, false)
55
+ }
56
+
57
+ export function GetKeyResponseToJSONTyped(value?: GetKeyResponse | null, ignoreDiscriminator: boolean = false): any {
58
+ if (value == null) {
59
+ return value
60
+ }
61
+
62
+ return {
63
+ keyInfo: ManagedKeyInfoToJSON(value['keyInfo']),
64
+ }
65
+ }
@@ -0,0 +1,53 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * KMS REST Server API
5
+ * A REST API for managing cryptographic keys and performing signing and verification operations.
6
+ *
7
+ * The version of the OpenAPI document: 0.0.1
8
+ * Contact: support@sphereon.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ /**
16
+ * Method used to identify cryptographic keys.
17
+ * @export
18
+ */
19
+ export const IdentifierMethod = {
20
+ Jwk: 'JWK',
21
+ Kid: 'KID',
22
+ CoseKey: 'COSE_KEY',
23
+ X5C: 'X5C',
24
+ Did: 'DID',
25
+ } as const
26
+ export type IdentifierMethod = (typeof IdentifierMethod)[keyof typeof IdentifierMethod]
27
+
28
+ export function instanceOfIdentifierMethod(value: any): boolean {
29
+ for (const key in IdentifierMethod) {
30
+ if (Object.prototype.hasOwnProperty.call(IdentifierMethod, key)) {
31
+ if (IdentifierMethod[key as keyof typeof IdentifierMethod] === value) {
32
+ return true
33
+ }
34
+ }
35
+ }
36
+ return false
37
+ }
38
+
39
+ export function IdentifierMethodFromJSON(json: any): IdentifierMethod {
40
+ return IdentifierMethodFromJSONTyped(json, false)
41
+ }
42
+
43
+ export function IdentifierMethodFromJSONTyped(json: any, ignoreDiscriminator: boolean): IdentifierMethod {
44
+ return json as IdentifierMethod
45
+ }
46
+
47
+ export function IdentifierMethodToJSON(value?: IdentifierMethod | null): any {
48
+ return value as any
49
+ }
50
+
51
+ export function IdentifierMethodToJSONTyped(value: any, ignoreDiscriminator: boolean): IdentifierMethod {
52
+ return value as IdentifierMethod
53
+ }
@@ -0,0 +1,73 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * KMS REST Server API
5
+ * A REST API for managing cryptographic keys and performing signing and verification operations.
6
+ *
7
+ * The version of the OpenAPI document: 0.0.1
8
+ * Contact: support@sphereon.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import type { Jwk } from './Jwk'
16
+ import { JwkFromJSON, JwkToJSON } from './Jwk'
17
+
18
+ /**
19
+ * Data class representing a cryptographic key pair used with JOSE (JSON Object Signing and Encryption).
20
+ * @export
21
+ * @interface JoseKeyPair
22
+ */
23
+ export interface JoseKeyPair {
24
+ /**
25
+ *
26
+ * @type {Jwk}
27
+ * @memberof JoseKeyPair
28
+ */
29
+ privateJwk?: Jwk
30
+ /**
31
+ *
32
+ * @type {Jwk}
33
+ * @memberof JoseKeyPair
34
+ */
35
+ publicJwk: Jwk
36
+ }
37
+
38
+ /**
39
+ * Check if a given object implements the JoseKeyPair interface.
40
+ */
41
+ export function instanceOfJoseKeyPair(value: object): value is JoseKeyPair {
42
+ if (!('publicJwk' in value) || value['publicJwk'] === undefined) return false
43
+ return true
44
+ }
45
+
46
+ export function JoseKeyPairFromJSON(json: any): JoseKeyPair {
47
+ return JoseKeyPairFromJSONTyped(json, false)
48
+ }
49
+
50
+ export function JoseKeyPairFromJSONTyped(json: any, ignoreDiscriminator: boolean): JoseKeyPair {
51
+ if (json == null) {
52
+ return json
53
+ }
54
+ return {
55
+ privateJwk: json['privateJwk'] == null ? undefined : JwkFromJSON(json['privateJwk']),
56
+ publicJwk: JwkFromJSON(json['publicJwk']),
57
+ }
58
+ }
59
+
60
+ export function JoseKeyPairToJSON(json: any): JoseKeyPair {
61
+ return JoseKeyPairToJSONTyped(json, false)
62
+ }
63
+
64
+ export function JoseKeyPairToJSONTyped(value?: JoseKeyPair | null, ignoreDiscriminator: boolean = false): any {
65
+ if (value == null) {
66
+ return value
67
+ }
68
+
69
+ return {
70
+ privateJwk: JwkToJSON(value['privateJwk']),
71
+ publicJwk: JwkToJSON(value['publicJwk']),
72
+ }
73
+ }
@@ -0,0 +1,231 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * KMS REST Server API
5
+ * A REST API for managing cryptographic keys and performing signing and verification operations.
6
+ *
7
+ * The version of the OpenAPI document: 0.0.1
8
+ * Contact: support@sphereon.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import type { Curve } from './Curve'
16
+ import { CurveFromJSON, CurveToJSON } from './Curve'
17
+ import type { KeyOperations } from './KeyOperations'
18
+ import { KeyOperationsFromJSON, KeyOperationsToJSON } from './KeyOperations'
19
+ import type { JwkUse } from './JwkUse'
20
+ import { JwkUseFromJSON, JwkUseToJSON } from './JwkUse'
21
+ import type { JwkKeyType } from './JwkKeyType'
22
+ import { JwkKeyTypeFromJSON, JwkKeyTypeToJSON } from './JwkKeyType'
23
+
24
+ /**
25
+ * Represents a JSON Web Key (JWK) as defined by the JSON Web Key specification.
26
+ * @export
27
+ * @interface Jwk
28
+ */
29
+ export interface Jwk {
30
+ /**
31
+ *
32
+ * @type {JwkKeyType}
33
+ * @memberof Jwk
34
+ */
35
+ kty: JwkKeyType
36
+ /**
37
+ * Key identifier used to uniquely identify the key.
38
+ * @type {string}
39
+ * @memberof Jwk
40
+ */
41
+ kid?: string
42
+ /**
43
+ * The algorithm intended for use with the key (JWA algorithm name).
44
+ * @type {string}
45
+ * @memberof Jwk
46
+ */
47
+ alg?: string
48
+ /**
49
+ *
50
+ * @type {JwkUse}
51
+ * @memberof Jwk
52
+ */
53
+ use?: JwkUse
54
+ /**
55
+ * The allowed cryptographic operations for the key.
56
+ * @type {Array<KeyOperations>}
57
+ * @memberof Jwk
58
+ */
59
+ keyOps?: Array<KeyOperations>
60
+ /**
61
+ *
62
+ * @type {Curve}
63
+ * @memberof Jwk
64
+ */
65
+ crv?: Curve
66
+ /**
67
+ * The x coordinate for elliptic curve keys (base64url-encoded).
68
+ * @type {string}
69
+ * @memberof Jwk
70
+ */
71
+ x?: string
72
+ /**
73
+ * The y coordinate for elliptic curve keys (base64url-encoded).
74
+ * @type {string}
75
+ * @memberof Jwk
76
+ */
77
+ y?: string
78
+ /**
79
+ * The private key parameter (base64url-encoded).
80
+ * @type {string}
81
+ * @memberof Jwk
82
+ */
83
+ d?: string
84
+ /**
85
+ * The modulus value for RSA keys (base64url-encoded).
86
+ * @type {string}
87
+ * @memberof Jwk
88
+ */
89
+ n?: string
90
+ /**
91
+ * The public exponent for RSA keys (base64url-encoded).
92
+ * @type {string}
93
+ * @memberof Jwk
94
+ */
95
+ e?: string
96
+ /**
97
+ * The first prime factor for RSA private keys (base64url-encoded).
98
+ * @type {string}
99
+ * @memberof Jwk
100
+ */
101
+ p?: string
102
+ /**
103
+ * The second prime factor for RSA private keys (base64url-encoded).
104
+ * @type {string}
105
+ * @memberof Jwk
106
+ */
107
+ q?: string
108
+ /**
109
+ * The first factor CRT exponent for RSA private keys (base64url-encoded).
110
+ * @type {string}
111
+ * @memberof Jwk
112
+ */
113
+ dp?: string
114
+ /**
115
+ * The second factor CRT exponent for RSA private keys (base64url-encoded).
116
+ * @type {string}
117
+ * @memberof Jwk
118
+ */
119
+ dq?: string
120
+ /**
121
+ * The first CRT coefficient for RSA private keys (base64url-encoded).
122
+ * @type {string}
123
+ * @memberof Jwk
124
+ */
125
+ qi?: string
126
+ /**
127
+ * The symmetric key value (base64url-encoded).
128
+ * @type {string}
129
+ * @memberof Jwk
130
+ */
131
+ k?: string
132
+ /**
133
+ * X.509 certificate chain as base64-encoded DER certificates.
134
+ * @type {Array<string>}
135
+ * @memberof Jwk
136
+ */
137
+ x5c?: Array<string>
138
+ /**
139
+ * X.509 certificate SHA-1 thumbprint (base64url-encoded).
140
+ * @type {string}
141
+ * @memberof Jwk
142
+ */
143
+ x5t?: string
144
+ /**
145
+ * URL pointing to X.509 certificate or certificate chain.
146
+ * @type {string}
147
+ * @memberof Jwk
148
+ */
149
+ x5u?: string
150
+ /**
151
+ * X.509 certificate SHA-256 thumbprint (base64url-encoded).
152
+ * @type {string}
153
+ * @memberof Jwk
154
+ */
155
+ x5tS256?: string
156
+ }
157
+
158
+ /**
159
+ * Check if a given object implements the Jwk interface.
160
+ */
161
+ export function instanceOfJwk(value: object): value is Jwk {
162
+ if (!('kty' in value) || value['kty'] === undefined) return false
163
+ return true
164
+ }
165
+
166
+ export function JwkFromJSON(json: any): Jwk {
167
+ return JwkFromJSONTyped(json, false)
168
+ }
169
+
170
+ export function JwkFromJSONTyped(json: any, ignoreDiscriminator: boolean): Jwk {
171
+ if (json == null) {
172
+ return json
173
+ }
174
+ return {
175
+ kty: JwkKeyTypeFromJSON(json['kty']),
176
+ kid: json['kid'] == null ? undefined : json['kid'],
177
+ alg: json['alg'] == null ? undefined : json['alg'],
178
+ use: json['use'] == null ? undefined : JwkUseFromJSON(json['use']),
179
+ keyOps: json['key_ops'] == null ? undefined : (json['key_ops'] as Array<any>).map(KeyOperationsFromJSON),
180
+ crv: json['crv'] == null ? undefined : CurveFromJSON(json['crv']),
181
+ x: json['x'] == null ? undefined : json['x'],
182
+ y: json['y'] == null ? undefined : json['y'],
183
+ d: json['d'] == null ? undefined : json['d'],
184
+ n: json['n'] == null ? undefined : json['n'],
185
+ e: json['e'] == null ? undefined : json['e'],
186
+ p: json['p'] == null ? undefined : json['p'],
187
+ q: json['q'] == null ? undefined : json['q'],
188
+ dp: json['dp'] == null ? undefined : json['dp'],
189
+ dq: json['dq'] == null ? undefined : json['dq'],
190
+ qi: json['qi'] == null ? undefined : json['qi'],
191
+ k: json['k'] == null ? undefined : json['k'],
192
+ x5c: json['x5c'] == null ? undefined : json['x5c'],
193
+ x5t: json['x5t'] == null ? undefined : json['x5t'],
194
+ x5u: json['x5u'] == null ? undefined : json['x5u'],
195
+ x5tS256: json['x5t#S256'] == null ? undefined : json['x5t#S256'],
196
+ }
197
+ }
198
+
199
+ export function JwkToJSON(json: any): Jwk {
200
+ return JwkToJSONTyped(json, false)
201
+ }
202
+
203
+ export function JwkToJSONTyped(value?: Jwk | null, ignoreDiscriminator: boolean = false): any {
204
+ if (value == null) {
205
+ return value
206
+ }
207
+
208
+ return {
209
+ kty: JwkKeyTypeToJSON(value['kty']),
210
+ kid: value['kid'],
211
+ alg: value['alg'],
212
+ use: JwkUseToJSON(value['use']),
213
+ key_ops: value['keyOps'] == null ? undefined : (value['keyOps'] as Array<any>).map(KeyOperationsToJSON),
214
+ crv: CurveToJSON(value['crv']),
215
+ x: value['x'],
216
+ y: value['y'],
217
+ d: value['d'],
218
+ n: value['n'],
219
+ e: value['e'],
220
+ p: value['p'],
221
+ q: value['q'],
222
+ dp: value['dp'],
223
+ dq: value['dq'],
224
+ qi: value['qi'],
225
+ k: value['k'],
226
+ x5c: value['x5c'],
227
+ x5t: value['x5t'],
228
+ x5u: value['x5u'],
229
+ 'x5t#S256': value['x5tS256'],
230
+ }
231
+ }