---
title: "DKIM署名: DKIM-Signatureヘッダーを解説 | AutoSPF"
description: "DKIM署名とは、メールのヘッダー（DKIM-Signatureヘッダー）に追加される暗号学的な署名で、受信者がメッセージを送信ドメインによって認可されたことを検証できるようにします。"
image: "https://autospf.com/images/og-default.png"
canonical: "https://autospf.com/ja/dkim/dkim-signature/"
---

# DKIM署名

DKIM署名とは、メールのヘッダー（DKIM-Signatureヘッダー）に追加される暗号学的な署名で、受信者がメッセージを送信ドメインによって認可され、転送中に改ざんされていないことを検証できるようにします。主要なタグには d（ドメイン）、s（セレクター）、b（署名）、bh（本文ハッシュ）があります。

このガイドは、[DKIM](/ja/dkim/)に関する完全ガイドの一部です。関連: [DKIMレコード](/ja/dkim/dkim-record/)、[DKIMが失敗する理由](/ja/dkim/why-dkim-fails/)。

**DKIM署名とは、メールのヘッダーに追加される暗号学的な署名（`DKIM-Signature`ヘッダーに含まれる）で、受信サーバーがメッセージを送信ドメインによって認可され、転送中に改ざんされていないことを検証できるようにするものです。** 署名は送信者が保持する秘密鍵で生成され、DNSに公開された対応する公開鍵と照合してチェックされます。

## DKIM-Signatureヘッダーの見た目

署名は、メッセージの先頭に付加される単一のヘッダーフィールドとして移動します。受信者が必要とするすべて、すなわち署名ドメイン、セレクター、どのヘッダーが署名されたか、本文のハッシュ、そして署名そのものを、セミコロンで区切られた一連の`tag=value`ペアに詰め込みます。

```
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
    d=example.com; s=selector1; t=1700000000;
    h=from:to:subject:date;
    bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=;
    b=Cg5Xje8kY0m5xT1pW2qL4vN8rH6dF3aZ9cU7bE0iQoR2sT4uV6wX8yZ1
    aB3cD5eF7gH9jK2lM4nP6qR8sT0uV2wX4yZ6aB8cD0eF2gH4jK6l=
```

このヘッダーは、メッセージがドメインを離れる前に送信者のメールサーバーによって挿入されます。改行とインデントは折り返しのためだけのもので、値は論理的には1つの連続した文字列です。

## DKIM署名のタグ

各タグは、検証というパズルの1ピースを運びます。署名者がこれらの値を選び、検証者はそれらを読み返して署名を再構築しチェックします。

| タグ    | 名前      | 目的                                           |
| ----- | ------- | -------------------------------------------- |
| v     | バージョン   | DKIMバージョン。常に1。                               |
| a     | アルゴリズム  | ハッシュと署名のアルゴリズム。例: rsa-sha256やed25519-sha256。 |
| d     | ドメイン    | 署名ドメイン — DKIMが認証するアイデンティティ。                  |
| s     | セレクター   | ドメインのDNSからどの公開鍵を取得するかを指定する。                  |
| h     | 署名ヘッダー  | 署名の対象となるヘッダーフィールドのコロン区切りリスト。                 |
| bh    | 本文ハッシュ  | （正規化された）メッセージ本文のハッシュ。                        |
| b     | 署名      | 実際の暗号学的署名、base64エンコードされたもの。                  |
| c     | 正規化     | ハッシュ化前にヘッダー/本文をどう標準化するか。例: relaxed/relaxed。  |
| t / x | タイムスタンプ | tはメッセージが署名された時刻。xは署名が失効する時刻。                 |

## 署名の仕組み（送信時）

メッセージが送信サーバーを離れるとき、DKIMは2つのことを行います。まず本文を正規化してハッシュ化し、その結果を`bh`に格納します。次に、`h`で指定されたヘッダー（およびDKIM-Signatureヘッダー自体を空の`b`とともに）を正規化し、そのブロックをハッシュ化して、そのハッシュをドメインの秘密鍵で署名します。結果として得られる署名が`b`の値になります。秘密鍵は送信者から決して外に出ないため、真のドメイン所有者だけが、検証を通過する署名を生成できます。

## 検証の仕組み（受信時）

受信サーバーは`DKIM-Signature`ヘッダーを読み取り、ドメイン（`d`）と[セレクター](/ja/dkim/dkim-selector/)を把握します。`<selector>._domainkey.<domain>`でDNSを照会し、[DKIMレコード](/ja/dkim/dkim-record/)から公開鍵を取得します。そして送信者の作業を繰り返します。本文を正規化してハッシュ化し、それを`bh`と比較し、署名されたヘッダーを正規化してハッシュ化し、公開鍵を使って`b`をそのヘッダーハッシュと照合してチェックします。本文ハッシュが一致し、かつ署名が検証されれば、DKIMは通過します。`bh`のチェックこそが、メッセージ本文への改ざんを検出するものです。たった1文字の変更でも異なるハッシュを生成し、チェックに失敗します。

## 署名が失敗するとき

DKIM署名は、受信者が見るメッセージが、送信者が署名したものと一致しなくなったときに常に失敗します。最もよくある原因は次のとおりです。

- **転送中の改変** — メーリングリスト、転送機能、一部のゲートウェイが件名を書き換えたり、フッターを追加したり、本文を再エンコードしたりして、本文ハッシュを壊す。
- **本文ハッシュの不一致** — 署名された本文部分への変更は`bh`を変えるため、鍵が正しくても検証が失敗する。
- **誤ったまたは欠落した鍵** — セレクターが、存在しない、失効した、または誤った公開鍵を保持するDNSレコードを指している。

原因と修正のより詳しい内訳については、[DKIMが失敗する理由](/ja/dkim/why-dkim-fails/)を参照してください。また、無料の[DKIMルックアップツール](/ja/tools/dkim-lookup/)を使って、セレクターの公開鍵が公開され、正しい形式であることを確認してください。

## よくある質問

### DKIM署名とは何ですか？

DKIM署名とは、メールのヘッダーの`DKIM-Signature`フィールドに追加される暗号学的な署名です。送信者は、選択したヘッダーと本文のハッシュに対して秘密鍵でこれを生成します。受信者はDNSにある公開鍵と照合して検証し、メッセージがそのドメインから送られ、改変されていないことを証明します。

### DKIM署名のb=タグは何を意味しますか？

`b=`タグは実際の署名を保持します。これは、正規化された署名ヘッダーのハッシュを送信ドメインの秘密鍵で署名して生成された、base64エンコードされた値です。受信者はそれをデコードし、DNSから取得した公開鍵と照合して検証します。署名されたヘッダーが転送中に変わっていれば、`b=`のチェックは失敗します。

### 転送後にDKIM署名が失敗するのはなぜですか？

転送機能やメーリングリストは、しばしばメッセージを改変します。フッターを追加したり、件名を書き換えたり、本文を再エンコードしたりします。DKIMは正確な本文と選択したヘッダーに署名するため、そのような変更はどれも計算されるハッシュを変え、署名された`bh`やヘッダーハッシュと一致しなくなります。その結果、元は有効だった署名も検証に失敗します。

### DKIMにおける本文ハッシュ（bh）とは何ですか？

`bh=`タグは、正規化後のメッセージ本文のハッシュで、`a`で指定されたアルゴリズムで計算されます。受信時、検証者は本文ハッシュを再計算して`bh`と比較します。不一致は本文が転送中に改変されたことを意味し、`b=`の暗号学的署名がチェックされる前に、署名は拒否されます。

Rated 5/5 on G2 · Trusted since 2018 

##  Trusted by 50,000+ domains 

### "AutoSPF Flattens SPF Records Seamlessly & Keeps Changes Logged - I am quite pleased with the product"

> It does what it promises to do, and does it very well. I appreciate that it keeps a log of changes made, which prevents many mistakes. A client's SPF record would have way too many lookups, but AutoSPF makes that problem go away. The length of the SPF record is typically not the issue; it's the amount of lookups in the record that are. AutoSPF "flattens" the record, automatically expanding the defined lookups to IP addresses or ranges. And it auto-updates the record when the un-flattened lookups change. 

 PJ 

Peter J.

 President · Small-Business (50 or fewer emp.) 

### "Helped us go beyond capacity"

> AutoSPF did exactly as described, it helped us get past our 10 lookup limit. Afterwards, we hit another limit regarding overall capacity and when contacted, they quickly provided us with a new solution to eliminate capacity issues entirely going forward, so now we can add as many SPF records as needed. They also provided us with a personalized support video explaining their new method in its entirety using our instance as the example. 

 VU 

Verified User

 Financial Services · Mid-Market (51-1000 emp.) 

### "Great service and great support"

> AutoSPF was easy to initially set up on our own and a great cost effective entry into spf flattening. Needed our first support assistance today and got great response including a video demonstrating the issue I was trying to solve, a quick fix, and more detailed followup. 

 GF 

Greg F.

 Mid-Market (51-1000 emp.) 

[Read our reviews on G2 ](https://www.g2.com/products/autospf/reviews)

```json
{"@context":"https://schema.org","@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com","logo":{"@type":"ImageObject","url":"https://autospf.com/images/autospf-logo.png"},"description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","parentOrganization":{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138883901","name":"DuoCircle LLC","url":"https://www.duocircle.com","sameAs":["https://www.wikidata.org/wiki/Q138883901","https://www.crunchbase.com/organization/duocircle-llc","https://www.linkedin.com/company/duocircle","https://github.com/duocircle"],"subOrganization":[{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138898167","name":"DMARC Report","url":"https://dmarcreport.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897912","name":"Phish Protection","url":"https://www.phishprotection.com"}]},"sameAs":["https://www.wikidata.org/wiki/Q138897474","https://www.linkedin.com/company/autospf","https://x.com/autospf01","https://www.facebook.com/autospf","https://github.com/duocircle","https://www.g2.com/products/autospf/reviews"],"aggregateRating":{"@type":"AggregateRating","ratingValue":"5.0","reviewCount":"21","bestRating":"5","worstRating":"1","url":"https://www.g2.com/products/autospf/reviews"},"contactPoint":{"@type":"ContactPoint","contactType":"customer support","url":"https://autospf.com/contact-us/"},"knowsAbout":["SPF Record Flattening","Sender Policy Framework","Email Authentication","DNS Management","DMARC","DKIM","Email Deliverability","SPF Lookup Limits"]}
```

```json
{"@context":"https://schema.org","@type":"WebSite","name":"AutoSPF","url":"https://autospf.com","description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","publisher":{"@type":"Organization","name":"AutoSPF","url":"https://autospf.com","logo":{"@type":"ImageObject","url":"https://autospf.com/images/autospf-logo.png"},"description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","parentOrganization":{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138883901","name":"DuoCircle LLC","url":"https://www.duocircle.com","sameAs":["https://www.wikidata.org/wiki/Q138883901","https://www.crunchbase.com/organization/duocircle-llc","https://www.linkedin.com/company/duocircle","https://github.com/duocircle"],"subOrganization":[{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138898167","name":"DMARC Report","url":"https://dmarcreport.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897912","name":"Phish Protection","url":"https://www.phishprotection.com"}]}}}
```

```json
{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"DKIM署名とは何ですか？","acceptedAnswer":{"@type":"Answer","text":"DKIM署名とは、メールのヘッダーの`DKIM-Signature`フィールドに追加される暗号学的な署名です。送信者は、選択したヘッダーと本文のハッシュに対して秘密鍵でこれを生成します。受信者はDNSにある公開鍵と照合して検証し、メッセージがそのドメインから送られ、改変されていないことを証明します。"}},{"@type":"Question","name":"DKIM署名のb=タグは何を意味しますか？","acceptedAnswer":{"@type":"Answer","text":"`b=`タグは実際の署名を保持します。これは、正規化された署名ヘッダーのハッシュを送信ドメインの秘密鍵で署名して生成された、base64エンコードされた値です。受信者はそれをデコードし、DNSから取得した公開鍵と照合して検証します。署名されたヘッダーが転送中に変わっていれば、`b=`のチェックは失敗します。"}},{"@type":"Question","name":"転送後にDKIM署名が失敗するのはなぜですか？","acceptedAnswer":{"@type":"Answer","text":"転送機能やメーリングリストは、しばしばメッセージを改変します。フッターを追加したり、件名を書き換えたり、本文を再エンコードしたりします。DKIMは正確な本文と選択したヘッダーに署名するため、そのような変更はどれも計算されるハッシュを変え、署名された`bh`やヘッダーハッシュと一致しなくなります。その結果、元は有効だった署名も検証に失敗します。"}},{"@type":"Question","name":"DKIMにおける本文ハッシュ（bh）とは何ですか？","acceptedAnswer":{"@type":"Answer","text":"`bh=`タグは、正規化後のメッセージ本文のハッシュで、`a`で指定されたアルゴリズムで計算されます。受信時、検証者は本文ハッシュを再計算して`bh`と比較します。不一致は本文が転送中に改変されたことを意味し、`b=`の暗号学的署名がチェックされる前に、署名は拒否されます。"}}]}
```

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://autospf.com/"},{"@type":"ListItem","position":2,"name":"DKIM","item":"https://autospf.com/ja/dkim/"},{"@type":"ListItem","position":3,"name":"DKIM","item":"https://autospf.com/ja/dkim/dkim-signature/"}]}
```

```json
{"@context":"https://schema.org","@type":"Product","name":"AutoSPF","url":"https://autospf.com","aggregateRating":{"@type":"AggregateRating","ratingValue":5,"reviewCount":21,"bestRating":5,"worstRating":1},"review":[{"@type":"Review","reviewRating":{"@type":"Rating","ratingValue":5,"bestRating":5},"author":{"@type":"Person","name":"Peter J.","jobTitle":"President"},"datePublished":"2026-03-10","reviewBody":"It does what it promises to do, and does it very well. I appreciate that it keeps a log of changes made, which prevents many mistakes. A client's SPF record would have way too many lookups, but AutoSPF makes that problem go away. The length of the SPF record is typically not the issue; it's the amount of lookups in the record that are. AutoSPF \"flattens\" the record, automatically expanding the defined lookups to IP addresses or ranges. And it auto-updates the record when the un-flattened lookups change.","name":"AutoSPF Flattens SPF Records Seamlessly & Keeps Changes Logged - I am quite pleased with the product","publisher":{"@type":"Organization","name":"G2","url":"https://www.g2.com"}},{"@type":"Review","reviewRating":{"@type":"Rating","ratingValue":5,"bestRating":5},"author":{"@type":"Person","name":"Verified User","jobTitle":"Financial Services"},"datePublished":"2025-07-31","reviewBody":"AutoSPF did exactly as described, it helped us get past our 10 lookup limit. Afterwards, we hit another limit regarding overall capacity and when contacted, they quickly provided us with a new solution to eliminate capacity issues entirely going forward, so now we can add as many SPF records as needed. They also provided us with a personalized support video explaining their new method in its entirety using our instance as the example.","name":"Helped us go beyond capacity","publisher":{"@type":"Organization","name":"G2","url":"https://www.g2.com"}},{"@type":"Review","reviewRating":{"@type":"Rating","ratingValue":5,"bestRating":5},"author":{"@type":"Person","name":"Greg F."},"datePublished":"2023-07-26","reviewBody":"AutoSPF was easy to initially set up on our own and a great cost effective entry into spf flattening. Needed our first support assistance today and got great response including a video demonstrating the issue I was trying to solve, a quick fix, and more detailed followup.","name":"Great service and great support","publisher":{"@type":"Organization","name":"G2","url":"https://www.g2.com"}}]}
```
