CreateSecret Method

Creates a new secret.

Syntax

ANSI (Cross Platform)
char* CreateSecret(const char* lpszSecretName, const char* lpszContentType);

Unicode (Windows)
LPWSTR CreateSecret(LPCWSTR lpszSecretName, LPCWSTR lpszContentType);
- (NSString*)createSecret:(NSString*)secretName :(NSString*)contentType;
#define MID_AZURESECRETS_CREATESECRET 6

CLOUDKEYS_EXTERNAL int CLOUDKEYS_CALL CloudKeys_AzureSecrets_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method creates a new secret with the given SecretName. If a secret with the specified SecretName already exists, a new version of it is created. The version Id of the newly-created secret is returned.

The secret value is taken from the input stream supplied via the SetInputStream method, the specified LocalFile, or the SecretData property. If the EncodeData property is enabled, the value will be base64-encoded before it is sent.

The value passed for SecretName must consist solely of alphanumeric characters and hyphens (-).

The ContentType parameter is optional, and can be set to any string value.

If there are any items in the Tag* properties, they will be applied to the newly-created secret. Secrets may have up to 15 tags.

The following configuration settings can also be used to send additional values when creating the secret, refer to their documentation for more information:

Note: If there is already a soft-deleted secret with the specified SecretName in the currently-selected Vault, then a new secret cannot be created with the same name. To resolve such a situation, the soft-deleted secret would need to be recovered (using RecoverSecret) or permanently deleted (using PurgeSecret) first.

Error Handling (C++)

This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

Copyright (c) 2022 /n software inc. - All rights reserved.
Cloud Keys 2020 C++ Edition - Version 20.0 [Build 8157]