Skip to main content

Key Hiding

Protect sensitive Apptrove SDK credentials by storing them securely using .NET MAUI's SecureStorage.

Purpose

  • Safeguard SDK Key, Secret ID, and Secret Key from reverse engineering
  • Store credentials in encrypted storage
  • Prevent fraudulent activities
note

This feature works in conjunction with SDK Signing to provide comprehensive security.

Implementation

using AppTroveSDK.Maui;

async Task InitializeWithSecureKeys()
{
// Try to get key from secure storage first
var sdkKey = await SecureStorage.GetAsync("trackier_sdk_key");

if (string.IsNullOrEmpty(sdkKey))
{
// First run: store the key securely
sdkKey = "YOUR_SDK_KEY";
await SecureStorage.SetAsync("trackier_sdk_key", sdkKey);
}

var config = new AppTroveSDKConfig(sdkKey, AppTroveEnvironment.Production);
AppTroveSDK.Initialize(config);
}

Reference: Store the key on first launch, then remove from source code.

Security Features

Encrypted Storage

.NET MAUI SecureStorage provides:

  • iOS: Uses Keychain Services
  • Android: Uses EncryptedSharedPreferences with AES encryption
  • Windows: Uses Data Protection API (DPAPI)

Best Practices

  1. Never Hardcode Keys: Always use secure storage
  2. Remove After First Run: Delete keys from source after initial storage
  3. Regular Key Rotation: Periodically update your SDK keys

Troubleshooting

IssueSolution
Keys not storedCheck SecureStorage permissions
Permission errorsVerify app has proper permissions
Initialization failsVerify SDK key is correct

For support, contact support@trackier.com.