Invalid RSA public key errors in DKIM records arise from a combination of factors. These include malformed keys due to base64 decoding issues (often from truncation or corruption during DNS insertion), incorrect DNS record syntax (extra spaces, typos), problems during key generation (incorrect parameters, buggy software), DNS limitations (character limits, propagation delays), key mismatches, revocation, incompatible OpenSSL versions, canonicalization issues, and incorrect selectors. Resolution involves careful DNS configuration, adherence to DKIM standards, consistent canonicalization, proper key management, regular testing, and using online DKIM checkers.
10 marketer opinions
Invalid RSA public key errors in DKIM records can stem from various sources, primarily related to key generation, DNS configuration, and key management. Key generation issues include using incorrect parameters or buggy software. DNS problems often arise from copy/paste errors, character limits, or DNS propagation delays. Key mismatches, revocation, or base64 encoding issues also contribute to validation failures. Regular testing, using online DKIM checkers, and verifying key length and syntax are crucial for resolving these errors.
Marketer view
Email marketer from Reddit recommends careful copy/pasting of the DKIM record into DNS, because extra spaces, line breaks, or incorrect characters can easily be introduced. They advise using a text editor to clean up the key before pasting it into DNS.
2 Nov 2022 - Reddit
Marketer view
Email marketer from Stack Overflow suggests an invalid RSA public key can arise during the key generation process itself if the parameters are incorrect or if the software used for generation has bugs. They advise trying a different key generation tool or verifying the parameters used.
16 May 2022 - Stack Overflow
3 expert opinions
Invalid RSA public key errors in DKIM records can be caused by malformed keys due to bad base64 decoding (often from truncation or corruption during DNS management insertion), incorrect key lengths (keys shorter than 1024 or 2048 bits), or using the wrong selector (leading to validation failures). Troubleshooting involves verifying key length and ensuring the correct selector is used.
Expert view
Expert from Word to the Wise explains that an incorrect key length can be an issue for DKIM. Standard key sizes are 1024 bits or 2048 bits; anything shorter is typically rejected. They suggests checking if the key was generated with the correct length.
24 Feb 2024 - Word to the Wise
Expert view
Expert from Email Geeks suggests a bad base64 decode indicates the DKIM key is malformed, possibly truncated or corrupted during DNS management insertion, noting the key in DNS is an odd number of characters long.
19 Aug 2021 - Email Geeks
5 technical articles
Invalid RSA public key errors in DKIM records often arise from incorrect DNS record syntax, including typos, extra spaces, or incorrect characters, violating the DKIM standard (RFC 6376). Incompatibility between OpenSSL versions used for key generation and validation, as well as canonicalization issues during signing and verification, can also lead to errors. Strict adherence to DNS syntax rules, consistent canonicalization, and ensuring OpenSSL compatibility are crucial for resolution.
Technical article
Documentation from Google explains that strict adherence to DNS syntax rules is essential. For Google Workspace, they provide specific examples and guidelines for DKIM record formatting, which should be followed precisely.
11 Aug 2024 - Google
Technical article
Documentation from OpenSSL explains that if the version of OpenSSL used to generate the key is incompatible with the software validating it, errors can occur. Upgrading OpenSSL or regenerating the key with a compatible version is suggested.
14 Sep 2024 - OpenSSL
Are people using 4096-bit DKIM keys, and what is the recommended DKIM key length?
Can DKIM be set up on a subdomain, and which domain should be used for signing?
Can email signatures, especially via Exclaimer, cause SPF or DKIM failures and impact email delivery?
How do I find the DKIM selector for my domain in Dmarcian or Hubspot?
How do I fix DKIM alignment errors and configure DKIM signing for a custom domain in Microsoft 365 and is include:spf.mtasv.net required for mailchimp?
How do I fix DKIM failing body hash verification?