 
   #--------------------------
 
-  parse_public_key_v3 : (slice) ->
-
-  #--------------------------
-
-  @parse_public_key : (slice) -> (new Parser slice).parse_public_key()
-
-  #--------------------------
-
-  @parse_private_key : (slice) -> (new Parser slice).parse_private_key()
-    public_key = KeyMaterial.parse_public_key slice
+  @parse_public_key : (slice) -> 
+    p = (new Parser slice)
+    p.parse_public_key()
+    new KeyMaterial { key : p.key }
+
+  #--------------------------
+
+  @parse_private_key : (slice) -> 
+    p = (new Parser slice)
+    p.parse_private_key()
+    new KeyMaterial { key : p.key, skm : p.secret_key_material() }
   
 #=================================================================================
 

      else throw new Error "Unknown public key version: #{version}"

  #-------------------
  
  # 5.5.3.  Secret-Key Packet Formats
  #
  # See read_priv_key in openpgp.packet.keymaterial.js


class KeyMaterial extends Packet

  constructor : ({@key, @timestamp, @userid, @passphrase, @skm}) ->
    @timepacket = make_time_packet @timestamp
    @uidp = new UserID @userid
    super()
