xml.CryptoKey.loadPEM

Loads an asymmetric DSA key, an asymmetric RSA key, an asymmetric ECDSA key or Diffie-Hellman parameters from a file in PEM format.

Syntax

loadPEM(
   filename STRING )
  1. filename defines the filename or an entry in the FGLPROFILE file.

    If your FGLPROFILE file contains an entry for an encryption key like xml.myRsa.key="/opt/fourjs/crt/myRsa.pem" (where "myRsa" is the key identifier), pass "myRsa" to the method to retrieve that value. For an example of loading an encryption key, refer to Loading an asymmetric RSA key. For more on security-related FGLPROFILE entries, go to XML configuration and FGLPROFILE: XML cryptography

Usage

If the DSA, RSA or ECDSA private key or Diffie-Hellman parameters are protected with a password, the recommended way is to unprotect it with the openssl tool and to put the key file on a restricted file system. However, you can use a script or the fglpass agent to provide the password to the application.

In case of error, the method throws an exception and sets the status variable. Depending on the error, a human-readable description of the problem is available in the sqlca.sqlerrm register. See Error handling in GWS calls (status).