       else throw new Error "Unknown public key version: #{version}"
 
   #-------------------
-  
+
+  secret_key_material : () ->
+    { @enc_mpi_data, @iv, @checksum, @s2k, @enc_class, @s2k_convention }
+
+  #-------------------
+
   # 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}) ->
    @timepacket = make_time_packet @timestamp
    @uidp = new UserID @userid
    super()

      iv_len = @enc_class.blockSize
      @iv = @slice.read_buffer iv_len

    if (@s2k_convention isnt C.s2k_convention.none) and (@s2k.type is C.s2k.gnu)
      @enc_mpi_data = null
    else if encrypted_private_key
      @enc_mpi_data = @slice.consume_rest_to_buffer()
    else
      [err,len] = @key.add_priv @slice.peek_rest_to_buffer()
