am b62dc82b: Add javax.crypto.Mac as a supported CryptoObject to Fingerprint

* commit 'b62dc82b0c7208f106077b46fc7118da6baa6e13':
  Add javax.crypto.Mac as a supported CryptoObject to Fingerprint
This commit is contained in:
Jim Miller
2015-04-30 02:08:16 +00:00
committed by Android Git Automerger
3 changed files with 25 additions and 3 deletions

View File

@@ -13918,7 +13918,9 @@ package android.hardware.fingerprint {
public static class FingerprintManager.CryptoObject { public static class FingerprintManager.CryptoObject {
ctor public FingerprintManager.CryptoObject(java.security.Signature); ctor public FingerprintManager.CryptoObject(java.security.Signature);
ctor public FingerprintManager.CryptoObject(javax.crypto.Cipher); ctor public FingerprintManager.CryptoObject(javax.crypto.Cipher);
ctor public FingerprintManager.CryptoObject(javax.crypto.Mac);
method public javax.crypto.Cipher getCipher(); method public javax.crypto.Cipher getCipher();
method public javax.crypto.Mac getMac();
method public java.security.Signature getSignature(); method public java.security.Signature getSignature();
} }

View File

@@ -14217,7 +14217,9 @@ package android.hardware.fingerprint {
public static class FingerprintManager.CryptoObject { public static class FingerprintManager.CryptoObject {
ctor public FingerprintManager.CryptoObject(java.security.Signature); ctor public FingerprintManager.CryptoObject(java.security.Signature);
ctor public FingerprintManager.CryptoObject(javax.crypto.Cipher); ctor public FingerprintManager.CryptoObject(javax.crypto.Cipher);
ctor public FingerprintManager.CryptoObject(javax.crypto.Mac);
method public javax.crypto.Cipher getCipher(); method public javax.crypto.Cipher getCipher();
method public javax.crypto.Mac getMac();
method public java.security.Signature getSignature(); method public java.security.Signature getSignature();
} }

View File

@@ -42,6 +42,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import javax.crypto.Cipher; import javax.crypto.Cipher;
import javax.crypto.Mac;
/** /**
* A class that coordinates access to the fingerprint hardware. * A class that coordinates access to the fingerprint hardware.
@@ -195,18 +196,26 @@ public class FingerprintManager {
/** /**
* A wrapper class for the crypto objects supported by FingerprintManager. Currently the * A wrapper class for the crypto objects supported by FingerprintManager. Currently the
* framework supports {@link Signature} and {@link Cipher} objects. * framework supports {@link Signature}, {@link Cipher} and {@link Mac} objects.
*/ */
public static class CryptoObject { public static class CryptoObject {
public CryptoObject(Signature signature) { public CryptoObject(@NonNull Signature signature) {
mSignature = signature; mSignature = signature;
mCipher = null; mCipher = null;
mMac = null;
} }
public CryptoObject(Cipher cipher) { public CryptoObject(@NonNull Cipher cipher) {
mCipher = cipher; mCipher = cipher;
mSignature = null; mSignature = null;
mMac = null;
}
public CryptoObject(@NonNull Mac mac) {
mMac = mac;
mCipher = null;
mSignature = null;
} }
/** /**
@@ -221,6 +230,12 @@ public class FingerprintManager {
*/ */
public Cipher getCipher() { return mCipher; } public Cipher getCipher() { return mCipher; }
/**
* Get {@link Mac} object.
* @return {@link Mac} object or null if this doesn't contain one.
*/
public Mac getMac() { return mMac; }
/** /**
* @hide * @hide
* @return the opId associated with this object or 0 if none * @return the opId associated with this object or 0 if none
@@ -230,12 +245,15 @@ public class FingerprintManager {
return AndroidKeyStoreProvider.getKeyStoreOperationHandle(mSignature); return AndroidKeyStoreProvider.getKeyStoreOperationHandle(mSignature);
} else if (mCipher != null) { } else if (mCipher != null) {
return AndroidKeyStoreProvider.getKeyStoreOperationHandle(mCipher); return AndroidKeyStoreProvider.getKeyStoreOperationHandle(mCipher);
} else if (mMac != null) {
return AndroidKeyStoreProvider.getKeyStoreOperationHandle(mMac);
} }
return 0; return 0;
} }
private final Signature mSignature; private final Signature mSignature;
private final Cipher mCipher; private final Cipher mCipher;
private final Mac mMac;
}; };
/** /**