• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class DkimKeyRecord

A parsed DKIM key record from DNS (RFC 6376 §3.6.1). The record is stored as a TXT record at <selector>._domainkey.<domain> and contains tag-value pairs describing the public key and its constraints.

Inheritance
object
DkimKeyRecord
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Mail.Rfc.Dkim
Assembly: DRIT.Mail.dll
Syntax
public sealed class DkimKeyRecord

Constructors

View Source

DkimKeyRecord(string?, string, string?, IReadOnlyList<string>, string, IReadOnlyList<string>, string?)

Initializes a new instance of the DkimKeyRecord class.

Declaration
public DkimKeyRecord(string? version, string keyType, string? publicKey, IReadOnlyList<string> hashAlgorithms, string serviceType, IReadOnlyList<string> flags, string? notes)
Parameters
Type Name Description
string version
string keyType
string publicKey
IReadOnlyList<string> hashAlgorithms
string serviceType
IReadOnlyList<string> flags
string notes

Properties

View Source

Flags

Gets the flags (t=), or empty if not specified. Common values: "y" (testing), "s" (no subdomains).

Declaration
public IReadOnlyList<string> Flags { get; }
Property Value
Type Description
IReadOnlyList<string>
View Source

HashAlgorithms

Gets the acceptable hash algorithms (h=), or empty if not specified.

Declaration
public IReadOnlyList<string> HashAlgorithms { get; }
Property Value
Type Description
IReadOnlyList<string>
View Source

IsRevoked

Gets a value indicating whether the key has been revoked (p= is empty or absent).

Declaration
public bool IsRevoked { get; }
Property Value
Type Description
bool
View Source

IsTesting

Gets a value indicating whether the key is in testing mode (t= contains "y").

Declaration
public bool IsTesting { get; }
Property Value
Type Description
bool
View Source

KeyType

Gets the key type (k=). Defaults to "rsa".

Declaration
public string KeyType { get; }
Property Value
Type Description
string
View Source

NoSubdomains

Gets a value indicating whether the key must not be used for subdomains (t= contains "s").

Declaration
public bool NoSubdomains { get; }
Property Value
Type Description
bool
View Source

Notes

Gets the notes (n=), or null if absent.

Declaration
public string? Notes { get; }
Property Value
Type Description
string
View Source

PublicKey

Gets the public key data (p=, base64-encoded DER RSAPublicKey). Empty string means the key has been revoked. Null if the tag is absent.

Declaration
public string? PublicKey { get; }
Property Value
Type Description
string
View Source

ServiceType

Gets the service type (s=). Defaults to "email".

Declaration
public string ServiceType { get; }
Property Value
Type Description
string
View Source

Version

Gets the version tag (v=). Should be "DKIM1" if present. Defaults to "DKIM1".

Declaration
public string? Version { get; }
Property Value
Type Description
string

Methods

View Source

Parse(string)

Parses a DKIM key record (the full TXT record value).

Declaration
public static DkimKeyRecord Parse(string record)
Parameters
Type Name Description
string record

The key record text.

Returns
Type Description
DkimKeyRecord

The parsed DkimKeyRecord.

Exceptions
Type Condition
DkimException

Thrown if the record is malformed.

  • View Source
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX