protected function _findIssuers(Certificate $target,
        CertificateBundle $bundle): array
    {
        $issuers = array();
        $issuer_name = $target->tbsCertificate()->issuer();
        $extensions = $target->tbsCertificate()->extensions();
        // find by authority key identifier
        if ($extensions->hasAuthorityKeyIdentifier()) {
            $ext = $extensions->authorityKeyIdentifier();
            if ($ext->hasKeyIdentifier()) {
                foreach ($bundle->allBySubjectKeyIdentifier(
                    $ext->keyIdentifier()) as $issuer) {
                    // check that issuer name matches
                    if ($issuer->tbsCertificate()
                        ->subject()
                        ->equals($issuer_name)) {
                        $issuers[] = $issuer;
                    }
                }
            }
        }
        return $issuers;
    }
protected function _findIssuers(Certificate $target,
        CertificateBundle $bundle): array
    {
        $issuers = array();
        $issuer_name = $target->tbsCertificate()->issuer();
        $extensions = $target->tbsCertificate()->extensions();
        // find by authority key identifier
        if ($extensions->hasAuthorityKeyIdentifier()) {
            $ext = $extensions->authorityKeyIdentifier();
            if ($ext->hasKeyIdentifier()) {
                foreach ($bundle->allBySubjectKeyIdentifier(
                    $ext->keyIdentifier()) as $issuer) {
                    // check that issuer name matches
                    if ($issuer->tbsCertificate()
                        ->subject()
                        ->equals($issuer_name)) {
                        $issuers[] = $issuer;
                    }
                }
            }
        }
        return $issuers;
    }
protected function _findIssuers ( Certificate $ target , CertificateBundle $ bundle ) : array { $ issuers = array ( ) ; $ issuer_name = $ target -> tbsCertificate ( ) -> issuer ( ) ; $ extensions = $ target -> tbsCertificate ( ) -> extensions ( ) ; // find by authority key identifier if ( $ extensions -> hasAuthorityKeyIdentifier ( ) ) { $ ext = $ extensions -> authorityKeyIdentifier ( ) ; if ( $ ext -> hasKeyIdentifier ( ) ) { foreach ( $ bundle -> allBySubjectKeyIdentifier ( $ ext -> keyIdentifier ( ) ) as $ issuer ) { // check that issuer name matches if ( $ issuer -> tbsCertificate ( ) -> subject ( ) -> equals ( $ issuer_name ) ) { $ issuers [ ] = $ issuer ; } } } } return $ issuers ; }
Find all issuers of the target certificate from a given bundle.

@param Certificate $target Target certificate
@param CertificateBundle $bundle Certificates to search
@return Certificate[]
Find all issuers of the target certificate from a given bundle .