protected function _algoToDigest(SignatureAlgorithmIdentifier $algo): string
    {
        $oid = $algo->oid();
        if (!array_key_exists($oid, self::MAP_DIGEST_OID_TO_NAME)) {
            throw new \UnexpectedValueException(
                sprintf('Digest method %s not supported.', $algo->name()));
        }
        return self::MAP_DIGEST_OID_TO_NAME[$oid];
    }