Obtain the public key. The caller applies for and releases memory for the public key marked as "key".