{"id":32224773,"url":"https://github.com/dsully/perl-crypt-openssl-x509","last_synced_at":"2026-02-20T16:02:21.866Z","repository":{"id":508441,"uuid":"136015","full_name":"dsully/perl-crypt-openssl-x509","owner":"dsully","description":"Perl interface to OpenSSL's X509 module.","archived":false,"fork":false,"pushed_at":"2024-09-28T17:18:57.000Z","size":496,"stargazers_count":26,"open_issues_count":15,"forks_count":35,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-10-18T13:45:34.041Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"XS","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:36:34.000Z","updated_at":"2025-07-26T17:27:44.000Z","dependencies_parsed_at":"2024-08-02T13:28:20.388Z","dependency_job_id":null,"html_url":"https://github.com/dsully/perl-crypt-openssl-x509","commit_stats":{"total_commits":207,"total_committers":29,"mean_commits":7.137931034482759,"dds":0.5893719806763285,"last_synced_commit":"da7bc318400fb59e44c2ea243277d8683a97c396"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/dsully/perl-crypt-openssl-x509","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fperl-crypt-openssl-x509","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fperl-crypt-openssl-x509/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fperl-crypt-openssl-x509/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fperl-crypt-openssl-x509/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsully","download_url":"https://codeload.github.com/dsully/perl-crypt-openssl-x509/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fperl-crypt-openssl-x509/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29656589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-22T09:02:18.075Z","updated_at":"2026-02-20T16:02:21.850Z","avatar_url":"https://github.com/dsully.png","language":"XS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nCrypt::OpenSSL::X509 - Perl extension to OpenSSL's X509 API.\n\n# SYNOPSIS\n\n    use Crypt::OpenSSL::X509;\n\n    my $x509 = Crypt::OpenSSL::X509-\u003enew_from_file('cert.pem');\n\n    print $x509-\u003epubkey() . \"\\n\";\n    print $x509-\u003esubject() . \"\\n\";\n    print $x509-\u003ehash() . \"\\n\";\n    print $x509-\u003eemail() . \"\\n\";\n    print $x509-\u003eissuer() . \"\\n\";\n    print $x509-\u003eissuer_hash() . \"\\n\";\n    print $x509-\u003enotBefore() . \"\\n\";\n    print $x509-\u003enotAfter() . \"\\n\";\n    print $x509-\u003emodulus() . \"\\n\";\n    print $x509-\u003eexponent() . \"\\n\";\n    print $x509-\u003efingerprint_md5() . \"\\n\";\n    print $x509-\u003efingerprint_sha256() . \"\\n\";\n    print $x509-\u003eas_string() . \"\\n\";\n\n    my $x509 = Crypt::OpenSSL::X509-\u003enew_from_string(\n      $der_encoded_data, Crypt::OpenSSL::X509::FORMAT_ASN1\n    );\n\n    # given a time offset of $seconds, will the certificate be valid?\n    if ($x509-\u003echeckend($seconds)) {\n      # cert is expired at $seconds offset\n    } else {\n      # cert is ok at $seconds offset\n    }\n\n    my $exts = $x509-\u003eextensions_by_oid();\n\n    foreach my $oid (keys %$exts) {\n      my $ext = $$exts{$oid};\n      print $oid, \" \", $ext-\u003eobject()-\u003ename(), \": \", $ext-\u003evalue(), \"\\n\";\n    }\n\n# ABSTRACT\n\n    Crypt::OpenSSL::X509 - Perl extension to OpenSSL's X509 API.\n\n# DESCRIPTION\n\n    This implement a large majority of OpenSSL's useful X509 API.\n\n    The email() method supports both certificates where the\n    subject is of the form:\n    \"... CN=Firstname lastname/emailAddress=user@domain\", and also\n    certificates where there is a X509v3 Extension of the form\n    \"X509v3 Subject Alternative Name: email=user@domain\".\n\n## EXPORT\n\nNone by default.\n\nOn request:\n\n        FORMAT_UNDEF FORMAT_ASN1 FORMAT_TEXT FORMAT_PEM\n        FORMAT_PKCS12 FORMAT_SMIME FORMAT_ENGINE FORMAT_IISSGC\n\n# FUNCTIONS\n\n## X509 CONSTRUCTORS\n\n- new ( )\n\n    Create a new X509 object.\n\n- new\\_from\\_string ( STRING \\[ FORMAT \\] )\n- new\\_from\\_file ( FILENAME \\[ FORMAT \\] )\n\n    Create a new X509 object from a string or file. `FORMAT` should be `FORMAT_ASN1` or `FORMAT_PEM`.\n\n## X509 ACCESSORS\n\n- subject\n\n    Subject name as a string.\n\n- issuer\n\n    Issuer name as a string.\n\n- issuer\\_hash\n\n    Issuer name hash as a string.\n\n- serial\n\n    Serial number as a string.\n\n- hash\n\n    Alias for subject\\_hash\n\n- subject\\_hash\n\n    Subject name hash as a string.\n\n- notBefore\n\n    `notBefore` time as a string.\n\n- notAfter\n\n    `notAfter` time as a string.\n\n- email\n\n    Email addresses as string, if multiple addresses found, they are separated by a space (' ').\n\n- version\n\n    Certificate version as a string.\n\n- sig\\_alg\\_name\n\n    Signature algorithm name as a string.\n\n- key\\_alg\\_name\n\n    Public key algorithm name as a string.\n\n- curve\n\n    Name of the EC curve used in the public key.\n\n## X509 METHODS\n\n- subject\\_name ( )\n- issuer\\_name ( )\n\n    Return a Name object for the subject or issuer name. Methods for handling Name objects are given below.\n\n- is\\_selfsigned ( )\n\n    Return Boolean value if subject and issuer name are the same.\n\n- as\\_string ( \\[ FORMAT \\] )\n\n    Return the certificate as a string in the specified format. `FORMAT` can be one of `FORMAT_PEM` (the default) or `FORMAT_ASN1`.\n\n- modulus ( )\n\n    Return the modulus for an RSA public key as a string of hex digits. For DSA and EC return the public key. Other algorithms are not supported.\n\n- bit\\_length ( )\n\n    Return the length of the modulus as a number of bits.\n\n- fingerprint\\_md5 ( )\n- fingerprint\\_sha1 ( )\n- fingerprint\\_sha224 ( )\n- fingerprint\\_sha256 ( )\n- fingerprint\\_sha384 ( )\n- fingerprint\\_sha512 ( )\n\n    Return the specified message digest for the certificate.\n\n- checkend( OFFSET )\n\n    Given an offset in seconds, will the certificate be expired? Returns True if the certificate will be expired. False otherwise.\n\n- pubkey ( )\n\n    Return the RSA, DSA, or EC public key.\n\n- num\\_extensions ( )\n\n    Return the number of extensions in the certificate.\n\n- extension ( INDEX )\n\n    Return the Extension specified by the integer `INDEX`.\n    Methods for handling Extension objects are given below.\n\n- extensions\\_by\\_oid ( )\n- extensions\\_by\\_name ( )\n- extensions\\_by\\_long\\_name ( )\n\n    Return a hash of Extensions indexed by OID or name.\n\n- has\\_extension\\_oid ( OID )\n\n    Return true if the certificate has the extension specified by `OID`.\n\n- subjectaltname ( )\n\n    Uses Convert::ASN1 to extract the Subject Alternative Names from the X509 object.\n    subjectaltname ( ) returns an array of \"rfc822Name\"s\n\n        [\n            {\n                'rfc822Name' =\u003e 'altuser@mpi-sws.org'\n            },\n            {\n                'rfc822Name' =\u003e 'user@mpi-sws.org'\n            },\n        ]\n\n## X509::Extension METHODS\n\n- critical ( )\n\n    Return a value indicating if the extension is critical or not.\n    FIXME: the value is an ASN.1 BOOLEAN value.\n\n- object ( )\n\n    Return the ObjectID of the extension.\n    Methods for handling ObjectID objects are given below.\n\n- value ( )\n\n    Return the value of the extension as an asn1parse(1) style hex dump.\n\n- as\\_string ( )\n\n    Return a human-readable version of the extension as formatted by X509V3\\_EXT\\_print. Note that this will return an empty string for OIDs with unknown ASN.1 encodings.\n\n## X509::ObjectID METHODS\n\n- name ( )\n\n    Return the long name of the object as a string.\n\n- oid ( )\n\n    Return the numeric dot-separated form of the object identifier as a string.\n\n## X509::Name METHODS\n\n- as\\_string ( )\n\n    Return a string representation of the Name\n\n- entries ( )\n\n    Return an array of Name\\_Entry objects. Methods for handling Name\\_Entry objects are given below.\n\n- has\\_entry ( TYPE \\[ LASTPOS \\] )\n- has\\_long\\_entry ( TYPE \\[ LASTPOS \\] )\n- has\\_oid\\_entry ( TYPE \\[ LASTPOS \\] )\n\n    Return true if a name has an entry of the specified `TYPE`. Depending on the function the `TYPE` may be in the short form (e.g. `CN`), long form (`commonName`) or OID (`2.5.4.3`). If `LASTPOS` is specified then the search is made from that index rather than from the start.\n\n- get\\_index\\_by\\_type ( TYPE \\[ LASTPOS \\] )\n- get\\_index\\_by\\_long\\_type ( TYPE \\[ LASTPOS \\] )\n- get\\_index\\_by\\_oid\\_type ( TYPE \\[ LASTPOS \\] )\n\n    Return the index of an entry of the specified `TYPE` in a name. Depending on the function the `TYPE` may be in the short form (e.g. `CN`), long form (`commonName`) or OID (`2.5.4.3`). If `LASTPOS` is specified then the search is made from that index rather than from the start.\n\n- get\\_entry\\_by\\_type ( TYPE \\[ LASTPOS \\] )\n- get\\_entry\\_by\\_long\\_type ( TYPE \\[ LASTPOS \\] )\n\n    These methods work similarly to get\\_index\\_by\\_\\* but return the Name\\_Entry rather than the index.\n\n## X509::Name\\_Entry METHODS\n\n- as\\_string ( \\[ LONG \\] )\n\n    Return a string representation of the Name\\_Entry of the form `typeName=Value`. If `LONG` is 1, the long form of the type is used.\n\n- type ( \\[ LONG \\] )\n\n    Return a string representation of the type of the Name\\_Entry. If `LONG` is 1, the long form of the type is used.\n\n- value ( )\n\n    Return a string representation of the value of the Name\\_Entry.\n\n- is\\_printableString ( )\n- is\\_ia5string ( )\n- is\\_utf8string ( )\n- is\\_asn1\\_type ( \\[ASN1\\_TYPE\\] )\n\n    Return true if the Name\\_Entry value is of the specified type. The value of `ASN1_TYPE` should be as listed in OpenSSL's `asn1.h`.\n\n# ISSUE REPORTING\n\nPlease report any bugs or feature requests using **GitHub**.\n\n- [GitHub Issues](https://github.com/dsully/perl-crypt-openssl-x509/issues)\n\n# SEE ALSO\n\n- [OpenSSL website](https://www.openssl.org/)\n- [Crypt::OpenSSL::RSA](https://metacpan.org/pod/Crypt::OpenSSL::RSA)\n- [Crypt::OpenSSL::Bignum](https://metacpan.org/pod/Crypt::OpenSSL::Bignum)\n- [Crypt::OpenSSL::Guess](https://metacpan.org/pod/Crypt::OpenSSL::Guess)\n\n# AUTHOR\n\n- Dan Sully, original author\n- Jonas Brømsø, current maintainer\n- Please see the [\"ACKNOWLEDGEMENTS\"](#acknowledgements) section for a list of contributors.\n\n# ACKNOWLEDGEMENTS\n\nIn alphabetical order.\n\n- @eserte\n- @kmx\n- @stphnlyd\n- Ashley Hindmarsh @bestscarper\n- Bernhard M. Wiedemann @bmwiedemann\n- Brad Davidson @brandond\n- Daniel Kahn Gillmor\n- Daniel Risacher\n- David O'Callaghan\n- David Steinbrunner @dsteinbrunner\n- dsteinwand\n- Florian Schlichting @fschlich\n- IKEDA Soji @ikedas\n- James Hunt @jhunt\n- James Rouzier @jrouzierinverse\n- Johanna @0xxon\n- Jonas Brømsø @jonasbn\n- Louise Doran\n- Michael McClimon @mmcclimon\n- Michal Josef Špaček @michal-josef-spacek\n- Neil Bowers @neilb\n- Nicholas Harteau\n- Otmar Lendl\n- Patrick C. @errror\n- Patrick Cernko\n- Petr Pisar @ppisar\n- pi-rho\n- Salvador Fandiño @salva\n- Sebastian Andrzej Siewior\n- Sho Nakatani @laysakura\n- Shoichi Kaji @skaji\n- Timothy Legge @timlegge \n- Todd Rinaldo @toddr\n- Uli Scholler\n\n# COPYRIGHT AND LICENSE\n\nCopyright 2004-2022 by Dan Sully\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsully%2Fperl-crypt-openssl-x509","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsully%2Fperl-crypt-openssl-x509","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsully%2Fperl-crypt-openssl-x509/lists"}