{"id":32216293,"url":"https://github.com/dsully/perl-crypt-openssl-pkcs12","last_synced_at":"2025-10-22T07:57:54.654Z","repository":{"id":508424,"uuid":"135998","full_name":"dsully/perl-crypt-openssl-pkcs12","owner":"dsully","description":"Perl interface to OpenSSL's PKCS module.","archived":false,"fork":false,"pushed_at":"2024-10-01T14:47:16.000Z","size":459,"stargazers_count":9,"open_issues_count":2,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-10-22T07:57:51.289Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsully.png","metadata":{"files":{"readme":"README.md","changelog":"Changes.md","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":"2009-02-24T04:25:07.000Z","updated_at":"2025-09-09T23:39:33.000Z","dependencies_parsed_at":"2024-04-18T11:47:22.307Z","dependency_job_id":"c7ad7934-046d-4dab-a6d9-1b6ac3870b41","html_url":"https://github.com/dsully/perl-crypt-openssl-pkcs12","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/dsully/perl-crypt-openssl-pkcs12","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fperl-crypt-openssl-pkcs12","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fperl-crypt-openssl-pkcs12/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fperl-crypt-openssl-pkcs12/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fperl-crypt-openssl-pkcs12/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsully","download_url":"https://codeload.github.com/dsully/perl-crypt-openssl-pkcs12/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fperl-crypt-openssl-pkcs12/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280402184,"owners_count":26324587,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"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":[],"created_at":"2025-10-22T07:57:51.478Z","updated_at":"2025-10-22T07:57:54.646Z","avatar_url":"https://github.com/dsully.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nCrypt::OpenSSL::PKCS12 - Perl extension to OpenSSL's PKCS12 API.\n\n# SYNOPSIS\n\n    use Crypt::OpenSSL::PKCS12;\n\n    my $pass   = \"your password\";\n    my $pkcs12 = Crypt::OpenSSL::PKCS12-\u003enew_from_file('cert.p12');\n\n    print $pkcs12-\u003ecertificate($pass);\n    print $pkcs12-\u003eprivate_key($pass);\n\n    if ($pkcs12-\u003emac_ok($pass)) {\n    ...\n\n    # Creating a file\n    $pkcs12-\u003ecreate('test-cert.pem', 'test-key.pem', $pass, 'out.p12', 'friendly name');\n\n\n    # Creating a string\n    my $pksc12_data = $pkcs12-\u003ecreate_as_string('test-cert.pem', 'test-key.pem', $pass, 'friendly name');\n\n    # Reproducing OpenSSL's info\n    my $info = $pkcs12-\u003einfo($pass);\n\n    # Accessing OpenSSL's info as a hash\n    my $info_hash = $pkcs12-\u003einfo_as_hash($pass);\n\n# VERSION\n\nThis documentation describes version 1.94 of Crypt::OpenSSL::PKCS12\n\n# DESCRIPTION\n\nPKCS12 is a file format for storing cryptography objects as a single file or string. PKCS12 is commonly used to bundle a private key with its X.509 certificate or to bundle all the members of a chain of trust.\n\nThis distribution implements a subset of OpenSSL's PKCS12 API.\n\n# SUBROUTINES/METHODS\n\n- new( )\n- legacy\\_support ( )\n\n    Check whether the openssl version installed supports the legacy provider.\n\n- new\\_from\\_string( `$string` )\n- new\\_from\\_file( `$filename` )\n\n    Create a new Crypt::OpenSSL::PKCS12 instance.\n\n- certificate( \\[`$pass`\\] )\n\n    Get the Base64 representation of the certificate.\n\n- ca\\_certificate( \\[`$pass`\\] )\n\n    Get the Base64 representation of the CA certificate chain.\n\n- private\\_key( \\[`$pass`\\] )\n\n    Get the Base64 representation of the private key.\n\n- as\\_string( \\[`$pass`\\] )\n\n    Get the binary represenation as a string.\n\n- mac\\_ok( \\[`$pass`\\] )\n\n    Verifiy the certificates Message Authentication Code\n\n- changepass( `$old`, `$new` )\n\n    Change a certificate's password.\n\n- create( `$cert`, `$key`, `$pass`, `$output_file`, `$friendly_name` )\n\n    Create a new PKCS12 certificate. $cert \u0026 $key may either be strings or filenames.\n\n    `$friendly_name` is optional.\n\n- create\\_as\\_string( `$cert`, `$key`, `$pass`, `$friendly_name` )\n\n    Create a new PKCS12 certificate string. $cert \u0026 $key may either be strings or filenames.\n\n    `$friendly_name` is optional.\n\n    Returns a string holding the PKCS12 certicate.\n\n- info( `$pass` )\n\n    Returns a string containing the output of information about the pkcs12 file in\n    the same format as produced by the openssl command:\n\n        openssl pkcs12 -in certs/test_le_1.1.p12 -info -nodes\n\n- info\\_as\\_hash( `$pass` )\n\n    Places the information about the pkcs12 file, the certificates and keys\n    in a hash.\n\n    The format of the hash is complex to represent the data in the PKCS12 file:\n\n    Essentially, the hash follows the format of the -info output.\n\n    1\\. pkcs7\\_data and pkcs7\\_encrypted\\_data are arrays as more than one of each can exist\n    2\\. mac provieds the top level mac parameters for the file\n    3\\. safe\\_contents\\_bag is an array that contains an array of bags\n    4\\. bags is an array of bags\n    5\\. a bag is a container for a key or certificate\n\n    Each bag has a type and the following are available:\n\n    1\\. key\\_bag\n    2\\. certificate\\_bag\n    3\\. shrouded\\_keybag\n    4\\. secret\\_bag\n    5\\. safe\\_contents\\_bag\n\n    {\n        mac                    {\n            digest        \"sha1\",\n            iteration     2048,\n            length        20,\n            salt\\_length   20\n        },\n        pkcs7\\_data             \\[\n            \\[0\\] {\n                    bags   \\[\n                        \\[0\\] {\n                                bag\\_attributes   {\n                                    friendlyName   \"...\",\n                                    localKeyID     \"...\" (dualvar: 54)\n                                },\n                                key              \"...\",\n                                key\\_attributes   {\n                                    \"X509v3 Key Usage\"   10\n                                },\n                                parameters       {\n                                    iteration        10000,\n                                    nid\\_long\\_name    \"PBKDF2\",\n                                    nid\\_short\\_name   \"PBKDF2\"\n                                },\n                                type             \"shrouded\\_keybag\"\n                            }\n                    \\]\n                },\n            \\[1\\] {\n                    safe\\_contents\\_bag   \\[\n                        \\[0\\] {\n                                bags   \\[\n                                    \\[0\\] {\n                                            bag\\_attributes   {\n                                                localKeyID   \"01\" (dualvar: 1)\n                                                friendlyName   \"\",\n                                            },\n                                            cert             \"...\".\n                                            issuer           \"...\",\n                                            subject          \"...\",\n                                            type             \"certificate\\_bag\"\n                                            }\n                                \\],\n                                type   \"safe\\_contents\\_bag\"\n                            }\n                    \\]\n                },\n            \\[2\\] {\n                    bags   \\[\n                        \\[0\\] {\n                                bag\\_attributes   {\n                                    localKeyID   \"02\" (dualvar: 2)\n                                },\n                                cert             \"...\",\n                                issuer           \"...\",\n                                subject          \"...\",\n                                type             \"certificate\\_bag\"\n                            }\n                    \\]\n                },\n        \\],\n        pkcs7\\_encrypted\\_data   \\[\n            \\[0\\] {\n                    bags         \\[\n                        \\[0\\] {\n                                bag\\_attributes   {\n                                    2.16.840.1.113894.746875.1.1   \"\u003cUnsupported tag 6\u003e\",\n                                    friendlyName                   \"...\"\n                                },\n                                cert             \"...\",\n                                issuer           \"...\",\n                                subject          \"...\",\n                                type             \"certificate\\_bag\"\n                            },\n                        \\[1\\] {\n                                bag\\_attributes   {\n                                    friendlyName   \"...\",\n                                    localKeyID     \"...\" (dualvar: 54)\n                                },\n                                cert             \"...\",\n                                issuer           \"...\",\n                                subject          \"...\",\n                                type             \"certificate\\_bag\"\n                            }\n                    \\],\n                    parameters   {\n                        iteration        10000,\n                        nid\\_long\\_name    \"PBKDF2\",\n                        nid\\_short\\_name   \"PBKDF2\"\n                    }\n                }\n        \\]\n    }\n\n# EXPORTS\n\nNone by default.\n\nOn request:\n\n- `NOKEYS`\n- `NOCERTS`\n- `INFO`\n- `CLCERTS`\n- `CACERTS`\n\n# DIAGNOSTICS\n\nNo diagnostics are documented at this time\n\n# CONFIGURATION AND ENVIRONMENT\n\nNo special environment or configuration is required.\n\n# DEPENDENCIES\n\nThis distribution has the following dependencies\n\n- An installation of OpenSSL, either version 1.X.X or version 3.X.X\n- Perl 5.8\n\n# SEE ALSO\n\n- OpenSSL(1) ([HTTP version with OpenSSL.org](https://www.openssl.org/docs/man1.1.1/man1/openssl.html))\n- [Crypt::OpenSSL::X509](https://metacpan.org/pod/Crypt::OpenSSL::X509)\n- [Crypt::OpenSSL::RSA](https://metacpan.org/pod/Crypt::OpenSSL::RSA)\n- [Crypt::OpenSSL::Bignum](https://metacpan.org/pod/Crypt::OpenSSL::Bignum)\n- [OpenSSL.org](https://www.openssl.org/)\n- [Wikipedia: PKCS12](https://en.wikipedia.org/wiki/PKCS_12)\n- [RFC:7292: \"PKCS #12: Personal Information Exchange Syntax v1.1\"](https://datatracker.ietf.org/doc/html/rfc7292)\n\n# INCOMPATIBILITIES\n\nCurrently the library has been updated to support both OpenSSL 1.X.X and OpenSSL 3.X.X\n\n# BUGS AND LIMITATIONS\n\nPlease see the [GitHub repository](https://github.com/dsully/perl-crypt-openssl-pkcs12/issues) for known issues.\n\n# AUTHOR\n\n- Dan Sully, \u003cdaniel@cpan.org\u003e\n\nCurrent maintainer\n\n- jonasbn\n\n# CONTRIBUTORS\n\nIn alphabetical order, contributors, bug reporters and all\n\n- @mmuehlenhoff\n- @sectokia\n- @SmartCodeMaker\n- Alexandr Ciornii, @chorny\n- Christopher Hoskin, @mans0954\n- Daisuke Murase, @typester\n- Darko Prelec, @dprelec\n- David Steinbrunner, @dsteinbrunner\n- Gianni Ceccarelli, @dakkar\n- Giuseppe Di Terlizzi, @giterlizzi\n- H.Merijn Brand, @tux\n- Hakim, @osfameron\n- J. Nick Koston, @bdraco\n- James Rouzier, @jrouzierinverse\n- jonasbn. @jonasbn\n- Kelson, @kelson42\n- Lance Wicks, @lancew\n- Leonid Antonenkov\n- Masayuki Matsuki, @songmu\n- Mikołaj Zalewski\n- Shoichi Kaji\n- Slaven Rezić\n- Timothy Legge, @timlegge\n- Todd Rinaldo, @toddr\n\n# LICENSE AND COPYRIGHT\n\nCopyright 2004-2024 by Dan Sully\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself, either Perl version 5.8.8 or,\nat your option, any later version of Perl 5 you may have available.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsully%2Fperl-crypt-openssl-pkcs12","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsully%2Fperl-crypt-openssl-pkcs12","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsully%2Fperl-crypt-openssl-pkcs12/lists"}