Skip to content

Commit

Permalink
Merge branch '3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Oct 1, 2024
2 parents a868b3d + c228cc0 commit 489ff79
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions phpseclib/File/X509.php
Original file line number Diff line number Diff line change
Expand Up @@ -3355,6 +3355,28 @@ public function getAttribute(string $id, int $disposition = self::ATTR_ALL, ?arr
return false;
}

/**
* Get all requested CSR extensions
*
* Returns the list of extensions if there are any and false if not
*
* @param array $csr optional
* @return mixed
*/
public function getRequestedCertificateExtensions(array $csr = null)
{
if (empty($csr)) {
$csr = $this->currentCert;
}

$requestedExtensions = $this->getAttribute('pkcs-9-at-extensionRequest');
if ($requestedExtensions === false) {
return false;
}

return $this->getAttribute('pkcs-9-at-extensionRequest')[0];
}

/**
* Returns a list of all CSR attributes in use
*
Expand Down

0 comments on commit 489ff79

Please sign in to comment.