@@ -150,7 +150,7 @@ class X509 implements X509Interface
150150 /**
151151 * Default Constructor.
152152 */
153- public function __construct ()
153+ final public function __construct ()
154154 {
155155 // Explicitly Tagged Module, 1988 Syntax
156156 // http://tools.ietf.org/html/rfc5280#appendix-A.1
@@ -832,31 +832,31 @@ public function __construct()
832832 ];
833833 }
834834
835- public function saveX509CurrentCert ()
835+ final public function saveX509CurrentCert ()
836836 {
837837 return $ this ->saveX509 ($ this ->currentCert );
838838 }
839839
840- public function setStartDate ($ date )
840+ final public function setStartDate ($ date )
841841 {
842842 $ date = new DateTime ($ date , new DateTimeZone (@date_default_timezone_get ()));
843843
844844 $ this ->startDate = $ date ->format ('D, d M Y H:i:s O ' );
845845 }
846846
847- public function setEndDate ($ date )
847+ final public function setEndDate ($ date )
848848 {
849849 $ date = new DateTime ($ date , new DateTimeZone (@date_default_timezone_get ()));
850850
851851 $ this ->endDate = $ date ->format ('D, d M Y H:i:s O ' );
852852 }
853853
854- public function setSerialNumber ($ serial , $ base = -256 )
854+ final public function setSerialNumber ($ serial , $ base = -256 )
855855 {
856856 $ this ->serialNumber = new BigInteger ($ serial , $ base );
857857 }
858858
859- public function sign (
859+ final public function sign (
860860 $ issuer ,
861861 $ subject ,
862862 $ signatureAlgorithm = 'sha1WithRSAEncryption '
@@ -988,7 +988,7 @@ public function sign(
988988 return $ result ;
989989 }
990990
991- public function loadX509 ($ cert )
991+ final public function loadX509 ($ cert )
992992 {
993993 $ asn1 = new ASN1 ();
994994
@@ -1067,7 +1067,7 @@ private function removeExtension(string $id, string $path = null): bool
10671067 return $ result ;
10681068 }
10691069
1070- public function saveX509 ($ cert )
1070+ final public function saveX509 ($ cert )
10711071 {
10721072 if (!is_array ($ cert ) || !isset ($ cert ['tbsCertificate ' ])) {
10731073 return false ;
@@ -1134,13 +1134,13 @@ public function saveX509($cert)
11341134 '-----END CERTIFICATE----- ' ;
11351135 }
11361136
1137- public function setPublicKey ($ key )
1137+ final public function setPublicKey ($ key )
11381138 {
11391139 $ key ->setPublicKey ();
11401140 $ this ->publicKey = $ key ;
11411141 }
11421142
1143- public function getPublicKey (): ?RSAInterface
1143+ final public function getPublicKey (): ?RSAInterface
11441144 {
11451145 if (isset ($ this ->publicKey )) {
11461146 return $ this ->publicKey ;
@@ -1178,17 +1178,17 @@ public function getPublicKey(): ?RSAInterface
11781178 return $ publicKey ;
11791179 }
11801180
1181- public function setPrivateKey ($ key )
1181+ final public function setPrivateKey ($ key )
11821182 {
11831183 $ this ->privateKey = $ key ;
11841184 }
11851185
1186- public function getPrivateKey (): ?RSAInterface
1186+ final public function getPrivateKey (): ?RSAInterface
11871187 {
11881188 return $ this ->privateKey ;
11891189 }
11901190
1191- public function setDN ($ dn , $ type = 'utf8String ' ): bool
1191+ final public function setDN ($ dn , $ type = 'utf8String ' ): bool
11921192 {
11931193 $ this ->dn = null ;
11941194
@@ -1227,20 +1227,20 @@ public function setDN($dn, $type = 'utf8String'): bool
12271227 return true ;
12281228 }
12291229
1230- public function getDN ()
1230+ final public function getDN ()
12311231 {
12321232 return is_array ($ this ->currentCert ) && isset ($ this ->currentCert ['tbsCertList ' ]) ?
12331233 $ this ->currentCert ['tbsCertList ' ]['issuer ' ] : $ this ->dn ;
12341234 }
12351235
1236- public function setDomain ()
1236+ final public function setDomain ()
12371237 {
12381238 $ this ->domains = func_get_args ();
12391239 $ this ->removeDNProp ('id-at-commonName ' );
12401240 $ this ->setDNProp ('id-at-commonName ' , $ this ->domains [0 ]);
12411241 }
12421242
1243- public function setKeyIdentifier ($ value )
1243+ final public function setKeyIdentifier ($ value )
12441244 {
12451245 if (empty ($ value )) {
12461246 unset($ this ->currentKeyIdentifier );
@@ -1249,7 +1249,7 @@ public function setKeyIdentifier($value)
12491249 }
12501250 }
12511251
1252- public function computeKeyIdentifier ($ key = null ): string
1252+ final public function computeKeyIdentifier ($ key = null ): string
12531253 {
12541254 if (is_null ($ key )) {
12551255 $ key = $ this ;
@@ -1273,7 +1273,7 @@ public function computeKeyIdentifier($key = null): string
12731273 return $ hash ;
12741274 }
12751275
1276- public function formatSubjectPublicKey (): ?array
1276+ final public function formatSubjectPublicKey (): ?array
12771277 {
12781278 if ($ this ->publicKey instanceof RSAInterface) {
12791279 // the following two return statements do the same thing. i dunno.. i just prefer the later for some reason.
@@ -1332,7 +1332,7 @@ private function timeField(string $date): array
13321332 }
13331333 }
13341334
1335- public function getAttribute ($ id , $ disposition = self ::ATTR_ALL , $ csr = null )
1335+ final public function getAttribute ($ id , $ disposition = self ::ATTR_ALL , $ csr = null )
13361336 {
13371337 if (empty ($ csr )) {
13381338 $ csr = $ this ->currentCert ;
@@ -1528,7 +1528,7 @@ private function reformatKey(string $algorithm, string $key): string
15281528 }
15291529 }
15301530
1531- public function setExtension ($ id , $ value , $ critical = false , $ replace = true , string $ path = null ): bool
1531+ final public function setExtension ($ id , $ value , $ critical = false , $ replace = true , string $ path = null ): bool
15321532 {
15331533 $ extensions = &$ this ->extensions ($ this ->currentCert , $ path , true );
15341534
@@ -1853,7 +1853,7 @@ private function removeDNProp(string $propName)
18531853 }
18541854 }
18551855
1856- public function getIssuerDNProp ($ propName , $ withType = false )
1856+ final public function getIssuerDNProp ($ propName , $ withType = false )
18571857 {
18581858 switch (true ) {
18591859 case !isset ($ this ->currentCert ) || !is_array ($ this ->currentCert ):
0 commit comments