Commit 85b6e81e authored by Colin Shea's avatar Colin Shea

domain key helper method

parent 8773b691
......@@ -35,3 +35,6 @@ tlsa "@", 443, :tcp, 0, 0, 1, "e36d9e402c6308273375b68297f7ae207521238f0cd812622
# Wildcard records
a "*.user", "192.168.1.100"
mx "*.user", "mail"
domainkey "google", "rsa", "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8it8iFFspQzey9IbqmjcmuYe9ScVCxnYKqdI+qCBIGy9rV+EqHqW6acjPcoIcodcJ4XQxIOUQ5XrC0ZNL68k7Vi6p0lwCgBpsIrHYDyujL2NHm11plVcCFCJKbWdu9v7eiWOeUCtPNX/QIaGLUDjGM0twXYaMuwvyd3RA8AXJ2QIDAQAB"
domainkey "google2", "rsa", "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8it8iFFspQzey9IbqmjcmuYe9ScVCxnYKqdI+qCBIGy9rV+EqHqW6acjPcoIcodcJ4XQxIOUQ5XrC0ZNL68k7Vi6p0lwCgBpsIrHYDyujL2NHm11plVcCFCJKbWdu9v7eiWOeUCtPNX/QIaGLUDjGM0twXYaMuwvyd3RA8AXJ2QIDAQAB", 2400
......@@ -161,6 +161,17 @@ class Zone
certificate_usage: usage, selector: selector, matching_type: matching, data: data
end
def domainkey(*args)
ttl = extract_ttl! args
selector = args.shift
type = args.shift.downcase
pubkey = args.shift
raise ArgumentError, "invalid key type, only RSA supported: #{type}" if type != "rsa"
push :txt, "#{selector}._domainkey", ttl, text: "v=DKIM1; k=#{type}; p=#{pubkey}"
end
# name in not-reversed order
def ptr(name, host, ttl=nil)
host = "#{host}." if host[-1] != '.'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment