Skip to content

Commit 89e87ab

Browse files
committed
Initial Version
0 parents  commit 89e87ab

18 files changed

+2870
-0
lines changed

.github/workflows/linux.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: linux
2+
3+
on:
4+
- push
5+
6+
jobs:
7+
perl:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
perl-version:
12+
- '5.8'
13+
- '5.10'
14+
- '5.12'
15+
- '5.14'
16+
- '5.16'
17+
- '5.18'
18+
- '5.20'
19+
- '5.22'
20+
- '5.24'
21+
- '5.26'
22+
- '5.28'
23+
- '5.30'
24+
- '5.32'
25+
container:
26+
image: perl:${{ matrix.perl-version }}
27+
steps:
28+
- uses: actions/checkout@v1
29+
- name: Install OS Packages
30+
run: |
31+
apt-get update;
32+
apt-get -y install xmlsec1;
33+
- name: Install Dependencies
34+
run: |
35+
cpanm -nq --installdeps . ;
36+
- name: Build Module
37+
run: |
38+
perl Makefile.PL;
39+
make
40+
- name: Run Tests
41+
run: |
42+
prove -lr -l -b -I inc t

.github/workflows/matrix.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Perl Matrix Testing
2+
on:
3+
- push
4+
jobs:
5+
build:
6+
runs-on: ${{ matrix.os }}
7+
strategy:
8+
matrix:
9+
os: [ 'windows-latest']
10+
perl: [ '5.32', '5.30', '5.28' ]
11+
name: Perl ${{ matrix.perl }} on ${{ matrix.os }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up perl
15+
uses: shogo82148/actions-setup-perl@v1.10.0
16+
with:
17+
perl-version: ${{ matrix.perl }}
18+
distribution: strawberry
19+
- run: perl -V
20+
- run: cpanm --installdeps .
21+
- run: prove -lv t
22+

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*~
2+
#*
3+
.#*
4+
Makefile
5+
pm_to_blib
6+
META.yml
7+
blib
8+
inc
9+
*.tar.gz
10+
MANIFEST
11+
MANIFEST.bak
12+
Makefile.old
13+
XML-Enc*
14+
Release-*

Makefile.PL

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
use strict;
2+
use warnings;
3+
4+
use 5.008;
5+
6+
use ExtUtils::MakeMaker;
7+
8+
my %WriteMakefileArgs = (
9+
"ABSTRACT" => "A toolkit to help encrypt and decrypt XML Digital Signatures.",
10+
"AUTHOR" => "Timothy Legge <timlegge\@cpan.org>",
11+
"CONFIGURE_REQUIRES" => {
12+
"ExtUtils::MakeMaker" => 0
13+
},
14+
"DISTNAME" => "XML-Enc",
15+
"LICENSE" => "perl",
16+
"MIN_PERL_VERSION" => "5.008",
17+
"NAME" => "XML::Enc",
18+
"PREREQ_PM" => {
19+
"Carp" => 0,
20+
"Crypt::Mode::CBC" => 0,
21+
"Crypt::OpenSSL::Bignum" => 0,
22+
"Crypt::OpenSSL::RSA" => 0,
23+
"Crypt::OpenSSL::X509" => 0,
24+
"Crypt::Random" => 0,
25+
"MIME::Base64" => 0,
26+
"XML::LibXML" => 0,
27+
"strict" => 0,
28+
"vars" => 0,
29+
"warnings" => 0
30+
},
31+
"TEST_REQUIRES" => {
32+
"File::Slurper" => 0,
33+
"File::Which" => 0,
34+
"Test::More" => 0
35+
},
36+
"VERSION" => "0.01",
37+
"test" => {
38+
"TESTS" => "t/*.t"
39+
}
40+
);
41+
42+
43+
my %FallbackPrereqs = (
44+
"Carp" => 0,
45+
"Crypt::Mode::CBC" => 0,
46+
"Crypt::OpenSSL::Bignum" => 0,
47+
"Crypt::OpenSSL::RSA" => 0,
48+
"Crypt::OpenSSL::X509" => 0,
49+
"Crypt::Random" => 0,
50+
"File::Slurper" => 0,
51+
"File::Which" => 0,
52+
"MIME::Base64" => 0,
53+
"Test::More" => 0,
54+
"XML::LibXML" => 0,
55+
"strict" => 0,
56+
"vars" => 0,
57+
"warnings" => 0
58+
);
59+
60+
61+
unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
62+
delete $WriteMakefileArgs{TEST_REQUIRES};
63+
delete $WriteMakefileArgs{BUILD_REQUIRES};
64+
$WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
65+
}
66+
67+
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
68+
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
69+
70+
WriteMakefile(%WriteMakefileArgs);

README

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
NAME
2+
XML::Enc - XML::Enc Encryption Support
3+
4+
VERSION
5+
version 0.01
6+
7+
SYNOPSIS
8+
my $decrypter = XML::Enc->new(
9+
{
10+
key => 't/sign-private.pem',
11+
no_xml_declaration => 1,
12+
force_element_to_content => 0,
13+
},
14+
);
15+
$decrypted = $enc->decrypt($xml);
16+
17+
my $encrypter = XML::Enc->new(
18+
{
19+
cert => 't/sign-certonly.pem',
20+
no_xml_declaration => 1,
21+
data_enc_method => 'aes256-cbc',
22+
key_transport => 'rsa-1_5',
23+
24+
},
25+
);
26+
$encrypted = $enc->encrypt($xml);
27+
28+
NAME
29+
XML::Enc - XML Encryption
30+
31+
METHODS
32+
new( ... )
33+
Constructor. Creates an instance of the XML::Enc object
34+
35+
Arguments:
36+
37+
key Filename of the private key to be used for decryption.
38+
39+
cert
40+
Filename of the public key to be used for encryption.
41+
42+
no_xml_declaration
43+
Do not return the XML declaration if true (1). Return it if false
44+
(0). This is useful for decrypting documents without the declaration
45+
such as SAML2 Responses.
46+
47+
data_enc_method
48+
Specify the data encryption method to be used. Supported methods
49+
are:
50+
51+
Used in encryption. Optional. Default method: aes256-cbc
52+
53+
force_element_to_content
54+
Used for decryption to treat an Element EncryptedData type as
55+
Content if the decrypted data is not XML. xmlsec appears to have a
56+
bug where it uses the Element EncryptedData type in order to encrypt
57+
what is actually Content. Strangely it appears to have no issue
58+
decrypting the data if the Type is changed to Content
59+
60+
* tripledes-cbc
61+
62+
* aes128-cbc
63+
64+
* aes196-cbc
65+
66+
* aes256-cbc
67+
68+
key_transport
69+
Specify the encryption method to be used for key transport.
70+
Supported methods are:
71+
72+
Used in encryption. Optional. Default method: rsa-1_5
73+
74+
* rsa-1_5
75+
76+
* rsa-oaep-mgf1p
77+
78+
decrypt( ... )
79+
Main decryption function.
80+
81+
Arguments:
82+
83+
xml XML containing the encrypted data.
84+
85+
encrypt( ... )
86+
Main encryption function.
87+
88+
Arguments:
89+
90+
xml XML containing the plaintext data.
91+
92+
AUTHOR
93+
Timothy Legge <timlegge@cpan.org>
94+
95+
COPYRIGHT AND LICENSE
96+
This software is copyright (c) 2022 by TImothy Legge.
97+
98+
This is free software; you can redistribute it and/or modify it under
99+
the same terms as the Perl 5 programming language system itself.
100+

cpanfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Do not edit this file directly. To change prereqs, edit the `dist.ini` file.
2+
3+
requires "Carp" => "0";
4+
requires "Crypt::Mode::CBC" => "0";
5+
requires "Crypt::OpenSSL::Bignum" => "0";
6+
requires "Crypt::OpenSSL::RSA" => "0";
7+
requires "Crypt::OpenSSL::X509" => "0";
8+
requires "Crypt::Random" => "0";
9+
requires "MIME::Base64" => "0";
10+
requires "XML::LibXML" => "0";
11+
requires "perl" => "5.008";
12+
requires "strict" => "0";
13+
requires "vars" => "0";
14+
requires "warnings" => "0";
15+
16+
on 'test' => sub {
17+
requires "File::Slurper" => "0";
18+
requires "File::Which" => "0";
19+
requires "Test::More" => "0";
20+
};
21+
22+
on 'configure' => sub {
23+
requires "ExtUtils::MakeMaker" => "0";
24+
};
25+
26+
on 'develop' => sub {
27+
requires "Pod::Coverage::TrustPod" => "0";
28+
requires "Test::EOF" => "0";
29+
requires "Test::EOL" => "0";
30+
requires "Test::More" => "0.88";
31+
requires "Test::NoTabs" => "0";
32+
requires "Test::Perl::Critic" => "0";
33+
requires "Test::Pod" => "1.41";
34+
requires "Test::Pod::Coverage" => "1.08";
35+
requires "Test::TrailingSpace" => "0.0203";
36+
};

dist.ini

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name = XML-Enc
2+
abstract = A toolkit to help encrypt and decrypt XML Digital Signatures.
3+
author = Timothy Legge <timlegge@cpan.org>
4+
copyright_holder = TImothy Legge
5+
; [...]
6+
license = Perl_5
7+
[Meta::Maintainers]
8+
maintainer = Timothy Legge <timlegge@cpan.org>
9+
10+
[Meta::Contributors]
11+
contributor = Timothy Legge <timlegge@gmail.com>
12+
13+
[AutoPrereqs]
14+
[Prereqs / RuntimeRequires]
15+
perl = 5.008
16+
Crypt::OpenSSL::Bignum = 0
17+
Crypt::OpenSSL::RSA = 0
18+
Crypt::OpenSSL::X509 = 0
19+
MIME::Base64 = 0
20+
XML::LibXML = 0
21+
Crypt::Mode::CBC = 0
22+
Crypt::Random = 0
23+
24+
[Prereqs / TestRequires]
25+
Test::More = 0
26+
27+
[PruneCruft]
28+
[ManifestSkip]
29+
[MetaYAML]
30+
[License]
31+
[Pod2Readme]
32+
[ExtraTests]
33+
[ExecDir]
34+
[ShareDir]
35+
[MakeMaker]
36+
[TestRelease]
37+
[ConfirmRelease]
38+
[Manifest]
39+
[UploadToCPAN]
40+
[Git::GatherDir]
41+
exclude_filename = cpanfile
42+
exclude_filename = Makefile.PL
43+
exclude_filename = dev-bin/cpanm
44+
exclude_filename = Dockerfile
45+
exclude_filename = MANIFEST
46+
exclude_filename = README
47+
48+
[Encoding]
49+
encoding = bytes
50+
match = ico
51+
52+
[CPANFile]
53+
54+
[CopyFilesFromBuild::Filtered]
55+
copy = cpanfile
56+
copy = Makefile.PL
57+
copy = README
58+
59+
[CopyFilesFromRelease]
60+
copy = cpanfile, Makefile.PL, README
61+
62+
[MetaJSON]
63+
[MetaProvides::Package]
64+
65+
[Repository]
66+
git_remote = upstream
67+
[Bugtracker]
68+
web = https://github.com/perl-net-saml2/perl-XML-Enc/issues
69+
[PodSyntaxTests]
70+
[PodCoverageTests]
71+
[Test::Perl::Critic]
72+
[Test::EOL]
73+
[Test::EOF]
74+
[Test::NoTabs]
75+
[Test::TrailingSpace ]
76+
77+
[PodWeaver]
78+
[NextRelease]
79+
format = %v -- %{EEE MMM dd HH:mm:ss VVV yyyy}d
80+
filename = Changes
81+
[Git::NextVersion]
82+
first_version = 0.01 ; this is the default
83+
version_by_branch = 0 ; this is the default
84+
version_regexp = ^(0.\d+)$ ; this is the default
85+
[WriteVersion]
86+
87+
[Git::Tag]
88+
tag_format = %V ; this is the default
89+
tag_message = %V ; this is the default
90+
91+
[Git::Commit]
92+
changelog = Changes ; this is the default
93+
94+
[AuthorsFromGit]
95+
[Signature]
96+
[SignReleaseNotes]

0 commit comments

Comments
 (0)