diff --git a/src/Android/Services/KeyStoreBackedStorageService.cs b/src/Android/Services/KeyStoreBackedStorageService.cs index 74a34463b..e884d0b23 100644 --- a/src/Android/Services/KeyStoreBackedStorageService.cs +++ b/src/Android/Services/KeyStoreBackedStorageService.cs @@ -123,13 +123,14 @@ namespace Bit.Android.Services } var gen = KeyPairGenerator.GetInstance(KeyProperties.KeyAlgorithmRsa, AndroidKeyStore); - var start = Calendar.Instance; - var end = Calendar.Instance; - end.Add(CalendarField.Year, 30); var subject = new X500Principal($"CN={KeyAlias}"); if(_oldAndroid) { + var start = Calendar.Instance; + var end = Calendar.Instance; + end.Add(CalendarField.Year, 30); + var spec = new KeyPairGeneratorSpec.Builder(Application.Context) .SetAlias(KeyAlias) .SetSubject(subject)