src/SignedData.php
/**
     * Check that CMS uses registered hashing algorithms
     * @throws FormatException
     * @throws Exception
     */
Check that CMS uses registered hashing algorithms
@throws FormatException
@throws Exception
Check that CMS uses registered hashing algorithms @throws FormatException @throws Exception
private function checkAlgorithms()
    {
        $availableHashes = hash_algos();
        $digestAlgorithmIdentifiers = $this->getSignedDataContent()->getDigestAlgorithmIdentifiers();
        foreach ($digestAlgorithmIdentifiers as $algorithmIdentifier) {
            $hashFunction = Algorithm::byOid($algorithmIdentifier->getAlgorithmOid());
            if (!in_array($hashFunction, $availableHashes)) {
                throw new SignedDataValidationException("Hash algorithm used in SignedData not registered system-wide");
            }
        }
    }
private function checkAlgorithms ( ) { $ availableHashes = hash_algos ( ) ; $ digestAlgorithmIdentifiers = $ this -> getSignedDataContent ( ) -> getDigestAlgorithmIdentifiers ( ) ; foreach ( $ digestAlgorithmIdentifiers as $ algorithmIdentifier ) { $ hashFunction = Algorithm :: byOid ( $ algorithmIdentifier -> getAlgorithmOid ( ) ) ; if ( ! in_array ( $ hashFunction , $ availableHashes ) ) { throw new SignedDataValidationException ( " Hash algorithm used in SignedData not registered system-wide " ) ; } } }
Check that CMS uses registered hashing algorithms
 @throws FormatException
 @throws Exception
Check that CMS uses registered hashing algorithms @throws FormatException @throws Exception