src/OwpDkim.inc.php
static public function createDkimRecords($domain, $file_path = "", $selector = "owp")
    {

        if($file_path) {
            $throw = self::createPath($file_path);

            if(!$throw) {
                throw new Exception("Unable to create the DKIM directory; ".$file_path);
            }
        }

        $files = self::keyFileNamePath($domain);

        $keys = self::generateKeys();

        $dkim_selector = (string)$selector . '._domainkey';

        $dkim_record = 'v=DKIM1; k=rsa; p='.str_replace(array("-----BEGIN PUBLIC KEY-----", "-----END PUBLIC KEY-----", "\n"), "", $keys["publickey"]);

        $spf_text = 'v=spf1 a mx a:'.$domain.' ~all';

        if($file_path) {
            file_put_contents($file_path.$files["public_key_filename"], $keys["publickey"]);
            file_put_contents($file_path.$files["private_key_filename"], $keys["privatekey"]);
        }

        return self::generateInstructions($domain, $dkim_selector, $dkim_record, $spf_text, $keys, $file_path);

    }
static public function createDkimRecords($domain, $file_path = "", $selector = "owp")
    {

        if($file_path) {
            $throw = self::createPath($file_path);

            if(!$throw) {
                throw new Exception("Unable to create the DKIM directory; ".$file_path);
            }
        }

        $files = self::keyFileNamePath($domain);

        $keys = self::generateKeys();

        $dkim_selector = (string)$selector . '._domainkey';

        $dkim_record = 'v=DKIM1; k=rsa; p='.str_replace(array("-----BEGIN PUBLIC KEY-----", "-----END PUBLIC KEY-----", "\n"), "", $keys["publickey"]);

        $spf_text = 'v=spf1 a mx a:'.$domain.' ~all';

        if($file_path) {
            file_put_contents($file_path.$files["public_key_filename"], $keys["publickey"]);
            file_put_contents($file_path.$files["private_key_filename"], $keys["privatekey"]);
        }

        return self::generateInstructions($domain, $dkim_selector, $dkim_record, $spf_text, $keys, $file_path);

    }
createDkimRecords

@method createDkimRecords($domain, $file_path)
@access public
@param  $domain
@param  string $file_path
@param  string $selector
@return array Dkim instructions will be output.
@throws Exception Unable to create the DKIM directory.

@author  Brian Tafoya
@version 1.0