A private key to sign with, for one domain and selector, and the key record to publish for it.
{:ok, key} = Sovite.DKIM.SigningKey.from_pem(File.read!(path), "example.com", "s2026")
Sovite.DKIM.SigningKey.dns_name(key) #=> "s2026._domainkey.example.com"
Sovite.DKIM.SigningKey.dns_record(key) #=> "v=DKIM1; k=rsa; p=MIIBIjANBg..."Keys are PEM files, as openssl genpkey writes them or generate/2
returns: PKCS#8 (PRIVATE KEY), or for RSA also PKCS#1
(RSA PRIVATE KEY). RSA keys must have at least 1024 bits; 2048 is
the usual size (RFC 8301 §3.2).
Summary
Functions
The a= tag value.
The DNS name the key record goes at.
The key record (RFC 6376 §3.6.1) to publish at dns_name/1.
Loads a private key from PEM data.
Generates a new private key as PKCS#8 PEM: :rsa with bits (2048 by
default) or :ed25519.
Signs data. For Ed25519 the SHA-256 hash of the data is signed (RFC 8463 §3).
Types
Functions
The a= tag value.
The DNS name the key record goes at.
The key record (RFC 6376 §3.6.1) to publish at dns_name/1.
Loads a private key from PEM data.
@spec generate(:rsa | :ed25519, pos_integer()) :: binary()
Generates a new private key as PKCS#8 PEM: :rsa with bits (2048 by
default) or :ed25519.
Signs data. For Ed25519 the SHA-256 hash of the data is signed (RFC 8463 §3).