secCertificateEnumerate (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.08.00


The secCertificateEnumerate function enumerates the certificates installed on the device.

 

 

Input:

index : INT

The index of the certificate.

 

 

Output:

name : STRING

The name of the certificate.

 

 

Returns: INT

1

- Success.

0

- The function is not supported.

-1

- Could not find the certificate.

 

Declaration:

FUNCTION secCertificateEnumerate : INT;
VAR_INPUT
  index : INT;

  name : ACCESS STRING;
END_VAR;

 

 


Example:

 

INCLUDE rtcu.inc

 

FUNCTION list_certificates

VAR

  i     : INT := 1;

  count : INT := 0;

  name  : STRING;

END_VAR;

 

  DebugMsg(message := "------------------------------");

  DebugMsg(message := " Certificates:");

  WHILE secCertificateEnumerate(index := i, name := name) = 1 DO

    DebugMsg(message := "   [" + name + "]");

    count := count + 1;

    i     := i + 1;

  END_WHILE;

  IF count < 1 THEN

    DebugMsg(message := "   <NONE>");

  END_IF;

 

END_FUNCTION;