Skip to content

Commit

Permalink
Merge pull request #69 from thijskh/feature/deprecate-fingerprints
Browse files Browse the repository at this point in the history
Add deprecation tags to classes and methods that work with certificate fingerprints.
  • Loading branch information
thijskh authored Sep 13, 2016
2 parents eeefb67 + d1680d3 commit 1cea30c
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/SAML2/Certificate/Fingerprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

/**
* Simple representation of the fingerprint of a certificate
*
* @deprecated Please use full certificates instead.
*/
class Fingerprint
{
Expand All @@ -16,6 +18,8 @@ class Fingerprint

/**
* @param string $fingerPrint
*
* @deprecated Please use full certificates instead.
*/
public function __construct($fingerPrint)
{
Expand Down
5 changes: 5 additions & 0 deletions src/SAML2/Certificate/FingerprintCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@

/**
* Simple collection object for transporting keys
* @deprecated Please load full certificates instead.
*/
class FingerprintCollection extends ArrayCollection
{
/**
* Add a key to the collection
*
* @param \SAML2\Certificate\Fingerprint $fingerprint
*
* @deprecated
*/
public function add($fingerprint)
{
Expand All @@ -31,6 +34,8 @@ public function add($fingerprint)
* @param \SAML2\Certificate\Fingerprint $otherFingerprint
*
* @return bool
*
* @deprecated
*/
public function contains(Fingerprint $otherFingerprint)
{
Expand Down
7 changes: 7 additions & 0 deletions src/SAML2/Certificate/FingerprintLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use SAML2\Configuration\CertificateProvider;
use SAML2\Exception\InvalidArgumentException;

/**
* @deprecated Please load full certificates instead.
*/
class FingerprintLoader
{
/**
Expand All @@ -13,6 +16,8 @@ class FingerprintLoader
* @param \SAML2\Configuration\CertificateProvider $configuration
*
* @return \SAML2\Certificate\FingerprintCollection
*
* @deprecated
*/
public static function loadFromConfiguration(CertificateProvider $configuration)
{
Expand All @@ -27,6 +32,8 @@ public static function loadFromConfiguration(CertificateProvider $configuration)
* @param \SAML2\Configuration\CertificateProvider $configuration
*
* @return \SAML2\Certificate\FingerprintCollection
*
* @deprecated
*/
public function loadFingerprints(CertificateProvider $configuration)
{
Expand Down
2 changes: 2 additions & 0 deletions src/SAML2/Certificate/X509.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public function getCertificate()

/**
* @return \SAML2\Certificate\Fingerprint
*
* @deprecated Please use full certificates instead.
*/
public function getFingerprint()
{
Expand Down
2 changes: 2 additions & 0 deletions src/SAML2/Configuration/CertificateProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public function getCertificateFile();
* fingerprint is a string containing the certificate fingerprint.
*
* @return null|array|\Traversable
*
* @deprecated Please use getCertifiateFile() or getCertificateData()
*/
public function getCertificateFingerprints();
}
3 changes: 3 additions & 0 deletions src/SAML2/Configuration/IdentityProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public function getCertificateFile()
return $this->get('certificateFile');
}

/**
* @deprecated Please use getCertifiateFile() or getCertificateData()
*/
public function getCertificateFingerprints()
{
return $this->get('certificateFingerprints');
Expand Down
3 changes: 3 additions & 0 deletions src/SAML2/Configuration/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public function getCertificateFile()
return $this->get('certificateFile');
}

/**
* @deprecated Please use getCertificateData() or getCertificateFile().
*/
public function getCertificateFingerprints()
{
return $this->get('certificateFingerprints');
Expand Down
5 changes: 5 additions & 0 deletions src/SAML2/Signature/FingerprintValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

/**
* Validates the signature based on the fingerprint of the certificate
*
* @deprecated Please use full certificates instead.
*/
class FingerprintValidator extends AbstractChainedValidator
{
Expand All @@ -23,6 +25,9 @@ class FingerprintValidator extends AbstractChainedValidator
*/
private $fingerprintLoader;

/**
* @deprecated Please use full certificates instead.
*/
public function __construct(
LoggerInterface $logger,
FingerprintLoader $fingerprintLoader
Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/SignedElementHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function getValidatingCertificates()
$ret = array();
foreach ($this->certificates as $cert) {

/* We have found a matching fingerprint. */
/* Construct a PEM formatted certificate */
$pemCert = "-----BEGIN CERTIFICATE-----\n" .
chunk_split($cert, 64) .
"-----END CERTIFICATE-----\n";
Expand Down

0 comments on commit 1cea30c

Please sign in to comment.