Skip to content

Commit

Permalink
Update NetHSM API (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-nitrokey authored Nov 27, 2023
1 parent d7992e2 commit 904ac9c
Show file tree
Hide file tree
Showing 21 changed files with 226 additions and 246 deletions.
6 changes: 6 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
docs/BackupPassphraseConfig.md
docs/CreateResourceId.md
docs/DecryptData.md
docs/DecryptMode.md
docs/DecryptRequestData.md
Expand All @@ -20,10 +21,12 @@ docs/LogLevel.md
docs/LoggingConfig.md
docs/NetworkConfig.md
docs/PrivateKey.md
docs/PrivateKeyPemArguments.md
docs/ProvisionRequestData.md
docs/PublicKey.md
docs/RandomData.md
docs/RandomRequestData.md
docs/RestoreRequestArguments.md
docs/SignData.md
docs/SignMode.md
docs/SignRequestData.md
Expand All @@ -47,6 +50,7 @@ src/apis/default_api.rs
src/apis/mod.rs
src/lib.rs
src/models/backup_passphrase_config.rs
src/models/create_resource_id.rs
src/models/decrypt_data.rs
src/models/decrypt_mode.rs
src/models/decrypt_request_data.rs
Expand All @@ -68,10 +72,12 @@ src/models/logging_config.rs
src/models/mod.rs
src/models/network_config.rs
src/models/private_key.rs
src/models/private_key_pem_arguments.rs
src/models/provision_request_data.rs
src/models/public_key.rs
src/models/random_data.rs
src/models/random_request_data.rs
src/models/restore_request_arguments.rs
src/models/sign_data.rs
src/models/sign_mode.rs
src/models/sign_request_data.rs
Expand Down
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.0-SNAPSHOT
7.2.0-SNAPSHOT
3 changes: 2 additions & 1 deletion docs/BackupPassphraseConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**passphrase** | **String** | |
**new_passphrase** | **String** | |
**current_passphrase** | **String** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
11 changes: 11 additions & 0 deletions docs/CreateResourceId.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# CreateResourceId

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


57 changes: 26 additions & 31 deletions docs/DefaultApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Method | HTTP request | Description
> config_backup_passphrase_put(backup_passphrase_config)

Update the backup passphrase.
Update the backup passphrase. If the backup passphrase is not set yet, use \"\" as currentPassphrase. *WARNING:* Like the unlock passphrase, this configuration can't be reset by an admin user without knowing the current value, so if the backup passphrase is lost, neither can it be reset to a new value nor can the created backups be restored.

### Parameters

Expand Down Expand Up @@ -472,7 +472,7 @@ Name | Type | Description | Required | Notes
> config_unlock_passphrase_put(unlock_passphrase_config)

Update the unlock passphrase.
Update the unlock passphrase. *WARNING:* The unlock passphrase can't be reset by an admin user without knowing the current value, so if the unlock passphrase is lost, neither can it be reset to a new value nor can the NetHSM be unlocked.

### Parameters

Expand Down Expand Up @@ -607,7 +607,7 @@ No authorization required

## keys_generate_post

> keys_generate_post(key_generate_request_data)
> crate::models::CreateResourceId keys_generate_post(key_generate_request_data)

Generate a pair of public and private key and store it in NetHSM. KeyID is optional as a parameter and will be generated by NetHSM if not present.
Expand All @@ -621,7 +621,7 @@ Name | Type | Description | Required | Notes

### Return type

(empty response body)
[**crate::models::CreateResourceId**](CreateResourceId.md)

### Authorization

Expand All @@ -630,7 +630,7 @@ Name | Type | Description | Required | Notes
### HTTP request headers

- **Content-Type**: application/json
- **Accept**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -697,10 +697,10 @@ Name | Type | Description | Required | Notes

## keys_key_id_cert_get

> String keys_key_id_cert_get(key_id)
> std::vec::Vec<u8> keys_key_id_cert_get(key_id)

Retrieve stored certificate. The content-type header will display the media type of the stored data.
Retrieve a stored certificate in the exact format it was stored.

### Parameters

Expand All @@ -711,7 +711,7 @@ Name | Type | Description | Required | Notes

### Return type

**String**
[**std::vec::Vec<u8>**](std::vec::Vec<u8>.md)

### Authorization

Expand All @@ -720,7 +720,7 @@ Name | Type | Description | Required | Notes
### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/x-pem-file, application/x-x509-ca-cert, application/pgp-keys
- **Accept**: application/octet-stream

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

Expand All @@ -730,15 +730,15 @@ Name | Type | Description | Required | Notes
> keys_key_id_cert_put(key_id, body)

Store a certificate. Maximum size 1MB. The content-type header provides the media type. Only application/json, application/x-pem-file, application/x-x509-ca-cert, application/octet-stream, text/plain and application/pgp-keys is allowed.
Store a certificate. Maximum size 1MB. The Content-Type must be application/octet-stream.

### Parameters


Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**key_id** | **String** | | [required] |
**body** | **String** | | [required] |
**body** | **std::vec::Vec<u8>** | | [required] |

### Return type

Expand All @@ -750,7 +750,7 @@ Name | Type | Description | Required | Notes

### HTTP request headers

- **Content-Type**: application/x-pem-file, application/x-x509-ca-cert, application/pgp-keys
- **Content-Type**: application/octet-stream
- **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
Expand Down Expand Up @@ -941,7 +941,7 @@ Name | Type | Description | Required | Notes

## keys_key_id_put

> keys_key_id_put(key_id, private_key, mechanisms, tags)
> keys_key_id_put(key_id, private_key)

Import a private key into NetHSM and store it under the *KeyID* path. The public key will be automatically derived. The parameters of the key can be passed as a PEM file or a JSON object.
Expand All @@ -953,8 +953,6 @@ Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**key_id** | **String** | | [required] |
**private_key** | [**PrivateKey**](PrivateKey.md) | For request body with content type `application/json`: * *RSA* includes `primeP`, `primeQ`, and `publicExponent` properties. The remaining properties `privateExponent`, `modulus`, ..) are computed. * *EC_P224*, *EC_P256*, *EC_P384*, *EC_P521* uses the `data` property. Keys are the raw (big endian) scalar. * *Curve25519* uses the `data` property. Keys are the raw (little endian) key. | [required] |
**mechanisms** | Option<[**Vec<crate::models::KeyMechanism>**](crate::models::KeyMechanism.md)> | | |
**tags** | Option<[**Vec<String>**](String.md)> | | |

### Return type

Expand All @@ -966,7 +964,7 @@ Name | Type | Description | Required | Notes

### HTTP request headers

- **Content-Type**: application/json, application/x-pem-file
- **Content-Type**: application/json, multipart/form-data
- **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
Expand Down Expand Up @@ -1067,7 +1065,7 @@ Name | Type | Description | Required | Notes

## keys_post

> keys_post(private_key, mechanisms, tags)
> crate::models::CreateResourceId keys_post(private_key)

Import a private key into NetHSM and let NetHSM generate a KeyID. The public key will be automatically derived. The parameters of the key can be passed as a PEM file or a JSON object.
Expand All @@ -1078,21 +1076,19 @@ Import a private key into NetHSM and let NetHSM generate a KeyID. The public key
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**private_key** | [**PrivateKey**](PrivateKey.md) | | [required] |
**mechanisms** | Option<[**Vec<crate::models::KeyMechanism>**](crate::models::KeyMechanism.md)> | | |
**tags** | Option<[**Vec<String>**](String.md)> | | |

### Return type

(empty response body)
[**crate::models::CreateResourceId**](CreateResourceId.md)

### Authorization

[basic](../README.md#basic)

### HTTP request headers

- **Content-Type**: application/json, application/x-pem-file
- **Accept**: Not defined
- **Content-Type**: application/json, multipart/form-data
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -1156,7 +1152,7 @@ This endpoint does not need any parameter.
> provision_post(provision_request_data)

Initial provisioning, only available in *Unprovisioned* state.
Initial provisioning, only available in *Unprovisioned* state. *WARNING:* The unlock passphrase can't be reset by an admin user without knowing the current value, so if the unlock passphrase is lost, neither can it be reset to a new value nor can the NetHSM be unlocked.

### Parameters

Expand Down Expand Up @@ -1375,7 +1371,7 @@ This endpoint does not need any parameter.

## system_restore_post

> system_restore_post(backup_passphrase, body, system_time)
> system_restore_post(arguments, backup_file)

Restore the key store and user store from a backup file. If NetHSM is *Unprovisioned*, then the configuration is restored.
Expand All @@ -1385,9 +1381,8 @@ Restore the key store and user store from a backup file. If NetHSM is *Unprovisi

Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**backup_passphrase** | **String** | | [required] |
**body** | **std::vec::Vec<u8>** | | [required] |
**system_time** | Option<**String**> | | |
**arguments** | Option<[**crate::models::RestoreRequestArguments**](RestoreRequest_arguments.md)> | | |
**backup_file** | Option<**std::vec::Vec<u8>**> | | |

### Return type

Expand All @@ -1399,7 +1394,7 @@ No authorization required

### HTTP request headers

- **Content-Type**: application/octet-stream
- **Content-Type**: multipart/form-data
- **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
Expand Down Expand Up @@ -1521,7 +1516,7 @@ This endpoint does not need any parameter.

## users_post

> users_post(user_post_data)
> crate::models::CreateResourceId users_post(user_post_data)

Create a new user on NetHSM. The user-ID is generated by NetHSM.
Expand All @@ -1535,7 +1530,7 @@ Name | Type | Description | Required | Notes

### Return type

(empty response body)
[**crate::models::CreateResourceId**](CreateResourceId.md)

### Authorization

Expand All @@ -1544,7 +1539,7 @@ Name | Type | Description | Required | Notes
### HTTP request headers

- **Content-Type**: application/json
- **Accept**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

Expand Down
2 changes: 1 addition & 1 deletion docs/KeyItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**key** | **String** | |
**id** | **String** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
2 changes: 1 addition & 1 deletion docs/PrivateKey.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mechanisms** | [**Vec<crate::models::KeyMechanism>**](KeyMechanism.md) | |
**r#type** | [**crate::models::KeyType**](KeyType.md) | |
**key** | [**crate::models::KeyPrivateData**](KeyPrivateData.md) | |
**private** | [**crate::models::KeyPrivateData**](KeyPrivateData.md) | |
**restrictions** | Option<[**crate::models::KeyRestrictions**](KeyRestrictions.md)> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
12 changes: 12 additions & 0 deletions docs/PrivateKeyPemArguments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# PrivateKeyPemArguments

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mechanisms** | Option<[**Vec<crate::models::KeyMechanism>**](KeyMechanism.md)> | | [optional]
**restrictions** | Option<[**crate::models::KeyRestrictions**](KeyRestrictions.md)> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


2 changes: 1 addition & 1 deletion docs/PublicKey.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Name | Type | Description | Notes
**mechanisms** | [**Vec<crate::models::KeyMechanism>**](KeyMechanism.md) | |
**r#type** | [**crate::models::KeyType**](KeyType.md) | |
**restrictions** | [**crate::models::KeyRestrictions**](KeyRestrictions.md) | |
**key** | Option<[**crate::models::KeyPublicData**](KeyPublicData.md)> | | [optional]
**public** | Option<[**crate::models::KeyPublicData**](KeyPublicData.md)> | | [optional]
**operations** | **i32** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
12 changes: 12 additions & 0 deletions docs/RestoreRequestArguments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# RestoreRequestArguments

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**backup_passphrase** | Option<**String**> | | [optional]
**system_time** | Option<**String**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


3 changes: 2 additions & 1 deletion docs/UnlockPassphraseConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**passphrase** | **String** | |
**new_passphrase** | **String** | |
**current_passphrase** | **String** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
Loading

0 comments on commit 904ac9c

Please sign in to comment.