Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gitpan/Crypt-X509
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: openxpki/Crypt-X509
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on Nov 8, 2019

  1. convert Tab to whitespace

    oliwel committed Nov 8, 2019
    Copy the full SHA
    ef56eca View commit details
  2. Extend OID maps, change shortnames l=>L S=>ST

    Adds new items to the OID map and CHANGES the shortnames for
    2.5.4.8 (state) and 2.5.4.7 (locality) to be compatible with
    openssl and most other crypto toolkits
    
    Makes the oid2... maps available for external modification by
    raising their scope to our.
    oliwel committed Nov 8, 2019
    Copy the full SHA
    8287513 View commit details
  3. Changelog / Version Bump 0.52

    oliwel committed Nov 8, 2019
    Copy the full SHA
    e21efbd View commit details
  4. Copy the full SHA
    86d619f View commit details
  5. add travis-ci

    mrscotty committed Nov 8, 2019
    Copy the full SHA
    26130a1 View commit details
  6. add github url to readme

    mrscotty committed Nov 8, 2019
    Copy the full SHA
    fb144a1 View commit details
  7. Merge branch 'release/0.52'

    mrscotty committed Nov 8, 2019
    Copy the full SHA
    5f6d9d8 View commit details
  8. Copy the full SHA
    7c7372a View commit details

Commits on Apr 15, 2020

  1. Added DecodedSubjectAltNames, an accessor that can be used to retriev…

    …e all the SANs in the certificate in their proper decoded form
    zdenek-biberle committed Apr 15, 2020
    Copy the full SHA
    1f384e2 View commit details

Commits on May 5, 2020

  1. Merge pull request #1 from d-tris/decoded_san

    Added DecodedSubjectAltNames, an accessor for SANs
    mrscotty authored May 5, 2020
    Copy the full SHA
    b236eb4 View commit details
  2. Version Bump 0.53

    mrscotty committed May 5, 2020
    Copy the full SHA
    76fca29 View commit details

Commits on Apr 26, 2021

  1. Copy the full SHA
    f8c12e3 View commit details
  2. Add new method SubjectRaw, add oids, CHANGE oid E => emailAddress

    Add new commonly used OIDs and rename the mapping for 1.2.840.113549.1.9.1
    from the very uncommon short "E" to the long form emailAddress.
    
    Add new method SubjectRaw that exports the subjects rdns with the raw OIDs
    oliwel committed Apr 26, 2021
    Copy the full SHA
    b40fbd2 View commit details
  3. update build doc

    Scott Hardin committed Apr 26, 2021
    Copy the full SHA
    dbe9c89 View commit details
  4. bump version to 0.54

    Scott Hardin committed Apr 26, 2021
    Copy the full SHA
    fe1763b View commit details
  5. Merge branch 'release/0.54'

    Scott Hardin committed Apr 26, 2021
    Copy the full SHA
    3e5b4c5 View commit details
  6. Merge branch 'release/0.54' into develop

    Scott Hardin committed Apr 26, 2021
    Copy the full SHA
    2fafcc0 View commit details
  7. build: add command for cpan-upload

    Scott Hardin committed Apr 26, 2021
    Copy the full SHA
    1fe0acb View commit details

Commits on Sep 6, 2022

  1. Fix whitespace

    oliwel committed Sep 6, 2022
    Copy the full SHA
    49f7a3c View commit details
  2. Update X509.pm

    Add missing oid for unstructuredAddress used by cisco routers during scep pki enrollment
    dhoffend authored and oliwel committed Sep 6, 2022
    Copy the full SHA
    90b650a View commit details

Commits on Jan 9, 2023

  1. Copy the full SHA
    43749fa View commit details
  2. Copy the full SHA
    892226a View commit details
  3. bump version to 0.55

    Scott Hardin committed Jan 9, 2023
    Copy the full SHA
    e838024 View commit details
  4. Merge branch 'release/0.55'

    Scott Hardin committed Jan 9, 2023
    Copy the full SHA
    93f6253 View commit details
Showing with 992 additions and 682 deletions.
  1. +6 −0 .travis.yml
  2. +34 −31 Changes
  3. +2 −2 META.yml
  4. +6 −1 README
  5. +59 −0 build.mkd
  6. +767 −646 lib/Crypt/X509.pm
  7. +14 −2 t/{Crypt-X509.t → 00_basic.t}
  8. +104 −0 t/04_complex_rdn.t
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: perl
perl:
- "5.28"

install:
- cpanm --installdeps --notest .
65 changes: 34 additions & 31 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,55 +1,58 @@
Revision history for Perl extension Crypt::X509.

0.52 Fr Nov 08 2019 oliwel
- changed shortnames for OIDs State (ST) and Locality(L), added new shortnames

0.51 Wed Jul 06 2011 ajung
- removed the explicit exports of new() and error() not needed and pollute namespace (thanks for the notice to Daniel Kahn Gillmor)

0.50 Fri Jan 07 2011 ajung
- incorporated patch from Tom Harrison to keep working, even after loading a unparsable Cert
- incorporated patch from Milan Kocian to access the location Attribute in the Subject DN
- incorporated patch from Daniel Kahn Gillmor to parse the names of digests in the SHA-2 family
- incorporated patch from Daniel Kahn Gillmor to parse/return PGPExtension (keyCreation time)
- incorporated patch from Daniel Kahn Gillmor to implement the request from Toby Inkster to return public key exponent
- incorporated patch from Tom Harrison to keep working, even after loading a unparsable Cert
- incorporated patch from Milan Kocian to access the location Attribute in the Subject DN
- incorporated patch from Daniel Kahn Gillmor to parse the names of digests in the SHA-2 family
- incorporated patch from Daniel Kahn Gillmor to parse/return PGPExtension (keyCreation time)
- incorporated patch from Daniel Kahn Gillmor to implement the request from Toby Inkster to return public key exponent

0.40 Fri Apr 23 2009 ajung
- incorporated patch from Joerg-Cornelius Schneider to access ExtKeyUsage
- incorporated patch from Joerg-Cornelius Schneider to fix parsing DSA/ECDSA signed certificates
- incorporated patch from Rein Tollevik to fix keyusage parsing on 64bit machines
- incorporated patch from Joerg-Cornelius Schneider to access ExtKeyUsage
- incorporated patch from Joerg-Cornelius Schneider to fix parsing DSA/ECDSA signed certificates
- incorporated patch from Rein Tollevik to fix keyusage parsing on 64bit machines

0.32 Tue Jan 09 2007 ajung
- fixed problem with not found issuer and subject parts
(found by Michael Steller)
- fixed problem with not found issuer and subject parts
(found by Michael Steller)

0.31 Mon Jan 08 2007 ajung
- included generalTime lookup as fallback for not_after and not_before
(suggested by Michael Steller)
- some documentation layout fixups
- included generalTime lookup as fallback for not_after and not_before
(suggested by Michael Steller)
- some documentation layout fixups

0.3 Wed Dec 27 2006 gigageek
- added CRLDistributionPoints2 function
- updated SubjectAltNames function
- added BasicConstraints function
- added CertificatePolicies function
- added SubjectInfoAccess function
- added SubjectDirectoryAttributes function
- added subject_keyidentifier funtion
- added CRLDistributionPoints2 function
- updated SubjectAltNames function
- added BasicConstraints function
- added CertificatePolicies function
- added SubjectInfoAccess function
- added SubjectDirectoryAttributes function
- added subject_keyidentifier funtion

0.21 Tue Nov 30 2005 ajung
- removed dependency on Perl 5.8.5
- removed dependency on Perl 5.8.5

0.2 Tue Aug 25 2005 ajung
- integrating Convert::ASN1:X509 with Crypt::X509
- integrating Convert::ASN1:X509 with Crypt::X509

0.12 (Convert::ASN1:X509) Tue Aug 18 2005 ajung
- revised the interface: Parser is encapsulated in module, changed test, documentaion, code
- all needed data access methods implemented
- put dependency on Convert::ASN.1 into Makefile.PL
- revised the interface: Parser is encapsulated in module, changed test, documentaion, code
- all needed data access methods implemented
- put dependency on Convert::ASN.1 into Makefile.PL

0.1 (Convert::ASN1:X509) Tue Aug 16 2005 ajung
- first draft of documentation
- built test
- first implementation
0.1 (Convert::ASN1:X509) Tue Aug 16 2005 ajung
- first draft of documentation
- built test
- first implementation

0.01 Sun Jun 12 22:04:15 2005 jacksonm
- original version; created by h2xs 1.23 with options
-X -n Crypt::X509
- original version; created by h2xs 1.23 with options
-X -n Crypt::X509

4 changes: 2 additions & 2 deletions META.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--- #YAML:1.0
name: Crypt-X509
version: 0.51
version: '0.55';
abstract: Parse a X.509 certificate
author:
- Mike Jackson, Alexander Jung, Duncan Segrest
- Mike Jackson, Alexander Jung, Duncan Segrest, Oliver Welter
license: unknown
distribution_type: module
configure_requires:
7 changes: 6 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Crypt-X509 version 0.50
Crypt-X509 version 0.52
=======================

Crypt::X509 is an object oriented X.509 certificate parser with numerous
@@ -17,3 +17,8 @@ DEPENDENCIES
This module requires:

Convert::ASN1

ISSUES, PULL REQUESTS

Plesae visit [https://github.com/openxpki/Crypt-X509] for issues, pull
requests, etc.
59 changes: 59 additions & 0 deletions build.mkd
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# To build a release:

Note: Replace '0.10' in the examples below with the current version.

* Switch to develop branch and update it with latest commits

* Start release branch

# Set the modver to the new version number
modver=0.10
git flow release start $modver develop

* Make any last-minute fixes

* Run unit tests

perl Makefile.PL
make test

* Bump version number in lib/Crypt/X509.pm

perl -i -pe "s{^our \\\$VERSION.+}{our \\\$VERSION = '$modver';};" lib/Crypt/X509.pm
perl -i -pe "s{^version: .+}{version: '$modver';};" META.yml
git add lib/Crypt/X509.pm META.yml
git commit -m "bump version to $modver"

* Finalize release (write the version number in the TAG\_MSG)

git flow release finish "$modver"
git push origin develop master "$modver"

* Build tarball

perl Makefile.PL
# make manifest
make test
make dist

* Upload tarball to https://pause.perl.org

cpan-upload Crypt-X509-$modver.tar.gz

# If the build env is not already set up, run the following:

curl -L http://install.perlbrew.pl | bash
echo "source $HOME/perl5/perlbrew/etc/bashrc" >> $HOME/.bashrc
source $HOME/perl5/perlbrew/etc/bashrc
perlbrew available
# Note: Adjust perl version based on results from 'perlbrew available'
perlbrew install perl-5.19.5
perlbrew switch perl-5.19.5
perlbrew install-cpanm
cpanm Module::Install
cpanm --installdeps --notest .

# If your 'git flow' is not already set up, run the following:

git flow init -d

1,413 changes: 767 additions & 646 deletions lib/Crypt/X509.pm

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions t/Crypt-X509.t → t/00_basic.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Crypt-X509.t'
use Test::More tests => 68;
use Test::More tests => 71;
use Math::BigInt;
BEGIN { use_ok('Crypt::X509') }

@@ -21,12 +21,18 @@ is( join( ':', @{ $decoded2->ExtKeyUsage } ), "clientAuth:emailProtection", 'Ext
# this has also to work twice
is( join( ':', @{ $decoded2->KeyUsage } ), "critical:digitalSignature:keyEncipherment:dataEncipherment", 'Keyusagecheck again' );
is( join( ':', @{ $decoded2->ExtKeyUsage } ), "clientAuth:emailProtection", 'Extkeyusagecheck again' );
is( join( ',', @{ $decoded2->Subject } ), "E=alexander.jung\@allianz.de,C=DE,O=Allianz Group,CN=Alexander Jung", 'Subject parsed' );
is( join( ',', @{ $decoded2->Subject } ), "emailAddress=alexander.jung\@allianz.de,C=DE,O=Allianz Group,CN=Alexander Jung", 'Subject parsed' );
is( $decoded2->subject_country, "DE", "Subject_country" );
is( $decoded2->subject_state, undef, "Subject_state" );
is( $decoded2->subject_org, "Allianz Group", "Subject_org" );
is( $decoded2->subject_ou, undef, "Subject_ou" );
is( $decoded2->subject_email, "alexander.jung\@allianz.de", "Subject_email" );
is_deeply( $decoded2->SubjectRaw, [
{'type' => '1.2.840.113549.1.9.1','value' => 'alexander.jung@allianz.de','format' => 'ia5String'},
{'type' => '2.5.4.6','value' => 'DE','format' => 'printableString'},
{'type' => '2.5.4.10','value' => 'Allianz Group','format' => 'printableString'},
{'type' => '2.5.4.3','value' => 'Alexander Jung','format' => 'printableString'}
]);
is( join( ',', @{ $decoded2->Issuer } ), "C=DE,O=Allianz Group,CN=Allianz Dresdner CA", "Issuer Parsed");
is( $decoded2->issuer_cn, "Allianz Dresdner CA", "Issuer_cn" );
is( $decoded2->issuer_country, "DE", "Isssuer_country" );
@@ -39,6 +45,8 @@ is( $decoded2->sig_algorithm, "1.2.840.113549.1.1.5", "sig_algorithm" );
is( length( $decoded2->pubkey ), 140, "Pubkey length" );
is( length( $decoded2->signature ), 256, "Signature Length" );
is( join( ',', @{ $decoded2->SubjectAltName } ), "rfc822Name=alexander.jung\@allianz.de", 'SubjectAltName parsed' );
is_deeply( $decoded2->DecodedSubjectAltNames, [[{rfc822Name => 'alexander.jung@allianz.de'}]], 'DecodedSubjectAltName parsed' );


$cert = loadcert('t/aj2.cer');
$decoded3 = Crypt::X509->new( cert => $cert );
@@ -87,6 +95,10 @@ is( $mon + 1, 3, "generalTime month" );
is( $year + 1900, 2005, "generalTime year" );
is( join( ',', @{ $decoded->Issuer } ), 'C=DE,O=Deutsche Telekom AG,nameDistinguisher=1,CN=NKS CA 6:PN', 'Issuer for telesec' );
is( join( ',', @{ $decoded->Subject } ), 'C=DE,nameDistinguisher=2,CN=Schefe, Jan', 'Subject for telesec' );
is_deeply( $decoded->DecodedSubjectAltNames, [[
{otherName => {value => "0\x111\x0f0\x0d\x06\x03U\x04\x04\x14\x06Schefe", type => '0.2.262.1.10.3.0'}},
{otherName => {value => "0\x0e1\x0c0\x0a\x06\x03U\x04*\x14\x03Jan", type => '0.2.262.1.10.3.0'}}]],
'DecodedSubjectAltNames for telesec');

$cert = loadcert('t/dsacert.der');
$decoded = Crypt::X509->new( cert => $cert );
104 changes: 104 additions & 0 deletions t/04_complex_rdn.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/usr/bin/perl

use strict;
use warnings;

use MIME::Base64;
use Test::More 0.94;

plan tests => 2;
use Crypt::X509;

my $data = decode_base64("
MIIEDTCCAvWgAwIBAgIUWNbTsN1cmdX0Ew4DlbirvCGPTywwDQYJKoZIhvcNAQEL
BQAwgZUxCzAJBgNVBAYTAkRFMRAwDgYDVQQKDAdPcGVuUEtJMRYwFAYDVQQLDA1C
cmFuY2grT2ZmaWNlMQswCQYDVQQLDAJJVDEpMA8GA1UEAwwISm9obiBEb2UwFgYK
CZImiZPyLGQBAQwIam9obi5kb2UxJDAiBgkqhkiG9w0BCQEWFWpvaG4uZG9lQG9w
ZW54cGtpLm9yZzAeFw0yMzAxMDkwNzQyMDVaFw0yMzAyMDgwNzQyMDVaMIGVMQsw
CQYDVQQGEwJERTEQMA4GA1UECgwHT3BlblBLSTEWMBQGA1UECwwNQnJhbmNoK09m
ZmljZTELMAkGA1UECwwCSVQxKTAPBgNVBAMMCEpvaG4gRG9lMBYGCgmSJomT8ixk
AQEMCGpvaG4uZG9lMSQwIgYJKoZIhvcNAQkBFhVqb2huLmRvZUBvcGVueHBraS5v
cmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDoQIN+eRw9zUN23DS0
k5FNxYy0JgkP78nV6FQ+AaKrb8ablKnCu9DFfTAStCUPZWh12Ta2ubwqUQPlWxva
GYMzAA+4Rqrgw1ksyLoFLUfyKKZk6ShiprUnHgB5iOdPpEgIXq7NHAfosW7VAXyR
NTQeFywDAgrlF0iVnjqL38eaIttzuxJs3os1uBST9L0ygpbaNUTfE9P0KT6c3LM4
eM29Z8jaUh3QvOJt0ybpnAWCcojikDhmfWFeAKLviokWp5FEuAtPxAr5KN+rE3W8
nC0a0f4gmNKbuf4vdVRiPhpWfUNvJgemxTClfB4IAL/MjOMsIEZkVIgWcjx74f2Y
4nMTAgMBAAGjUzBRMB0GA1UdDgQWBBTKOocoryob5WCO+9mGTbxNunL++DAfBgNV
HSMEGDAWgBTKOocoryob5WCO+9mGTbxNunL++DAPBgNVHRMBAf8EBTADAQH/MA0G
CSqGSIb3DQEBCwUAA4IBAQDD60DX+YzWLRkZJ+KgOoGTBSg+ghiepIV6GgTOk3q9
DOyXG5mE0e+FkMorqhnOFbjCkykSmPdOGBWzQAUTdMpOXh2e2MfvL7Dzqd8BLGjj
hz+NwfUZco/Ts9b1m5I2XDc9sEmREVaDF1s37qzR58idwzjKsqIAWjprnY1qTz3n
4WYqC5m89JUtaBwuJSPJ9ydrT4B45rWH52VqNkPhtRPBjGIzyP0QZcujA+4m33/0
IxpQGDLMDyZj5gfn8V/jxPiEH471BtjV7j3zPH6XZjexjUdH158rcfB2OYjj6zQL
9UlbEjCYgJe8zGRfS2WSMMV98CQ0B0rkj9woT1D+HqMv");

my $x509 = Crypt::X509->new(cert => $data );

is_deeply(scalar $x509->Subject(), [
'C=DE',
'O=OpenPKI',
'OU=Branch+Office',
'OU=IT',
'CN=John Doe',
'UID=john.doe',
'emailAddress=john.doe@openxpki.org'
]);

my $cert_subject = $x509->SubjectSequence();
is_deeply($cert_subject,[
[
{
'type' => '2.5.4.6',
'value' => {
'printableString' => 'DE'
}
}
],
[
{
'value' => {
'utf8String' => 'OpenPKI'
},
'type' => '2.5.4.10'
}
],
[
{
'value' => {
'utf8String' => 'Branch+Office'
},
'type' => '2.5.4.11'
}
],
[
{
'value' => {
'utf8String' => 'IT'
},
'type' => '2.5.4.11'
}
],
[
{
'value' => {
'utf8String' => 'John Doe'
},
'type' => '2.5.4.3'
},
{
'type' => '0.9.2342.19200300.100.1.1',
'value' => {
'utf8String' => 'john.doe'
}
}
],
[
{
'type' => '1.2.840.113549.1.9.1',
'value' => {
'ia5String' => 'john.doe@openxpki.org'
}
}
]
]);