@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,106 @@
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 { KeyType } from './KeyType'
16
+ import { KeyTypeFromJSON, KeyTypeToJSON } from './KeyType'
17
+ import type { DigestAlg } from './DigestAlg'
18
+ import { DigestAlgFromJSON, DigestAlgToJSON } from './DigestAlg'
19
+ import type { Curve } from './Curve'
20
+ import { CurveFromJSON, CurveToJSON } from './Curve'
21
+ import type { KeyOperations } from './KeyOperations'
22
+ import { KeyOperationsFromJSON, KeyOperationsToJSON } from './KeyOperations'
23
+ import type { SignatureAlgorithm } from './SignatureAlgorithm'
24
+ import { SignatureAlgorithmFromJSON, SignatureAlgorithmToJSON } from './SignatureAlgorithm'
25
+
26
+ /**
27
+ * Comprehensive information about a provider's cryptographic capabilities.
28
+ * @export
29
+ * @interface ProviderCapabilities
30
+ */
31
+ export interface ProviderCapabilities {
32
+ /**
33
+ * List of key types supported by this provider.
34
+ * @type {Array<KeyType>}
35
+ * @memberof ProviderCapabilities
36
+ */
37
+ keyTypes?: Array<KeyType>
38
+ /**
39
+ * List of signature algorithms supported by this provider.
40
+ * @type {Array<SignatureAlgorithm>}
41
+ * @memberof ProviderCapabilities
42
+ */
43
+ signatureAlgorithms?: Array<SignatureAlgorithm>
44
+ /**
45
+ * List of digest algorithms supported by this provider.
46
+ * @type {Array<DigestAlg>}
47
+ * @memberof ProviderCapabilities
48
+ */
49
+ digests?: Array<DigestAlg>
50
+ /**
51
+ * List of elliptic curves supported by this provider.
52
+ * @type {Array<Curve>}
53
+ * @memberof ProviderCapabilities
54
+ */
55
+ curves?: Array<Curve>
56
+ /**
57
+ * List of key operations supported by this provider.
58
+ * @type {Array<KeyOperations>}
59
+ * @memberof ProviderCapabilities
60
+ */
61
+ keyOperations?: Array<KeyOperations>
62
+ }
63
+
64
+ /**
65
+ * Check if a given object implements the ProviderCapabilities interface.
66
+ */
67
+ export function instanceOfProviderCapabilities(value: object): value is ProviderCapabilities {
68
+ return true
69
+ }
70
+
71
+ export function ProviderCapabilitiesFromJSON(json: any): ProviderCapabilities {
72
+ return ProviderCapabilitiesFromJSONTyped(json, false)
73
+ }
74
+
75
+ export function ProviderCapabilitiesFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProviderCapabilities {
76
+ if (json == null) {
77
+ return json
78
+ }
79
+ return {
80
+ keyTypes: json['keyTypes'] == null ? undefined : (json['keyTypes'] as Array<any>).map(KeyTypeFromJSON),
81
+ signatureAlgorithms:
82
+ json['signatureAlgorithms'] == null ? undefined : (json['signatureAlgorithms'] as Array<any>).map(SignatureAlgorithmFromJSON),
83
+ digests: json['digests'] == null ? undefined : (json['digests'] as Array<any>).map(DigestAlgFromJSON),
84
+ curves: json['curves'] == null ? undefined : (json['curves'] as Array<any>).map(CurveFromJSON),
85
+ keyOperations: json['keyOperations'] == null ? undefined : (json['keyOperations'] as Array<any>).map(KeyOperationsFromJSON),
86
+ }
87
+ }
88
+
89
+ export function ProviderCapabilitiesToJSON(json: any): ProviderCapabilities {
90
+ return ProviderCapabilitiesToJSONTyped(json, false)
91
+ }
92
+
93
+ export function ProviderCapabilitiesToJSONTyped(value?: ProviderCapabilities | null, ignoreDiscriminator: boolean = false): any {
94
+ if (value == null) {
95
+ return value
96
+ }
97
+
98
+ return {
99
+ keyTypes: value['keyTypes'] == null ? undefined : (value['keyTypes'] as Array<any>).map(KeyTypeToJSON),
100
+ signatureAlgorithms:
101
+ value['signatureAlgorithms'] == null ? undefined : (value['signatureAlgorithms'] as Array<any>).map(SignatureAlgorithmToJSON),
102
+ digests: value['digests'] == null ? undefined : (value['digests'] as Array<any>).map(DigestAlgToJSON),
103
+ curves: value['curves'] == null ? undefined : (value['curves'] as Array<any>).map(CurveToJSON),
104
+ keyOperations: value['keyOperations'] == null ? undefined : (value['keyOperations'] as Array<any>).map(KeyOperationsToJSON),
105
+ }
106
+ }
@@ -0,0 +1,91 @@
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 { KeyInfo } from './KeyInfo'
16
+ import { KeyInfoFromJSON, KeyInfoToJSON } from './KeyInfo'
17
+ import type { IdentifierMethod } from './IdentifierMethod'
18
+ import { IdentifierMethodFromJSON, IdentifierMethodToJSON } from './IdentifierMethod'
19
+
20
+ /**
21
+ * Request body for resolving a public key.
22
+ * @export
23
+ * @interface ResolvePublicKey
24
+ */
25
+ export interface ResolvePublicKey {
26
+ /**
27
+ *
28
+ * @type {KeyInfo}
29
+ * @memberof ResolvePublicKey
30
+ */
31
+ keyInfo: KeyInfo
32
+ /**
33
+ *
34
+ * @type {IdentifierMethod}
35
+ * @memberof ResolvePublicKey
36
+ */
37
+ identifierMethod?: IdentifierMethod
38
+ /**
39
+ * Optional array of trusted certificates (base64-encoded) that may be used in the resolution process.
40
+ * @type {Array<string>}
41
+ * @memberof ResolvePublicKey
42
+ */
43
+ trustedCerts?: Array<string>
44
+ /**
45
+ * Optional boolean indicating whether the X.509 certificate chain should be verified.
46
+ * @type {boolean}
47
+ * @memberof ResolvePublicKey
48
+ */
49
+ verifyX509CertificateChain?: boolean
50
+ }
51
+
52
+ /**
53
+ * Check if a given object implements the ResolvePublicKey interface.
54
+ */
55
+ export function instanceOfResolvePublicKey(value: object): value is ResolvePublicKey {
56
+ if (!('keyInfo' in value) || value['keyInfo'] === undefined) return false
57
+ return true
58
+ }
59
+
60
+ export function ResolvePublicKeyFromJSON(json: any): ResolvePublicKey {
61
+ return ResolvePublicKeyFromJSONTyped(json, false)
62
+ }
63
+
64
+ export function ResolvePublicKeyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResolvePublicKey {
65
+ if (json == null) {
66
+ return json
67
+ }
68
+ return {
69
+ keyInfo: KeyInfoFromJSON(json['keyInfo']),
70
+ identifierMethod: json['identifierMethod'] == null ? undefined : IdentifierMethodFromJSON(json['identifierMethod']),
71
+ trustedCerts: json['trustedCerts'] == null ? undefined : json['trustedCerts'],
72
+ verifyX509CertificateChain: json['verifyX509CertificateChain'] == null ? undefined : json['verifyX509CertificateChain'],
73
+ }
74
+ }
75
+
76
+ export function ResolvePublicKeyToJSON(json: any): ResolvePublicKey {
77
+ return ResolvePublicKeyToJSONTyped(json, false)
78
+ }
79
+
80
+ export function ResolvePublicKeyToJSONTyped(value?: ResolvePublicKey | null, ignoreDiscriminator: boolean = false): any {
81
+ if (value == null) {
82
+ return value
83
+ }
84
+
85
+ return {
86
+ keyInfo: KeyInfoToJSON(value['keyInfo']),
87
+ identifierMethod: IdentifierMethodToJSON(value['identifierMethod']),
88
+ trustedCerts: value['trustedCerts'],
89
+ verifyX509CertificateChain: value['verifyX509CertificateChain'],
90
+ }
91
+ }
@@ -0,0 +1,145 @@
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 { KeyType } from './KeyType'
16
+ import { KeyTypeFromJSON, KeyTypeToJSON } from './KeyType'
17
+ import type { KeyVisibility } from './KeyVisibility'
18
+ import { KeyVisibilityFromJSON, KeyVisibilityToJSON } from './KeyVisibility'
19
+ import type { SignatureAlgorithm } from './SignatureAlgorithm'
20
+ import { SignatureAlgorithmFromJSON, SignatureAlgorithmToJSON } from './SignatureAlgorithm'
21
+ import type { KeyEncoding } from './KeyEncoding'
22
+ import { KeyEncodingFromJSON, KeyEncodingToJSON } from './KeyEncoding'
23
+ import type { Jwk } from './Jwk'
24
+ import { JwkFromJSON, JwkToJSON } from './Jwk'
25
+
26
+ /**
27
+ * Represents a resolved cryptographic key information where the key is guaranteed to be present and resolved, providing concrete access to the key.
28
+ * @export
29
+ * @interface ResolvedKeyInfo
30
+ */
31
+ export interface ResolvedKeyInfo {
32
+ /**
33
+ * Unique identifier for the cryptographic key. Can be null if the key identifier is not provided.
34
+ * @type {string}
35
+ * @memberof ResolvedKeyInfo
36
+ */
37
+ kid?: string
38
+ /**
39
+ *
40
+ * @type {Jwk}
41
+ * @memberof ResolvedKeyInfo
42
+ */
43
+ key: Jwk
44
+ /**
45
+ *
46
+ * @type {SignatureAlgorithm}
47
+ * @memberof ResolvedKeyInfo
48
+ */
49
+ signatureAlgorithm?: SignatureAlgorithm
50
+ /**
51
+ *
52
+ * @type {KeyVisibility}
53
+ * @memberof ResolvedKeyInfo
54
+ */
55
+ keyVisibility?: KeyVisibility
56
+ /**
57
+ * X.509 certificate chain associated with the key.
58
+ * @type {Array<string>}
59
+ * @memberof ResolvedKeyInfo
60
+ */
61
+ x5c?: Array<string>
62
+ /**
63
+ * A reference or alias to the key in the Key Management Service (KMS).
64
+ * @type {string}
65
+ * @memberof ResolvedKeyInfo
66
+ */
67
+ alias?: string
68
+ /**
69
+ * The Key Management System (KMS) identifier associated with the key.
70
+ * @type {string}
71
+ * @memberof ResolvedKeyInfo
72
+ */
73
+ providerId?: string
74
+ /**
75
+ *
76
+ * @type {KeyType}
77
+ * @memberof ResolvedKeyInfo
78
+ */
79
+ keyType?: KeyType
80
+ /**
81
+ *
82
+ * @type {KeyEncoding}
83
+ * @memberof ResolvedKeyInfo
84
+ */
85
+ keyEncoding?: KeyEncoding
86
+ /**
87
+ * Additional configuration options as key-value pairs.
88
+ * @type {{ [key: string]: string; }}
89
+ * @memberof ResolvedKeyInfo
90
+ */
91
+ opts?: { [key: string]: string }
92
+ }
93
+
94
+ /**
95
+ * Check if a given object implements the ResolvedKeyInfo interface.
96
+ */
97
+ export function instanceOfResolvedKeyInfo(value: object): value is ResolvedKeyInfo {
98
+ if (!('key' in value) || value['key'] === undefined) return false
99
+ return true
100
+ }
101
+
102
+ export function ResolvedKeyInfoFromJSON(json: any): ResolvedKeyInfo {
103
+ return ResolvedKeyInfoFromJSONTyped(json, false)
104
+ }
105
+
106
+ export function ResolvedKeyInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResolvedKeyInfo {
107
+ if (json == null) {
108
+ return json
109
+ }
110
+ return {
111
+ kid: json['kid'] == null ? undefined : json['kid'],
112
+ key: JwkFromJSON(json['key']),
113
+ signatureAlgorithm: json['signatureAlgorithm'] == null ? undefined : SignatureAlgorithmFromJSON(json['signatureAlgorithm']),
114
+ keyVisibility: json['keyVisibility'] == null ? undefined : KeyVisibilityFromJSON(json['keyVisibility']),
115
+ x5c: json['x5c'] == null ? undefined : json['x5c'],
116
+ alias: json['alias'] == null ? undefined : json['alias'],
117
+ providerId: json['providerId'] == null ? undefined : json['providerId'],
118
+ keyType: json['keyType'] == null ? undefined : KeyTypeFromJSON(json['keyType']),
119
+ keyEncoding: json['keyEncoding'] == null ? undefined : KeyEncodingFromJSON(json['keyEncoding']),
120
+ opts: json['opts'] == null ? undefined : json['opts'],
121
+ }
122
+ }
123
+
124
+ export function ResolvedKeyInfoToJSON(json: any): ResolvedKeyInfo {
125
+ return ResolvedKeyInfoToJSONTyped(json, false)
126
+ }
127
+
128
+ export function ResolvedKeyInfoToJSONTyped(value?: ResolvedKeyInfo | null, ignoreDiscriminator: boolean = false): any {
129
+ if (value == null) {
130
+ return value
131
+ }
132
+
133
+ return {
134
+ kid: value['kid'],
135
+ key: JwkToJSON(value['key']),
136
+ signatureAlgorithm: SignatureAlgorithmToJSON(value['signatureAlgorithm']),
137
+ keyVisibility: KeyVisibilityToJSON(value['keyVisibility']),
138
+ x5c: value['x5c'],
139
+ alias: value['alias'],
140
+ providerId: value['providerId'],
141
+ keyType: KeyTypeToJSON(value['keyType']),
142
+ keyEncoding: KeyEncodingToJSON(value['keyEncoding']),
143
+ opts: value['opts'],
144
+ }
145
+ }
@@ -0,0 +1,85 @@
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 { KeyType } from './KeyType'
16
+ import { KeyTypeFromJSON, KeyTypeToJSON } from './KeyType'
17
+ import type { IdentifierMethod } from './IdentifierMethod'
18
+ import { IdentifierMethodFromJSON, IdentifierMethodToJSON } from './IdentifierMethod'
19
+
20
+ /**
21
+ * Represents a key resolver configuration.
22
+ * @export
23
+ * @interface Resolver
24
+ */
25
+ export interface Resolver {
26
+ /**
27
+ * Unique identifier for the resolver.
28
+ * @type {string}
29
+ * @memberof Resolver
30
+ */
31
+ resolverId: string
32
+ /**
33
+ * List of identifier methods supported by this resolver.
34
+ * @type {Array<IdentifierMethod>}
35
+ * @memberof Resolver
36
+ */
37
+ supportedIdentifierMethods?: Array<IdentifierMethod>
38
+ /**
39
+ * List of key types supported by this resolver.
40
+ * @type {Array<KeyType>}
41
+ * @memberof Resolver
42
+ */
43
+ supportedKeyTypes?: Array<KeyType>
44
+ }
45
+
46
+ /**
47
+ * Check if a given object implements the Resolver interface.
48
+ */
49
+ export function instanceOfResolver(value: object): value is Resolver {
50
+ if (!('resolverId' in value) || value['resolverId'] === undefined) return false
51
+ return true
52
+ }
53
+
54
+ export function ResolverFromJSON(json: any): Resolver {
55
+ return ResolverFromJSONTyped(json, false)
56
+ }
57
+
58
+ export function ResolverFromJSONTyped(json: any, ignoreDiscriminator: boolean): Resolver {
59
+ if (json == null) {
60
+ return json
61
+ }
62
+ return {
63
+ resolverId: json['resolverId'],
64
+ supportedIdentifierMethods:
65
+ json['supportedIdentifierMethods'] == null ? undefined : (json['supportedIdentifierMethods'] as Array<any>).map(IdentifierMethodFromJSON),
66
+ supportedKeyTypes: json['supportedKeyTypes'] == null ? undefined : (json['supportedKeyTypes'] as Array<any>).map(KeyTypeFromJSON),
67
+ }
68
+ }
69
+
70
+ export function ResolverToJSON(json: any): Resolver {
71
+ return ResolverToJSONTyped(json, false)
72
+ }
73
+
74
+ export function ResolverToJSONTyped(value?: Resolver | null, ignoreDiscriminator: boolean = false): any {
75
+ if (value == null) {
76
+ return value
77
+ }
78
+
79
+ return {
80
+ resolverId: value['resolverId'],
81
+ supportedIdentifierMethods:
82
+ value['supportedIdentifierMethods'] == null ? undefined : (value['supportedIdentifierMethods'] as Array<any>).map(IdentifierMethodToJSON),
83
+ supportedKeyTypes: value['supportedKeyTypes'] == null ? undefined : (value['supportedKeyTypes'] as Array<any>).map(KeyTypeToJSON),
84
+ }
85
+ }
@@ -0,0 +1,87 @@
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
+ * The input data and metadata required for creating a signature.
17
+ * @export
18
+ * @interface SignInput
19
+ */
20
+ export interface SignInput {
21
+ /**
22
+ * The data to be signed, encoded as a base64 string.
23
+ * @type {string}
24
+ * @memberof SignInput
25
+ */
26
+ data: string
27
+ /**
28
+ * The signing mode to be used.
29
+ * @type {string}
30
+ * @memberof SignInput
31
+ */
32
+ mode?: SignInputModeEnum
33
+ /**
34
+ * Additional metadata to be included in the signature.
35
+ * @type {{ [key: string]: any; }}
36
+ * @memberof SignInput
37
+ */
38
+ metadata?: { [key: string]: any }
39
+ }
40
+
41
+ /**
42
+ * @export
43
+ */
44
+ export const SignInputModeEnum = {
45
+ Detached: 'DETACHED',
46
+ Attached: 'ATTACHED',
47
+ } as const
48
+ export type SignInputModeEnum = (typeof SignInputModeEnum)[keyof typeof SignInputModeEnum]
49
+
50
+ /**
51
+ * Check if a given object implements the SignInput interface.
52
+ */
53
+ export function instanceOfSignInput(value: object): value is SignInput {
54
+ if (!('data' in value) || value['data'] === undefined) return false
55
+ return true
56
+ }
57
+
58
+ export function SignInputFromJSON(json: any): SignInput {
59
+ return SignInputFromJSONTyped(json, false)
60
+ }
61
+
62
+ export function SignInputFromJSONTyped(json: any, ignoreDiscriminator: boolean): SignInput {
63
+ if (json == null) {
64
+ return json
65
+ }
66
+ return {
67
+ data: json['data'],
68
+ mode: json['mode'] == null ? undefined : json['mode'],
69
+ metadata: json['metadata'] == null ? undefined : json['metadata'],
70
+ }
71
+ }
72
+
73
+ export function SignInputToJSON(json: any): SignInput {
74
+ return SignInputToJSONTyped(json, false)
75
+ }
76
+
77
+ export function SignInputToJSONTyped(value?: SignInput | null, ignoreDiscriminator: boolean = false): any {
78
+ if (value == null) {
79
+ return value
80
+ }
81
+
82
+ return {
83
+ data: value['data'],
84
+ mode: value['mode'],
85
+ metadata: value['metadata'],
86
+ }
87
+ }
@@ -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 { Signature } from './Signature'
16
+ import { SignatureFromJSON, SignatureToJSON } from './Signature'
17
+
18
+ /**
19
+ * The output of a signature creation operation.
20
+ * @export
21
+ * @interface SignOutput
22
+ */
23
+ export interface SignOutput {
24
+ /**
25
+ *
26
+ * @type {Signature}
27
+ * @memberof SignOutput
28
+ */
29
+ signature: Signature
30
+ /**
31
+ * Additional metadata included in the signature output.
32
+ * @type {{ [key: string]: any; }}
33
+ * @memberof SignOutput
34
+ */
35
+ metadata?: { [key: string]: any }
36
+ }
37
+
38
+ /**
39
+ * Check if a given object implements the SignOutput interface.
40
+ */
41
+ export function instanceOfSignOutput(value: object): value is SignOutput {
42
+ if (!('signature' in value) || value['signature'] === undefined) return false
43
+ return true
44
+ }
45
+
46
+ export function SignOutputFromJSON(json: any): SignOutput {
47
+ return SignOutputFromJSONTyped(json, false)
48
+ }
49
+
50
+ export function SignOutputFromJSONTyped(json: any, ignoreDiscriminator: boolean): SignOutput {
51
+ if (json == null) {
52
+ return json
53
+ }
54
+ return {
55
+ signature: SignatureFromJSON(json['signature']),
56
+ metadata: json['metadata'] == null ? undefined : json['metadata'],
57
+ }
58
+ }
59
+
60
+ export function SignOutputToJSON(json: any): SignOutput {
61
+ return SignOutputToJSONTyped(json, false)
62
+ }
63
+
64
+ export function SignOutputToJSONTyped(value?: SignOutput | null, ignoreDiscriminator: boolean = false): any {
65
+ if (value == null) {
66
+ return value
67
+ }
68
+
69
+ return {
70
+ signature: SignatureToJSON(value['signature']),
71
+ metadata: value['metadata'],
72
+ }
73
+ }
@@ -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 { KeyInfo } from './KeyInfo'
16
+ import { KeyInfoFromJSON, KeyInfoToJSON } from './KeyInfo'
17
+ import type { SignatureAlgorithm } from './SignatureAlgorithm'
18
+ import { SignatureAlgorithmFromJSON, SignatureAlgorithmToJSON } from './SignatureAlgorithm'
19
+
20
+ /**
21
+ * A cryptographic signature including the signature value and related information.
22
+ * @export
23
+ * @interface Signature
24
+ */
25
+ export interface Signature {
26
+ /**
27
+ * The signature value, encoded as a base64 string.
28
+ * @type {string}
29
+ * @memberof Signature
30
+ */
31
+ value: string
32
+ /**
33
+ *
34
+ * @type {SignatureAlgorithm}
35
+ * @memberof Signature
36
+ */
37
+ algorithm: SignatureAlgorithm
38
+ /**
39
+ *
40
+ * @type {KeyInfo}
41
+ * @memberof Signature
42
+ */
43
+ keyInfo?: KeyInfo
44
+ /**
45
+ * Additional metadata included in the signature.
46
+ * @type {{ [key: string]: any; }}
47
+ * @memberof Signature
48
+ */
49
+ metadata?: { [key: string]: any }
50
+ }
51
+
52
+ /**
53
+ * Check if a given object implements the Signature interface.
54
+ */
55
+ export function instanceOfSignature(value: object): value is Signature {
56
+ if (!('value' in value) || value['value'] === undefined) return false
57
+ if (!('algorithm' in value) || value['algorithm'] === undefined) return false
58
+ return true
59
+ }
60
+
61
+ export function SignatureFromJSON(json: any): Signature {
62
+ return SignatureFromJSONTyped(json, false)
63
+ }
64
+
65
+ export function SignatureFromJSONTyped(json: any, ignoreDiscriminator: boolean): Signature {
66
+ if (json == null) {
67
+ return json
68
+ }
69
+ return {
70
+ value: json['value'],
71
+ algorithm: SignatureAlgorithmFromJSON(json['algorithm']),
72
+ keyInfo: json['keyInfo'] == null ? undefined : KeyInfoFromJSON(json['keyInfo']),
73
+ metadata: json['metadata'] == null ? undefined : json['metadata'],
74
+ }
75
+ }
76
+
77
+ export function SignatureToJSON(json: any): Signature {
78
+ return SignatureToJSONTyped(json, false)
79
+ }
80
+
81
+ export function SignatureToJSONTyped(value?: Signature | null, ignoreDiscriminator: boolean = false): any {
82
+ if (value == null) {
83
+ return value
84
+ }
85
+
86
+ return {
87
+ value: value['value'],
88
+ algorithm: SignatureAlgorithmToJSON(value['algorithm']),
89
+ keyInfo: KeyInfoToJSON(value['keyInfo']),
90
+ metadata: value['metadata'],
91
+ }
92
+ }