Functions | |
def | tng_get_device_pubkey (public_key) |
def | tng_atcacert_max_device_cert_size (max_cert_size) |
def | tng_atcacert_read_device_cert (cert, cert_size, signer_cert=None) |
def | tng_atcacert_device_public_key (public_key, cert=None) |
def | tng_atcacert_max_signer_cert_size (max_cert_size) |
def | tng_atcacert_read_signer_cert (cert, cert_size) |
def | tng_atcacert_signer_public_key (public_key, cert=None) |
def | tng_atcacert_root_cert_size (cert_size) |
def | tng_atcacert_root_cert (cert, cert_size) |
def | tng_atcacert_root_public_key (public_key) |
TNG: classes and functions for interacting with TNG devices
def cryptoauthlib.tng.tng_atcacert_device_public_key | ( | public_key, | |
cert = None |
|||
) |
Reads the device public key. Args: public_key Public key will be returned here. Format will be the X and Y integers in big-endian format. 64 bytes for P256 curve. Expects bytearray. cert If supplied, the device public key is used from this certificate. If set to None, the device public key is read from the device. Expects bytes or None. Returns: ATCACERT_E_SUCCESS on success, otherwise an error code.
def cryptoauthlib.tng.tng_atcacert_max_device_cert_size | ( | max_cert_size | ) |
Return the maximum possible certificate size in bytes for a TNG device certificate. Certificate can be variable size, so this gives an appropriate buffer size when reading the certificate. Args: max_cert_size Maximum certificate size will be returned here in bytes. Expects AtcaReference. Returns: ATCACERT_E_SUCCESS on success, otherwise an error code.
def cryptoauthlib.tng.tng_atcacert_max_signer_cert_size | ( | max_cert_size | ) |
Return the maximum possible certificate size in bytes for a TNG signer certificate. Certificate can be variable size, so this gives an appropriate buffer size when reading the certificate. Args: max_cert_size Maximum certificate size will be returned here in bytes. Expects AtcaReference. Returns: ATCACERT_E_SUCCESS on success, otherwise an error code.
def cryptoauthlib.tng.tng_atcacert_read_device_cert | ( | cert, | |
cert_size, | |||
signer_cert = None |
|||
) |
Reads the device certificate for a TNG device. Args: cert Buffer to received the certificate (DER format). Expects bytearray. cert_size As input, the size of the cert buffer in bytes. As output, the size of the certificate returned in cert in bytes. Expects AtcaReference. signer_cert If supplied, the signer public key is used from this certificate. If set to None, the signer public key is read from the device. Expects bytes or None. Returns: ATCACERT_E_SUCCESS on success, otherwise an error code.
def cryptoauthlib.tng.tng_atcacert_read_signer_cert | ( | cert, | |
cert_size | |||
) |
Reads the signer certificate for a TNG device. Args: cert Buffer to received the certificate (DER format). Expects bytearray. cert_size As input, the size of the cert buffer in bytes. As output, the size of the certificate returned in cert in bytes. Expects AtcaReference. Returns: ATCACERT_E_SUCCESS on success, otherwise an error code.
def cryptoauthlib.tng.tng_atcacert_root_cert | ( | cert, | |
cert_size | |||
) |
Get the TNG root cert. Args: cert Buffer to received the certificate (DER format). Expects bytearray. cert_size As input, the size of the cert buffer in bytes. As output, the size of the certificate returned in cert in bytes. Expects AtcaReference. Returns: ATCACERT_E_SUCCESS on success, otherwise an error code.
def cryptoauthlib.tng.tng_atcacert_root_cert_size | ( | cert_size | ) |
Get the size of the TNG root cert. Args: cert_size Certificate size will be returned here in bytes. Expects AtcaReference. Returns: ATCACERT_E_SUCCESS on success, otherwise an error code.
def cryptoauthlib.tng.tng_atcacert_root_public_key | ( | public_key | ) |
Gets the root public key. Args: public_key Public key will be returned here. Format will be the X and Y integers in big-endian format. 64 bytes for P256 curve. Expects bytearray. Returns: ATCACERT_E_SUCCESS on success, otherwise an error code.
def cryptoauthlib.tng.tng_atcacert_signer_public_key | ( | public_key, | |
cert = None |
|||
) |
Reads the signer public key. Args: public_key Public key will be returned here. Format will be the X and Y integers in big-endian format. 64 bytes for P256 curve. Expects bytearray. cert If supplied, the signer public key is used from this certificate. If set to None, the signer public key is read from the device. Expects bytes or None. Returns: ATCACERT_E_SUCCESS on success, otherwise an error code.
def cryptoauthlib.tng.tng_get_device_pubkey | ( | public_key | ) |
Uses GenKey command to calculate the public key from the primary device public key. Args: public_key Public key will be returned here. Format will be the X and Y integers in big-endian format. 64 bytes for P256 curve. Expects bytearray. Returns: ATCA_SUCCESS on success, otherwise an error code.