getDefaultCipherSpec
š REL-ID SDK API Documentation: getDefaultCipherSpec
š Overview
The getDefaultCipherSpec API returns the default cipher specification configured for the current REL-ID SDK environment. This cipher specification includes algorithm, key size, mode, padding, and hash algorithm used for encrypting and decrypting data securely.
This is a convenience method designed to reduce hardcoding of cipher specs and ensure consistency across encryption and decryption calls like encryptDataPacket and decryptDataPacket.
šÆ Purpose
Use this API to retrieve the cipher specification string to be passed to other cryptographic APIs.
š API Flow
- Call
getDefaultCipherSpec() - Use the returned cipher spec string in
encryptDataPacket()anddecryptDataPacket()
š§¾ Response
Returns a string in the format:
<EncryptionAlgo>/<KeySize>/<Mode>/<Padding>:<HashAlgorithm>
š§ Example:
AES/256/CFB/NoPadding:SHA-256
This means:
- Algorithm: AES
- Key size: 256 bits
- Mode: CFB
- Padding: NoPadding
- Hash Algorithm: SHA-256
š» Code Snippets
React Native
RdnaClient.getDefaultCipherSpec((response) => {
const cipherSpec = response.response;
});Flutter
final cipherSpec = await rdnaClient.getDefaultCipherSpec();Cordova
com.uniken.rdnaplugin.RdnaClient.getDefaultCipherSpec(successCallback, errorCallback);Native iOS
NSString* cipherSpec = [rdnaClient getDefaultCipherSpec];Native Android
String cipherSpec = rdnaClient.getDefaultCipherSpec();š§ Developer Notes
- Always retrieve and reuse this cipherSpec rather than hardcoding one.
- Recommended to cache it for the session lifetime.
- Can be paired with
getDefaultCipherSalt().
Updated 9 months ago
