uploadLdapPrivateCertificateWithHttpInfo method
Upload private key
Upload the private key to be used for TLS verification. The server will pick a hard-coded filename for the PrivateKeyFile setting in your config.json
. ##### Permissions Must have manage_system
permission.
Note: This method returns the HTTP Response
.
Parameters:
MultipartFile
certificate (required): The private key file
Implementation
Future<Response> uploadLdapPrivateCertificateWithHttpInfo(
MultipartFile certificate,
) async {
// ignore: prefer_const_declarations
final path = r'/ldap/certificate/private';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <MmQueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['multipart/form-data'];
bool hasFields = false;
final mp = MultipartRequest('POST', Uri.parse(path));
if (certificate != null) {
hasFields = true;
mp.fields[r'certificate'] = certificate.field;
mp.files.add(certificate);
}
if (hasFields) {
postBody = mp;
}
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}