{"id":25703614,"url":"https://github.com/tikhop/asn1swift","last_synced_at":"2025-04-30T07:22:04.336Z","repository":{"id":44375636,"uuid":"283577989","full_name":"tikhop/ASN1Swift","owner":"tikhop","description":"ASN.1 Decoder in swift.","archived":false,"fork":false,"pushed_at":"2024-04-27T22:43:09.000Z","size":260,"stargazers_count":35,"open_issues_count":0,"forks_count":14,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T19:54:26.403Z","etag":null,"topics":["asn1","asn1-decoder","decodable","decoder","encodable","encoder","in-app-receipt","pkcs7","swift","x690"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tikhop.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}},"created_at":"2020-07-29T18:51:42.000Z","updated_at":"2025-02-02T10:09:30.000Z","dependencies_parsed_at":"2024-04-26T00:09:21.622Z","dependency_job_id":"e023bad5-93d2-46fa-b879-14eb6d65b07a","html_url":"https://github.com/tikhop/ASN1Swift","commit_stats":{"total_commits":79,"total_committers":6,"mean_commits":"13.166666666666666","dds":"0.15189873417721522","last_synced_commit":"403cd95194e6a962e16db7c0d373d89fce83e0f7"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikhop%2FASN1Swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikhop%2FASN1Swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikhop%2FASN1Swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikhop%2FASN1Swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tikhop","download_url":"https://codeload.github.com/tikhop/ASN1Swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251658625,"owners_count":21622899,"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":["asn1","asn1-decoder","decodable","decoder","encodable","encoder","in-app-receipt","pkcs7","swift","x690"],"created_at":"2025-02-25T05:32:46.458Z","updated_at":"2025-04-30T07:22:04.301Z","avatar_url":"https://github.com/tikhop.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"left\"\u003e\n\u003cimg height=\"170\" src=\"https://github.com/tikhop/ASN1Swift/blob/master/www/logo.png\" /\u003e\n\u003c/p\u003e\n\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/ASN1Swift.svg)](https://cocoapods.org/pods/ASN1Swift)\n[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)\n[![Platform](https://img.shields.io/cocoapods/p/ASN1Swift.svg?style=flat)]()\n[![GitHub license](https://img.shields.io/badge/license-BSD3-blue.svg)](https://raw.githubusercontent.com/tikhop/ASN1Swift/master/LICENSE)\n\nASN1Swift provides a transparent interface to decode ASN.1 data structures. The ASN.1 Data Structure must be encoded using BER/DER Encoding Rules. To simplify encoding and decoding process ASN1Swift implement Encoder/Decoder protocol provided by swift foundation. In other words it works preciesly the same as JSONEncoder/JSONDecoder. \n\nInstallation\n------------\n\n### CocoaPods\n\nTo integrate ASN1Swift into your project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nplatform :ios, '13.0'\n\ntarget 'YOUR_TARGET' do\nuse_frameworks!\n\npod 'ASN1Swift'\nend\n\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\nIn any swift file you'd like to use ASN1Swift, import the framework with `import ASN1Swift`.\n\n### Swift Package Manager\n\nTo integrate using Apple's Swift package manager, add the following as a dependency to your `Package.swift`:\n\n```swift\n.package(url: \"https://github.com/tikhop/ASN1Swift.git\", .branch(\"master\"))\n```\n\nThen, specify `\"ASN1Swift\"` as a dependency of the Target in which you wish to use ASN1Swift.\n\nLastly, run the following command:\n```swift\nswift package update\n```\n\n### Carthage\n\nMake the following entry in your Cartfile:\n\n```\ngithub \"tikhop/ASN1Swift\" \n```\n\nThen run `carthage update`.\n\nIf this is your first time using Carthage in the project, you'll need to go through some additional steps as explained [over at Carthage](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application).\n\n\n### Requirements\n\n- iOS 12.0+ / OSX 10.13+\n- Swift 5.9+\n\nExample\n-------------\n\n#### Decoding InAppReceipt \n\n```swift\n\nlet asn1Decoder = ASN1Decoder()\nlet r = try! asn1Decoder.decode(Receipt.self, from: Data(...))\n\nstruct Receipt: ASN1Decodable\n{\n    static var template: ASN1Template\n    {\n        return ASN1Template.universal(16).constructed()\n    }\n\n    var oid: ASN1SkippedField\n    var signedData: SignedData\n\n\tenum CodingKeys: ASN1CodingKey\n\t{\n        case oid\n\t\tcase signedData\n\n        var template: ASN1Template\n        {\n            switch self\n            {\n                case .oid:\n                    return .universal(ASN1Identifier.Tag.objectIdentifier)\n\t\t\t\tcase .signedData:\n                    return SignedData.template\n            }\n        }\n    }\n}\n\n....\n``` \n\n## Benchmarks\n\nLibrary                                                        | Decoding Time\n-------------------------------------------------------------- | ------------------\nASN1Swift                                                      | 0.154 seconds \n[filom/ASN1Decoder](https://github.com/filom/ASN1Decoder)      | 1.032 seconds\n[asn1c](https://github.com/vlm/asn1c)\t\t\t       | ???\n[mrdepth/ASN1Decoder](https://github.com/mrdepth/ASN1Decoder)  | ???\n\n\n## License\n\nASN1Swift is released under a BSD-3-Clause. See [LICENSE](https://github.com/tikhop/ASN1Swift/blob/master/LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftikhop%2Fasn1swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftikhop%2Fasn1swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftikhop%2Fasn1swift/lists"}