{"id":15973103,"url":"https://github.com/develar/go-pkcs12","last_synced_at":"2025-04-05T10:24:01.411Z","repository":{"id":57483357,"uuid":"157057416","full_name":"develar/go-pkcs12","owner":"develar","description":null,"archived":false,"fork":false,"pushed_at":"2018-11-15T14:35:53.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T21:15:17.933Z","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/develar.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}},"created_at":"2018-11-11T07:30:56.000Z","updated_at":"2018-11-15T14:35:55.000Z","dependencies_parsed_at":"2022-08-27T20:02:27.249Z","dependency_job_id":null,"html_url":"https://github.com/develar/go-pkcs12","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/develar%2Fgo-pkcs12","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/develar%2Fgo-pkcs12/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/develar%2Fgo-pkcs12/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/develar%2Fgo-pkcs12/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/develar","download_url":"https://codeload.github.com/develar/go-pkcs12/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247320472,"owners_count":20919791,"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-10-07T21:01:57.977Z","updated_at":"2025-04-05T10:24:01.392Z","avatar_url":"https://github.com/develar.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduce\n\nThis package code is derived from github.com/AGWA-forks/golang-crypto , and moved to be a independent package for PKCS12 encode and decode!\n\n## Demo\n\n```go\npackage main\n\nimport (\n\t\"io/ioutil\"\n\t\"log\"\n\t\"strconv\"\n\n\t\"github.com/lotus-wu/go-pkcs12\"\n)\n\nfunc main() {\n\tpfxData, _ := ioutil.ReadFile(\"a.p12\")\n\tpv, cer, err := pkcs12.DecodeAll(pfxData, \"123456\")\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\tlog.Println(pv)\n\tlog.Println(cer)\n\n\tid := int64(0)\n\tfor _, v := range cer {\n\t\tfilename := \"test\" + strconv.FormatInt(id, 10) + \".cer\"\n\t\tioutil.WriteFile(filename, v.Raw, 0666)\n\t\tid += 1\n\t}\n\n\tpfxDataNew, _ := pkcs12.Encode(pv, cer[0], cer[1:], \"123456\")\n\tioutil.WriteFile(\"1.p12\", pfxDataNew, 0666)\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelar%2Fgo-pkcs12","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelar%2Fgo-pkcs12","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelar%2Fgo-pkcs12/lists"}