hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
Macros | Typedefs | Functions
ifx-record-bp.h File Reference

Model for the brand protection record. More...

#include "infineon/ifx-ndef-bp-lib.h"
#include "infineon/ifx-ndef-record.h"

Go to the source code of this file.

Macros

#define IFX_RECORD_BP_SET   UINT8_C(0x01)
 Identifier for model set brand protection record ID.
 
#define IFX_RECORD_BP_GET   UINT8_C(0x02)
 Identifier for model get brand protection record ID.
 
#define IFX_RECORD_BP_NEW   UINT8_C(0x03)
 Identifier for model new brand protection record ID.
 
#define IFX_RECORD_BP_RELEASE_MEMORY   UINT8_C(0x04)
 Identifier for model brand protection record release memory.
 
#define IFX_RECORD_BP_TYPE_LEN   UINT8_C(0x20)
 Type length for brand protection.
 
#define IFX_RECORD_BP_TYPE
 Type of brand protection record: "infineon.com:nfc-bridge-tag.x509".
 
#define IFX_BP_CERT_HANDLERS_NOT_DEFINED   UINT8_C(0x01)
 Error ID for undefined certificate handler error.
 

Typedefs

typedef ifx_status_t(* ifx_record_bp_cert_encoder_t) (const void *, ifx_blob_t **)
 Function prototype declaration for certificate encoding function.
 
typedef ifx_status_t(* ifx_record_bp_cert_decoder_t) (const ifx_blob_t *, void *)
 Function prototype declaration for certificate decoding function.
 

Functions

ifx_status_t ifx_record_bp_new (ifx_record_handle_t *handle)
 Creates a new brand protection record and the respective handle for the record. This handle can be used for encoding and decoding operations.
 
ifx_status_t ifx_record_bp_register (void)
 Registers the brand protection record with the NDEF library. Only the registered records are encoded and decoded by the NDEF library.
 
ifx_status_t ifx_record_bp_set_certificate_handlers (ifx_record_handle_t *handle, ifx_record_bp_cert_encoder_t encoder, ifx_record_bp_cert_decoder_t decoder)
 Sets the certificate encoder and decoder callback functions for parsing certificates.
 
ifx_status_t ifx_record_bp_set_certificate (ifx_record_handle_t *handle, const void *certificate)
 Sets certificate in the brand protection record for a given record handle.
 
ifx_status_t ifx_record_bp_get_certificate (const ifx_record_handle_t *handle, void *certificate)
 Gets the certificate from the brand protection record handle.
 
ifx_status_t ifx_record_bp_set_payload (ifx_record_handle_t *handle, const ifx_blob_t *payload)
 Sets the payload in brand protection record handle.
 
ifx_status_t ifx_record_bp_get_payload (const ifx_record_handle_t *handle, ifx_blob_t *payload)
 Gets the payload from the brand protection record handle.
 

Detailed Description

Model for the brand protection record.

Definition in file ifx-record-bp.h.

Macro Definition Documentation

◆ IFX_BP_CERT_HANDLERS_NOT_DEFINED

#define IFX_BP_CERT_HANDLERS_NOT_DEFINED   UINT8_C(0x01)

Error ID for undefined certificate handler error.

Definition at line 57 of file ifx-record-bp.h.

◆ IFX_RECORD_BP_GET

#define IFX_RECORD_BP_GET   UINT8_C(0x02)

Identifier for model get brand protection record ID.

Definition at line 29 of file ifx-record-bp.h.

◆ IFX_RECORD_BP_NEW

#define IFX_RECORD_BP_NEW   UINT8_C(0x03)

Identifier for model new brand protection record ID.

Definition at line 34 of file ifx-record-bp.h.

◆ IFX_RECORD_BP_RELEASE_MEMORY

#define IFX_RECORD_BP_RELEASE_MEMORY   UINT8_C(0x04)

Identifier for model brand protection record release memory.

Definition at line 39 of file ifx-record-bp.h.

◆ IFX_RECORD_BP_SET

#define IFX_RECORD_BP_SET   UINT8_C(0x01)

Identifier for model set brand protection record ID.

Definition at line 24 of file ifx-record-bp.h.

◆ IFX_RECORD_BP_TYPE

#define IFX_RECORD_BP_TYPE
Value:
{0x69, 0x6E, 0x66, 0x69, 0x6E, 0x65, 0x6F, 0x6E, 0x2E, 0x63, 0x6F, \
0x6D, 0x3A, 0x6E, 0x66, 0x63, 0x2D, 0x62, 0x72, 0x69, 0x64, 0x67, \
0x65, 0x2D, 0x74, 0x61, 0x67, 0x2E, 0x78, 0x35, 0x30, 0x39};

Type of brand protection record: "infineon.com:nfc-bridge-tag.x509".

Definition at line 49 of file ifx-record-bp.h.

49#define IFX_RECORD_BP_TYPE \
50 {0x69, 0x6E, 0x66, 0x69, 0x6E, 0x65, 0x6F, 0x6E, 0x2E, 0x63, 0x6F, \
51 0x6D, 0x3A, 0x6E, 0x66, 0x63, 0x2D, 0x62, 0x72, 0x69, 0x64, 0x67, \
52 0x65, 0x2D, 0x74, 0x61, 0x67, 0x2E, 0x78, 0x35, 0x30, 0x39};

◆ IFX_RECORD_BP_TYPE_LEN

#define IFX_RECORD_BP_TYPE_LEN   UINT8_C(0x20)

Type length for brand protection.

Definition at line 44 of file ifx-record-bp.h.

Typedef Documentation

◆ ifx_record_bp_cert_decoder_t

typedef ifx_status_t(* ifx_record_bp_cert_decoder_t) (const ifx_blob_t *, void *)

Function prototype declaration for certificate decoding function.

Definition at line 68 of file ifx-record-bp.h.

◆ ifx_record_bp_cert_encoder_t

typedef ifx_status_t(* ifx_record_bp_cert_encoder_t) (const void *, ifx_blob_t **)

Function prototype declaration for certificate encoding function.

Definition at line 62 of file ifx-record-bp.h.

Function Documentation

◆ ifx_record_bp_get_certificate()

ifx_status_t ifx_record_bp_get_certificate ( const ifx_record_handle_t * handle,
void * certificate )

Gets the certificate from the brand protection record handle.

Parameters
[in]handlePointer to the record handle
[out]certificatePointer to the certificate
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the certificate get operation is successful
NDEF_ERROR_INVALID_RECORDIf the record handle is not a brand protection type
IFX_ILLEGAL_ARGUMENTIf input parameters are NULL or invalid

◆ ifx_record_bp_get_payload()

ifx_status_t ifx_record_bp_get_payload ( const ifx_record_handle_t * handle,
ifx_blob_t * payload )

Gets the payload from the brand protection record handle.

Parameters
[in]handlePointer to the record handle
[out]payloadPointer to the payload
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the get operation is successful
IFX_ILLEGAL_ARGUMENTIf input parameters are NULL or invalid
IFX_OUT_OF_MEMORYIf memory allocation fails

◆ ifx_record_bp_new()

ifx_status_t ifx_record_bp_new ( ifx_record_handle_t * handle)

Creates a new brand protection record and the respective handle for the record. This handle can be used for encoding and decoding operations.

Parameters
[out]handleHandle of the created brand protection record
Returns
ifx_status_t
Return values
IFX_SUCCESSIf new record creation is successful
IFX_ILLEGAL_ARGUMENTIn case of NULL init_handler
IFX_OUT_OF_MEMORYIf memory allocation fails

◆ ifx_record_bp_register()

ifx_status_t ifx_record_bp_register ( void )

Registers the brand protection record with the NDEF library. Only the registered records are encoded and decoded by the NDEF library.

Returns
ifx_status_t
Return values
IFX_SUCCESSIf init_handler is registered properly to the record init_handler list
IFX_RECORD_INFO_ALREADY_REGISTEREDIf the same record type is already registered
IFX_ILLEGAL_ARGUMENTIn case of NULL init_handler
IFX_OUT_OF_MEMORYIf memory allocation fails

◆ ifx_record_bp_set_certificate()

ifx_status_t ifx_record_bp_set_certificate ( ifx_record_handle_t * handle,
const void * certificate )

Sets certificate in the brand protection record for a given record handle.

Parameters
[out]handlePointer to record handle
[in]certificatePointer to certificate
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the certificate set operation is successful
NDEF_ERROR_INVALID_RECORDIf the record handle is not a brand protection type
IFX_ILLEGAL_ARGUMENTIf input parameters are NULL or invalid

◆ ifx_record_bp_set_certificate_handlers()

ifx_status_t ifx_record_bp_set_certificate_handlers ( ifx_record_handle_t * handle,
ifx_record_bp_cert_encoder_t encoder,
ifx_record_bp_cert_decoder_t decoder )

Sets the certificate encoder and decoder callback functions for parsing certificates.

Parameters
[out]handlePointer to the record handle
[in]encoderCallback function to encode certificate
[in]decoderCallback function to decode certificate
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the certificate parser set operation is successful
NDEF_ERROR_INVALID_RECORDIf the record handle is not a brand protection type
IFX_ILLEGAL_ARGUMENTIf input parameters are NULL or invalid

◆ ifx_record_bp_set_payload()

ifx_status_t ifx_record_bp_set_payload ( ifx_record_handle_t * handle,
const ifx_blob_t * payload )

Sets the payload in brand protection record handle.

Parameters
[in,out]handlePointer to the record handle
[in]payloadPointer to the payload
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the set operation is successful
IFX_ILLEGAL_ARGUMENTIf input parameters are NULL or invalid
IFX_OUT_OF_MEMORYIf memory allocation fails