secCertificateImport (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.08.00


The secCertificateImport function imports a certificate to the device.

 

 

Input:

name : STRING

The name to identify the certificate.

 

certificate : STRING

The file name of the certificate to import.

 

key : STRING

The file name of an optional private encryption key to use for the certificate.

 

replace : BOOL (default FALSE)

When true an existing certificate will be replaced with the certificate.

 

 

Returns: INT

1

- Success.

0

- The function is not supported.

-1

- Could not find the file.

-2

- Illegal parameter.

-3

- Not a valid certificate file.

-4

- Failed to import certificate.

-5

- The certificate is already in store.

 

Declaration:

FUNCTION secCertificateImport : INT;
VAR_INPUT
  name        : STRING;
  certificate : STRING;
  key         : STRING;
  replace     : BOOL := FALSE;
END_VAR;

 

 


Example:

 

INCLUDE rtcu.inc
 
PROGRAM example;
 
fsMediaOpen(media := 0);
 
BEGIN
  ...
// Import certificate
secCertificateImport(name := "Certificate", certificate := "A:\cert.pem");
  ...
END;
END_PROGRAM;