Add HmacSHA256 backed by AndroidKeyStore.

This also adds the MAC length constraint on imported HMAC keys. HMAC
doesn't work without this constraint at the moment.

Bug: 18088752
Change-Id: I8613f58f5d2a84df00bcf6179d13e30619440330
This commit is contained in:
Alex Klyubin
2015-03-27 16:53:44 -07:00
parent 36ee836d2f
commit 4ab8ea4498
9 changed files with 472 additions and 4 deletions

View File

@@ -7,7 +7,14 @@ package android.security;
*/
public class KeymasterException extends Exception {
public KeymasterException(String message) {
private final int mErrorCode;
public KeymasterException(int errorCode, String message) {
super(message);
mErrorCode = errorCode;
}
public int getErrorCode() {
return mErrorCode;
}
}