mirror of
https://github.com/bitwarden/android.git
synced 2025-01-11 18:57:39 +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);
|
end.Add(CalendarField.Year, 30);
|
||||||
|
|
||||||
var gen = KeyPairGenerator.GetInstance(KeyProperties.KeyAlgorithmRsa, AndroidKeyStore);
|
var gen = KeyPairGenerator.GetInstance(KeyProperties.KeyAlgorithmRsa, AndroidKeyStore);
|
||||||
var spec = new KeyGenParameterSpec.Builder(KeyAlias, KeyStorePurpose.Encrypt | KeyStorePurpose.Decrypt)
|
var spec = new KeyPairGeneratorSpec.Builder(Application.Context)
|
||||||
.SetCertificateSubject(new X500Principal($"CN={KeyAlias}"))
|
.SetAlias(KeyAlias)
|
||||||
.SetCertificateSerialNumber(BigInteger.Ten)
|
.SetSubject(new X500Principal($"CN={KeyAlias}"))
|
||||||
.SetKeyValidityStart(start.Time)
|
.SetSerialNumber(BigInteger.Ten)
|
||||||
.SetKeyValidityEnd(end.Time)
|
.SetStartDate(start.Time)
|
||||||
|
.SetEndDate(end.Time)
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
gen.Initialize(spec);
|
gen.Initialize(spec);
|
||||||
|
|
Loading…
Reference in a new issue