X509CertStoreImportP12 (FUN)ΒΆ

FUNCTION X509CertStoreImportP12 : RTS_IEC_HANDLE

Import a PKCS#12/PFX/P12 containter to the certificate store of the PLC. As such container typically combine certificate and private key into a single encrypted file, the certificate is imported to the own trust level. The private key will also be imported. If the container also contains chain certificates, these certs will be imported to the OwnChain trust level and are used by X509CertStoreBuildChain.

InOut:

Scope

Name

Type

Comment

Return

X509CertStoreImportP12

RTS_IEC_HANDLE

Handle to the imported certificate.

Input

hCertStore

RTS_IEC_HANDLE

Handle of to certificate store.

hBackend

RTS_IEC_HANDLE

Handle to the back-end where to store the generated certificate. RTS_INVALID_HANDLE should be used if no back- end is specified.

pContainer

POINTER TO RtsByteString

Bytestring containing the PKCS#12 cotainer.

pPassphrase

POINTER TO STRING

Password to decrypt the container. UTF-8 encoding expected.

keyExportable

BOOL

If TRUE, the private key may be exported using X509CertStoreExportP12 or CryptoExportAsymmetricKey afterwards. If FALSE, the private key can not be exported.

Output

Result

RTS_IEC_RESULT

Result of the operation.