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
Merged-In: Iab2d3b23ad969f683d716cb981e32fd554c67a81
Change-Id: I9ed5c96a20d6749bf75212c0fd820d71ca0a6053
This commit is contained in:
Neil Fuller
2018-10-02 11:55:20 +01:00
parent ec65174f11
commit 28fe954075

View File

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