ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Certificate.php
Go to the documentation of this file.
1 <?php
2 
3 namespace SAML2\Utilities;
4 
9 {
13  const CERTIFICATE_PATTERN = '/^-----BEGIN CERTIFICATE-----([^-]*)^-----END CERTIFICATE-----/m';
14 
20  public static function hasValidStructure($certificate)
21  {
22  return !!preg_match(self::CERTIFICATE_PATTERN, $certificate);
23  }
24 
30  public static function convertToCertificate($X509CertificateContents)
31  {
32  return "-----BEGIN CERTIFICATE-----\n"
33  . chunk_split($X509CertificateContents, 64)
34  . "-----END CERTIFICATE-----\n";
35  }
36 }
static convertToCertificate($X509CertificateContents)
Definition: Certificate.php:30
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
Definition: example_052.php:77
static hasValidStructure($certificate)
Definition: Certificate.php:20
Collection of Utility functions specifically for certificates.
Definition: Certificate.php:8
const CERTIFICATE_PATTERN
The pattern that the contents of a certificate should adhere to.
Definition: Certificate.php:13