Python Bluetooth AccessCertificate
Access Certificate is used to recognise and authorise two HMKit SDK devices.
Initialising
Initialise the access certificate with hmkit.
Example
# Example: Permissions Check. Test Permission for VehicleStatus READ
# VEHICLE_STATUS READ permission location in the Certificate
vehsts_permission_bitlocation = PermissionLocation.locationfor(Identifiers.VEHICLE_STATUS, PermissionType.READ)
# get access_certificate, serial mocked
access_cert = hmkit_inst.get_certificate(None)
# get permissions
permissions = access_cert.get_permissions()
# check is_allowed from permissions.
isallowed = permissions.is_allowed(vehsts_permission_bitlocation)
print("Permission check for Vehicle Status read. isAllowed: ", isallowed)
Attributes
GetIssuer()
Declaration
get_issuer()
Returns
byte array (Certificate Issuer name)
Discussion
Get the certificates issuer.
GetProvidingSerialNumber()
Declaration
get_providing_serial_number(self):
Returns
byte array (The serial number of the access providing device)
Discussion
The serial number of the device that's providing access.
GetGainingSerialNumber()
Declaration
get_gaining_serial_number():
Returns
byte array (The serial number of the access gaining device)
Discussion
The serial number of the device that's gaining access.
GetVehiclePubKey()
Declaration
get_vehicle_pubkey():
Returns
byte array (The public key of the access gaining device)
Discussion
The public key of the device that's gaining access.
isExpired()
Declaration
is_expired():
Returns
bool TRUE/FALSE (Expiry Status, A boolean value indicating if the certificate has expired)
Discussion
Checks and returns expiry of the access certificate
isNotValidYet()
Declaration
is_not_valid_yet():
Returns
bool TRUE/FALSE (Indicates if the certificate is not valid yet, but will be in the future)
Discussion
Checks validity start of the access certificate.
GetPermissions()
Declaration
get_permissions():
Returns
hmkit.autoapi.properties.permissions.Permissions
Discussion
The permissions given for the Certificate(Device), up to 16 bytes and can both contain arbitrary data as well as permission bytes that correspond to the Auto API.
GetVersion()
Declaration
get_version()
Returns
integer
Discussion
the certificate version from access certificate
GetStartDate()
Declaration
get_start_date()
Returns
datetime.datetime
Discussion
the start validity date of the access certificate
GetPermissions()
Declaration
get_end_date()
Returns
datetime.datetime
Discussion
the end validity date of the access certificate