Avoid deprecated PrivateKeyInfo.getAlgorithmId()

Switch from using the PrivateKeyInfo.getAlgorithmId() method to
using the functionally identical PrivateKeyInfo.getPrivateKeyAlgorithm()
method instead.

Bug: 113148576
Test: build only / inspection
Change-Id: Iab2d3b23ad969f683d716cb981e32fd554c67a81
This commit is contained in:
Neil Fuller
2018-10-02 13:27:44 +01:00
parent aa8f8fb414
commit b81181b9f3

View File

@@ -205,7 +205,7 @@ public final class CredentialStorage extends FragmentActivity {
try {
final ASN1InputStream bIn = new ASN1InputStream(new ByteArrayInputStream(keyData));
final PrivateKeyInfo pki = PrivateKeyInfo.getInstance(bIn.readObject());
final String algOid = pki.getAlgorithmId().getAlgorithm().getId();
final String algOid = pki.getPrivateKeyAlgorithm().getAlgorithm().getId();
final String algName = new AlgorithmId(new ObjectIdentifier(algOid)).getName();
return KeyChain.isBoundKeyAlgorithm(algName);