{"id":16464529,"url":"https://github.com/deatil/zpem","last_synced_at":"2026-06-12T11:31:52.270Z","repository":{"id":190431041,"uuid":"678309944","full_name":"deatil/zpem","owner":"deatil","description":"A pem parse and encode library for Zig.","archived":false,"fork":false,"pushed_at":"2025-08-26T11:15:04.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-26T14:33:24.275Z","etag":null,"topics":["ecdsa-pem","parse-pem","pem","rsa-pem","zig","zig-pem"],"latest_commit_sha":null,"homepage":"https://github.com/deatil/zpem","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deatil.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-08-14T08:52:51.000Z","updated_at":"2025-08-26T11:15:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"649986b1-a14e-4871-8599-bc9c953a3dc4","html_url":"https://github.com/deatil/zpem","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"a237593f8d678ecd37e218ba03f245b6579e0d0b"},"previous_names":["deatil/zpem"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/deatil/zpem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fzpem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fzpem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fzpem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fzpem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deatil","download_url":"https://codeload.github.com/deatil/zpem/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fzpem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34243051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ecdsa-pem","parse-pem","pem","rsa-pem","zig","zig-pem"],"created_at":"2024-10-11T11:28:31.821Z","updated_at":"2026-06-12T11:31:52.260Z","avatar_url":"https://github.com/deatil.png","language":"Zig","funding_links":[],"categories":["Libraries","Data \u0026 Science"],"sub_categories":["Encryption"],"readme":"## zpem \n\nA pem parse and encode library for Zig.\n\n\n### Env\n\n - Zig \u003e= 0.16.0\n\n\n ### Adding zpem as a dependency\n\nAdd the dependency to your project:\n\n```sh\nzig fetch --save=zpem git+https://github.com/deatil/zpem#main\n```\n\nor use local path to add dependency at `build.zig.zon` file\n\n```zig\n.{\n    .dependencies = .{\n        .zpem = .{\n            .path = \"./lib/zpem\",\n        },\n        ...\n    },\n    ...\n}\n```\n\nAnd the following to your `build.zig` file:\n\n```zig\n    const zpem_dep = b.dependency(\"zpem\", .{});\n    exe.root_module.addImport(\"zpem\", zpem_dep.module(\"zpem\"));\n```\n\nThe `zpem` structure can be imported in your application with:\n\n```zig\nconst zpem = @import(\"zpem\");\n```\n\n\n### Get Starting\n\n* parse pem\n\n~~~zig\nconst std = @import(\"std\");\nconst zpem = @import(\"zpem\");\n\npub fn main(init: std.process.Init) !void {\n    _ = init;\n\n    const bytes =\n        \"-----BEGIN RSA PRIVATE-----\\n\" ++\n        \"ABC: thsasd   \\n\" ++\n        \"\\n\" ++\n        \"MIIBmTCCAUegAwIBAgIBKjAJBgUrDgMCHQUAMBMxETAPBgNVBAMTCEF0bGFudGlz\\n\" ++\n        \"MB4XDTEyMDcwOTAzMTAzOFoXDTEzMDcwOTAzMTAzN1owEzERMA8GA1UEAxMIQXRs\\n\" ++\n        \"YW50aXMwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAu+BXo+miabDIHHx+yquqzqNh\\n\" ++\n        \"Ryn/XtkJIIHVcYtHvIX+S1x5ErgMoHehycpoxbErZmVR4GCq1S2diNmRFZCRtQID\\n\" ++\n        \"AQABo4GJMIGGMAwGA1UdEwEB/wQCMAAwIAYDVR0EAQH/BBYwFDAOMAwGCisGAQQB\\n\" ++\n        \"gjcCARUDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDAzA1BgNVHQEE\\n\" ++\n        \"LjAsgBA0jOnSSuIHYmnVryHAdywMoRUwEzERMA8GA1UEAxMIQXRsYW50aXOCASow\\n\" ++\n        \"CQYFKw4DAh0FAANBAKi6HRBaNEL5R0n56nvfclQNaXiDT174uf+lojzA4lhVInc0\\n\" ++\n        \"ILwpnZ1izL4MlI9eCSHhVQBHEp2uQdXJB+d5Byg=\\n\" ++\n        \"-----END RSA PRIVATE-----\\n\";\n\n    const allocator = std.heap.page_allocator;\n    var p = try zpem.decode(allocator, bytes);\n    defer p.deinit();\n\n    std.debug.print(\"pem type: {s}\\n\", .{p.type});\n    std.debug.print(\"pem bytes: {x}\\n\", .{p.bytes});\n\n    // get header data\n    const header = p.headers.get(\"ABC\").?;\n    std.debug.print(\"pem header: {s}\\n\", .{header});\n}\n~~~\n\n* encode pem\n\n~~~zig\nconst std = @import(\"std\");\nconst zpem = @import(\"zpem\");\n\npub fn main(init: std.process.Init) !void {\n    _ = init;\n\n    const alloc = std.heap.page_allocator;\n    \n    var b = zpem.Block.init(allocator);\n    b.type = \"RSA PRIVATE\";\n    try b.headers.put(\"TTTYYY\", \"dghW66666\");\n    try b.headers.put(\"Proc-Type\", \"4,Encond\");\n    try b.bytes.appendSlice(\"pem bytes\");\n\n    const allocator = std.heap.page_allocator;\n    var encoded_pem = try zpem.encode(allocator, b);\n    defer alloc.free(encoded_pem);\n\n    std.debug.print(\"pem encoded: {s}\\n\", .{encoded_pem});\n}\n~~~\n\n\n### LICENSE\n\n*  The library LICENSE is `Apache2`, using the library need keep the LICENSE.\n\n\n### Copyright\n\n*  Copyright deatil(https://github.com/deatil).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeatil%2Fzpem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeatil%2Fzpem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeatil%2Fzpem/lists"}