xml.CryptoKey.loadPublic

Loads the public part of an asymmetric RSA or DSA CryptoKey object, or the parameters and the public key of the Diffie-Hellman object from a XML document.

Syntax

loadPublic(
   doc xml.DomDocument )
  1. doc defines a xml.DomDocument object.

Usage

This method populates the RSA or DSA CryptoKey object with the public key parts contained in the given xml.DomDocument.

The asymmetric RSA CryptoKey object public key part is based on the XML-Signature specification for RSA. The DSA CryptoKey object public key part is based on the DSA specification.

For Diffie-Hellman, the input parameter is a xml.DomDocument object containing a representation of the Diffie-Hellman key based on the XML-Signature specification for the Diffie-Hellman key values. This method populates the Diffie-Hellman object with the parameters and the public key contained in the given xml.DomDocument.

If the public key node exists in the xml.DomDocument but is empty, it won't be possible to use the key unless the document contains valid modulus and generator parameters and you call xml.CryptoKey.generateKey with a size of zero (0). In this case, you won't be in possession of the other peer's public key.

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).