   # to the client...
   export_pgp_public : ({asp, regen}, cb) ->
     msg = @armored_pgp_public unless regen
-    msg = @pgp.export_keys({private : false}) unless msg?
-    cb null, msg
+    await @pgp.export_keys({private : false}), defer err, msg unless msg?
+    cb err, msg
 
   #-----
 

  
  # A private export consists of:
  #   1. The PGP public key block
  #   2. The keybase message (Public and private keys, triplesec'ed)
  export_private_to_server : ({tsenc, asp}, cb) ->
    err = ret = null
    if not (err = @_assert_signed())?
      pgp = @pgp.export_keys { private : false }
      await @keybase.export_keys { private : true, tsenc, asp }, defer err, keybase
    ret = if err? then null else { pgp, keybase : box(keybase).toString('base64') }
    cb err, ret

  #-----


  #--------------

  @import_from_triplesec_pgp : ({raw, base}, cb) ->
    await util.asyncify read_base64(raw), esc defer bin

  #--------------

  # Import from a dearmored/decoded PGP message.
  @import_from_pgp_message : ({msg, raw, asp, userid}, cb) ->
    bundle = null
