ImportBytes Method
Adds a key to the storage.
Syntax
ANSI (Cross Platform) int ImportBytes(const char* lpValue, int lenValue, int iFormat, const char* lpszKeyAlgorithm, const char* lpszScheme, const char* lpszSchemeParams, int iKeyType); Unicode (Windows) INT ImportBytes(LPCSTR lpValue, INT lenValue, INT iFormat, LPCWSTR lpszKeyAlgorithm, LPCWSTR lpszScheme, LPCWSTR lpszSchemeParams, INT iKeyType);
- (void)importBytes:(NSData*)value :(int)format :(NSString*)keyAlgorithm :(NSString*)scheme :(NSString*)schemeParams :(int)keyType;
#define MID_CRYPTOKEYSTORAGE_IMPORTBYTES 7 SECUREBLACKBOXLITE_EXTERNAL int SECUREBLACKBOXLITE_CALL SecureBlackboxLite_CryptoKeyStorage_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);
Remarks
Use this method to add a key from a byte array.
kffUnknown | 0 | The key format was not recognized as one of the known formats. |
kffAuto | 1 | The default format in current circumstances. This depends on the key being loaded or saved. |
kffDER | 2 | DER (binary) format |
kffPEM | 3 | PEM format (base64-encoded with headers) |
kffJSON | 4 | JSON key format |
ktAuto | 0 | The default key type in current circumstances. This depends on the operation, the file content, and the storage type. |
ktPublic | 1 | The operation should be performed on a public key. |
ktSecret | 2 | The operation should be performed on a private or secret key |
Error Handling (C++)
This method returns a 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. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)