function read()
 {
     $this->version = ord($this->read_byte());
     $this->symmetric_algorithm = ord($this->read_byte());
     $this->s2k = \OpenPGP\S2K::parse($this->input);
     $this->encrypted_data = $this->input;
 }
Esempio n. 2
0
 function read()
 {
     parent::read();
     // All the fields from PublicKey
     $this->s2k_useage = ord($this->read_byte());
     if ($this->s2k_useage == 255 || $this->s2k_useage == 254) {
         $this->symmetric_algorithm = ord($this->read_byte());
         $this->s2k = \OpenPGP\S2K::parse($this->input);
     } else {
         if ($this->s2k_useage > 0) {
             $this->symmetric_algorithm = $this->s2k_useage;
         }
     }
     if ($this->s2k_useage > 0) {
         $this->encrypted_data = $this->input;
         // Rest of input is MPIs and checksum (encrypted)
     } else {
         $this->key_from_input();
         $this->private_hash = $this->read_bytes(2);
         // TODO: Validate checksum?
     }
 }