| 
                                                        @@ -45,7 +45,7 @@  discard block  | 
                                                    
                                                    
                                                         | 
                                                         | 
                                                         block discarded – undo  | 
                                                    
                                                                                                                                                                                                                    
                                                            | 
                                                                                                                                    45
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    45
                                                                                                                                                                                                 | 
                                                                     $certificate = $contents;  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    46
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    46
                                                                                                                                                                                                 | 
                                                               | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    47
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    47
                                                                                                                                                                                                 | 
                                                                     // If we are missing the pem certificate header, try to convert it to a pem format first  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    48
                                                                                                                                                                                                 | 
                                                            
                                                                                                                             | 
                                                            -        if (! empty($contents) && strpos($contents, '-----BEGIN CERTIFICATE-----') === false) { | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                             | 
                                                            
                                                                                                                                    48
                                                                                                                                                                                                 | 
                                                            +        if (!empty($contents) && strpos($contents, '-----BEGIN CERTIFICATE-----') === false) { | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    49
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    49
                                                                                                                                                                                                 | 
                                                                         // Extract from either a PKCS#7 format or DER formatted contents  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    50
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    50
                                                                                                                                                                                                 | 
                                                                         $certificate = self::convertPkcs72Pem($contents) ?? self::convertDer2Pem($contents);  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    51
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    51
                                                                                                                                                                                                 | 
                                                                     }  | 
                                                        
                                                                                                                                                        
                                                         | 
                                                        @@ -88,7 +88,7 @@  discard block  | 
                                                    
                                                    
                                                         | 
                                                         | 
                                                         block discarded – undo  | 
                                                    
                                                                                                                                                                                                                    
                                                            | 
                                                                                                                                    88
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    88
                                                                                                                                                                                                 | 
                                                               | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    89
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    89
                                                                                                                                                                                                 | 
                                                                 public function hasParentInTrustChain(): bool  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    90
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    90
                                                                                                                                                                                                 | 
                                                                 { | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    91
                                                                                                                                                                                                 | 
                                                            
                                                                                                                             | 
                                                            -        return ! $this->getParentCertificateUrl() == '';  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                             | 
                                                            
                                                                                                                                    91
                                                                                                                                                                                                 | 
                                                            +        return !$this->getParentCertificateUrl() == '';  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    92
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    92
                                                                                                                                                                                                 | 
                                                                 }  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    93
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    93
                                                                                                                                                                                                 | 
                                                               | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    94
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    94
                                                                                                                                                                                                 | 
                                                                 public function getContents(): string  | 
                                                        
                                                                                                                                                        
                                                         | 
                                                        @@ -100,7 +100,7 @@  discard block  | 
                                                    
                                                    
                                                         | 
                                                         | 
                                                         block discarded – undo  | 
                                                    
                                                                                                                                                                                                                    
                                                            | 
                                                                                                                                    100
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    100
                                                                                                                                                                                                 | 
                                                               | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    101
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    101
                                                                                                                                                                                                 | 
                                                                 protected function guardAgainstInvalidContents(string $content, string $original)  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    102
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    102
                                                                                                                                                                                                 | 
                                                                 { | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    103
                                                                                                                                                                                                 | 
                                                            
                                                                                                                             | 
                                                            -        if (! (new X509())->loadX509($content)) { | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                             | 
                                                            
                                                                                                                                    103
                                                                                                                                                                                                 | 
                                                            +        if (!(new X509())->loadX509($content)) { | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    104
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    104
                                                                                                                                                                                                 | 
                                                                         throw CouldNotCreateCertificate::invalidContent($original);  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    105
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    105
                                                                                                                                                                                                 | 
                                                                     }  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    106
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    106
                                                                                                                                                                                                 | 
                                                                 }  | 
                                                        
                                                                                                                                                
                                         
                                        
                                            
                                                                                                    Please login to merge, or discard this patch.