Android Hardware Abstraction Layer
Data Fields
keymaster_device Struct Reference

#include <keymaster.h>

Data Fields

struct hw_device_t common
 
uint32_t client_version
 
uint32_t flags
 
void * context
 
int(* generate_keypair )(const struct keymaster_device *dev, const keymaster_keypair_t key_type, const void *key_params, uint8_t **key_blob, size_t *key_blob_length)
 
int(* import_keypair )(const struct keymaster_device *dev, const uint8_t *key, const size_t key_length, uint8_t **key_blob, size_t *key_blob_length)
 
int(* get_keypair_public )(const struct keymaster_device *dev, const uint8_t *key_blob, const size_t key_blob_length, uint8_t **x509_data, size_t *x509_data_length)
 
int(* delete_keypair )(const struct keymaster_device *dev, const uint8_t *key_blob, const size_t key_blob_length)
 
int(* delete_all )(const struct keymaster_device *dev)
 
int(* sign_data )(const struct keymaster_device *dev, const void *signing_params, const uint8_t *key_blob, const size_t key_blob_length, const uint8_t *data, const size_t data_length, uint8_t **signed_data, size_t *signed_data_length)
 
int(* verify_data )(const struct keymaster_device *dev, const void *signing_params, const uint8_t *key_blob, const size_t key_blob_length, const uint8_t *signed_data, const size_t signed_data_length, const uint8_t *signature, const size_t signature_length)
 

Detailed Description

The parameters that can be set for a given keymaster implementation.

Definition at line 141 of file keymaster.h.

Field Documentation

uint32_t client_version

THIS IS DEPRECATED. Use the new "module_api_version" and "hal_api_version" fields in the keymaster_module initialization instead.

Definition at line 148 of file keymaster.h.

struct hw_device_t common

Definition at line 142 of file keymaster.h.

void* context

Definition at line 155 of file keymaster.h.

int(* delete_all)(const struct keymaster_device *dev)

Deletes all keys in the hardware keystore. Used when keystore is reset completely.

This function is optional and should be set to NULL if it is not implemented.

Returns 0 on success or an error code less than 0.

Definition at line 210 of file keymaster.h.

int(* delete_keypair)(const struct keymaster_device *dev, const uint8_t *key_blob, const size_t key_blob_length)

Deletes the key pair associated with the key blob.

This function is optional and should be set to NULL if it is not implemented.

Returns 0 on success or an error code less than 0.

Definition at line 198 of file keymaster.h.

uint32_t flags

See flags defined for keymaster_device::flags above.

Definition at line 153 of file keymaster.h.

int(* generate_keypair)(const struct keymaster_device *dev, const keymaster_keypair_t key_type, const void *key_params, uint8_t **key_blob, size_t *key_blob_length)

Generates a public and private key. The key-blob returned is opaque and must subsequently provided for signing and verification.

Returns: 0 on success or an error code less than 0.

Definition at line 163 of file keymaster.h.

int(* get_keypair_public)(const struct keymaster_device *dev, const uint8_t *key_blob, const size_t key_blob_length, uint8_t **x509_data, size_t *x509_data_length)

Gets the public key part of a key pair. The public key must be in X.509 format (Java standard) encoded byte array.

Returns: 0 on success or an error code less than 0. On error, x509_data should not be allocated.

Definition at line 186 of file keymaster.h.

int(* import_keypair)(const struct keymaster_device *dev, const uint8_t *key, const size_t key_length, uint8_t **key_blob, size_t *key_blob_length)

Imports a public and private key pair. The imported keys will be in PKCS#8 format with DER encoding (Java standard). The key-blob returned is opaque and will be subsequently provided for signing and verification.

Returns: 0 on success or an error code less than 0.

Definition at line 175 of file keymaster.h.

int(* sign_data)(const struct keymaster_device *dev, const void *signing_params, const uint8_t *key_blob, const size_t key_blob_length, const uint8_t *data, const size_t data_length, uint8_t **signed_data, size_t *signed_data_length)

Signs data using a key-blob generated before. This can use either an asymmetric key or a secret key.

Returns: 0 on success or an error code less than 0.

Definition at line 218 of file keymaster.h.

int(* verify_data)(const struct keymaster_device *dev, const void *signing_params, const uint8_t *key_blob, const size_t key_blob_length, const uint8_t *signed_data, const size_t signed_data_length, const uint8_t *signature, const size_t signature_length)

Verifies data signed with a key-blob. This can use either an asymmetric key or a secret key.

Returns: 0 on successful verification or an error code less than 0.

Definition at line 230 of file keymaster.h.


The documentation for this struct was generated from the following file: