{"id":13412669,"url":"https://github.com/toorop/go-dkim","last_synced_at":"2025-04-05T05:09:03.482Z","repository":{"id":31241054,"uuid":"34802484","full_name":"toorop/go-dkim","owner":"toorop","description":"DKIM package for golang","archived":false,"fork":false,"pushed_at":"2024-01-03T09:29:56.000Z","size":63,"stargazers_count":98,"open_issues_count":5,"forks_count":39,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-25T04:10:11.947Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toorop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-04-29T15:38:27.000Z","updated_at":"2024-09-23T12:56:18.000Z","dependencies_parsed_at":"2024-01-30T04:55:12.329Z","dependency_job_id":null,"html_url":"https://github.com/toorop/go-dkim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toorop%2Fgo-dkim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toorop%2Fgo-dkim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toorop%2Fgo-dkim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toorop%2Fgo-dkim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toorop","download_url":"https://codeload.github.com/toorop/go-dkim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289429,"owners_count":20914464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:01:27.604Z","updated_at":"2025-04-05T05:09:03.464Z","avatar_url":"https://github.com/toorop.png","language":"Go","funding_links":[],"categories":["邮件库`邮件管理和发送的go语言库`","Email","\u003cspan id=\"电子邮件-email\"\u003e电子邮件 Email\u003c/span\u003e","电子邮件","邮件库","Relational Databases","邮件"],"sub_categories":["SQL 查询语句构建库","Advanced Console UIs","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","检索及分析资料库","Search and Analytic Databases"],"readme":"# go-dkim\nDKIM package for Golang\n\n[![GoDoc](https://godoc.org/github.com/toorop/go-dkim?status.svg)](https://godoc.org/github.com/toorop/go-dkim)\n\n## Getting started\n\n### Install\n```\n \tgo get github.com/toorop/go-dkim\n```\nWarning: you need to use Go 1.4.2-master or 1.4.3 (when it will be available)\nsee https://github.com/golang/go/issues/10482 fro more info.\n\n### Sign email\n\n```go\nimport (\n\tdkim \"github.com/toorop/go-dkim\"\n)\n\nfunc main(){\n\t// email is the email to sign (byte slice)\n\t// privateKey the private key (pem encoded, byte slice )\t\n\toptions := dkim.NewSigOptions()\n\toptions.PrivateKey = privateKey\n\toptions.Domain = \"mydomain.tld\"\n\toptions.Selector = \"myselector\"\n\toptions.SignatureExpireIn = 3600\n\toptions.BodyLength = 50\n\toptions.Headers = []string{\"from\", \"date\", \"mime-version\", \"received\", \"received\"}\n\toptions.AddSignatureTimestamp = true\n\toptions.Canonicalization = \"relaxed/relaxed\"\n\terr := dkim.Sign(\u0026email, options)\n\t// handle err..\n\n\t// And... that's it, 'email' is signed ! Amazing© !!!\n}\n```\n\n### Verify\n```go\nimport (\n\tdkim \"github.com/toorop/go-dkim\"\n)\n\nfunc main(){\n\t// email is the email to verify (byte slice)\n\tstatus, err := Verify(\u0026email)\n\t// handle status, err (see godoc for status)\n}\n```\n\n## Todo\n\n- [ ] handle z tag (copied header fields used for diagnostic use)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoorop%2Fgo-dkim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoorop%2Fgo-dkim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoorop%2Fgo-dkim/lists"}