mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
revert back to KeyPairGeneratorSpec
KeyGenParameterSpec crashes
This commit is contained in:
parent
5347624455
commit
8719b3eb64
1 changed files with 6 additions and 5 deletions
|
@ -102,11 +102,12 @@ namespace Bit.Android.Services
|
|||
end.Add(CalendarField.Year, 30);
|
||||
|
||||
var gen = KeyPairGenerator.GetInstance(KeyProperties.KeyAlgorithmRsa, AndroidKeyStore);
|
||||
var spec = new KeyGenParameterSpec.Builder(KeyAlias, KeyStorePurpose.Encrypt | KeyStorePurpose.Decrypt)
|
||||
.SetCertificateSubject(new X500Principal($"CN={KeyAlias}"))
|
||||
.SetCertificateSerialNumber(BigInteger.Ten)
|
||||
.SetKeyValidityStart(start.Time)
|
||||
.SetKeyValidityEnd(end.Time)
|
||||
var spec = new KeyPairGeneratorSpec.Builder(Application.Context)
|
||||
.SetAlias(KeyAlias)
|
||||
.SetSubject(new X500Principal($"CN={KeyAlias}"))
|
||||
.SetSerialNumber(BigInteger.Ten)
|
||||
.SetStartDate(start.Time)
|
||||
.SetEndDate(end.Time)
|
||||
.Build();
|
||||
|
||||
gen.Initialize(spec);
|
||||
|
|
Loading…
Reference in a new issue