Home | History | Annotate | Download | only in keystore

Lines Matching refs:keyBlob

995     ResponseCode get(const char* filename, Blob* keyBlob, const BlobType type, uid_t uid) {
997 ResponseCode rc = keyBlob->readBlob(filename, userState->getDecryptionKey(),
1003 const uint8_t version = keyBlob->getVersion();
1009 if (upgradeBlob(filename, keyBlob, version, type, uid)) {
1010 if ((rc = this->put(filename, keyBlob, uid)) != NO_ERROR
1011 || (rc = keyBlob->readBlob(filename, userState->getDecryptionKey(),
1024 && keyBlob->isFallback()) {
1025 ResponseCode imported = importKey(keyBlob->getValue(), keyBlob->getLength(), filename,
1026 uid, keyBlob->isEncrypted() ? KEYSTORE_FLAG_ENCRYPTED : KEYSTORE_FLAG_NONE);
1031 rc = get(filename, keyBlob, TYPE_KEY_PAIR, uid);
1035 if (type != TYPE_ANY && keyBlob->getType() != type) {
1036 ALOGW("key found but type doesn't match: %d vs %d", keyBlob->getType(), type);
1043 ResponseCode put(const char* filename, Blob* keyBlob, uid_t uid) {
1045 return keyBlob->writeBlob(filename, userState->getEncryptionKey(), userState->getState(),
1102 Blob keyBlob(data, dataLength, NULL, 0, TYPE_KEY_PAIR);
1105 keyBlob.setEncrypted(flags & KEYSTORE_FLAG_ENCRYPTED);
1106 keyBlob.setFallback(isFallback);
1108 return put(filename, &keyBlob, uid);
1126 ResponseCode getKeyForName(Blob* keyBlob, const android::String8& keyName, const uid_t uid,
1130 ResponseCode responseCode = get(filepath8.string(), keyBlob, type, uid);
1139 responseCode = get(filepath8.string(), keyBlob, type, uid);
1159 return get(filepath8.string(), keyBlob, type, uid);
1457 Blob keyBlob;
1459 ResponseCode responseCode = mKeyStore->getKeyForName(&keyBlob, name8, callingUid,
1468 *item = (uint8_t*) malloc(keyBlob.getLength());
1469 memcpy(*item, keyBlob.getValue(), keyBlob.getLength());
1470 *itemLength = keyBlob.getLength();
1498 Blob keyBlob(item, itemLength, NULL, 0, ::TYPE_GENERIC);
1499 keyBlob.setEncrypted(flags & KEYSTORE_FLAG_ENCRYPTED);
1501 return mKeyStore->put(filename.string(), &keyBlob, callingUid);
1520 Blob keyBlob;
1521 ResponseCode responseCode = mKeyStore->get(filename.string(), &keyBlob, TYPE_GENERIC,
1854 Blob keyBlob(data, dataLength, NULL, 0, TYPE_KEY_PAIR);
1857 keyBlob.setEncrypted(flags & KEYSTORE_FLAG_ENCRYPTED);
1858 keyBlob.setFallback(isFallback);
1860 return mKeyStore->put(filename.string(), &keyBlob, callingUid);
1897 Blob keyBlob;
1903 ResponseCode responseCode = mKeyStore->getKeyForName(&keyBlob, name8, callingUid,
1924 if (keyBlob.isFallback()) {
1925 rc = openssl_sign_data(device, &params, keyBlob.getValue(), keyBlob.getLength(), data,
1928 rc = device->sign_data(device, &params, keyBlob.getValue(), keyBlob.getLength(), data,
1953 Blob keyBlob;
1957 ResponseCode responseCode = mKeyStore->getKeyForName(&keyBlob, name8, callingUid,
1976 if (keyBlob.isFallback()) {
1977 rc = openssl_verify_data(device, &params, keyBlob.getValue(), keyBlob.getLength(), data,
1980 rc = device->verify_data(device, &params, keyBlob.getValue(), keyBlob.getLength(), data,
2008 Blob keyBlob;
2013 ResponseCode responseCode = mKeyStore->getKeyForName(&keyBlob, name8, callingUid,
2030 if (keyBlob.isFallback()) {
2031 rc = openssl_get_keypair_public(device, keyBlob.getValue(), keyBlob.getLength(), pubkey,
2034 rc = device->get_keypair_public(device, keyBlob.getValue(), keyBlob.getLength(), pubkey,
2060 Blob keyBlob;
2061 ResponseCode responseCode = mKeyStore->get(filename.string(), &keyBlob, ::TYPE_KEY_PAIR,
2074 if (device->delete_keypair != NULL && !keyBlob.isFallback()) {
2075 if (device->delete_keypair(device, keyBlob.getValue(), keyBlob.getLength())) {
2216 Blob keyBlob;
2217 ResponseCode responseCode = mKeyStore->get(sourceFile.string(), &keyBlob, TYPE_ANY,
2223 return mKeyStore->put(targetFile.string(), &keyBlob, callingUid);
2278 Blob keyBlob;
2279 if (mKeyStore->get(filename.string(), &keyBlob, ::TYPE_ANY, callingUid)
2285 if (keyBlob.getType() == ::TYPE_KEY_PAIR) {
2287 if (device->delete_keypair != NULL && !keyBlob.isFallback()) {
2288 if (device->delete_keypair(device, keyBlob.getValue(), keyBlob.getLength())) {