Lines Matching refs:key

53 /* KeyStore is a secured storage for key-value pairs. In this implementation,
54 * each file stores one key-value pair. Keys are encoded in file names, and
55 * values are encrypted with checksums. The encryption key is protected by a
161 * [0-o]. Therefore in the worst case the length of a key gets doubled. Note
164 static int encode_key(char* out, const Value* key) {
165 const uint8_t* in = key->value;
166 int length = key->length;
180 static int encode_key_for_uid(char* out, uid_t uid, const Value* key) {
184 return n + encode_key(out, key);
503 // the AES key, then we create the Blob to use with decryptBlob
526 // if salt was missing, generate one and write a new master key file with the salt.
604 ALOGW("key found but type doesn't match: %d vs %d", keyBlob->getType(), type);
650 ResponseCode importKey(const Value* key, const char* filename) {
660 rc = mDevice->import_keypair(mDevice, key->value, key->length, &data, &dataLength);
729 static void generateKeyFromPassword(uint8_t* key, ssize_t keySize, Value* pw, uint8_t* salt) {
739 PKCS5_PBKDF2_HMAC_SHA1((char*) pw->value, pw->length, salt, saltSize, 8192, keySize, key);
772 * Upgrade code. This will upgrade the key from the current version
792 * If we've updated, set the key blob to the right version
803 * Takes a blob that is an PEM-encoded RSA key as a byte array and
915 // They might be using a granted key.
921 // It is a granted key. Try to load it.
1024 * master key has been changed. To make a seamless transition, we update the
1032 // generate master key, encrypt with password, write to file, initialize mMasterKey*.
1036 // rewrite master key with new password.
1040 // read master key, decrypt with password, initialize mMasterKey*.
1094 static ResponseCode import(KeyStore* keyStore, int, uid_t uid, Value* keyName, Value* key,
1100 return keyStore->importKey(key, filename);