Result:
found 301 distributions and 793 files matching your query ! ( run in 1.909 )


WebService-ValidSign

 view release on metacpan or  search on metacpan

bin/vs-download.pl  view on Meta::CPAN

use WebService::ValidSign::Object::DocumentPackage;
use WebService::ValidSign::Object::Document;

my %opts = (
    help      => 0,
    config    => catfile($ENV{HOME}, qw (.config validsign.conf)),
);

{
    local $SIG{__WARN__};
    my $ok = eval {

 view all matches for this distribution


WordList-EN-Corncob

 view release on metacpan or  search on metacpan

lib/WordList/EN/Corncob.pm  view on Meta::CPAN

hinders
hindmost
hindquarters
hindrance
hindrances
hindsight
hindu
hinduism
hinge
hinged
hinges

lib/WordList/EN/Corncob.pm  view on Meta::CPAN

roads
roadshow
roadshows
roadside
roadsides
roadsigns
roadster
roadsweepers
roadway
roadways
roadworks

 view all matches for this distribution


WordList-EN-Enable

 view release on metacpan or  search on metacpan

lib/WordList/EN/Enable.pm  view on Meta::CPAN

hindquarter
hindquarters
hindrance
hindrances
hinds
hindsight
hindsights
hinge
hinged
hinger
hingers
hinges

 view all matches for this distribution


WordList-Phrase-EN-Idiom-Wiktionary

 view release on metacpan or  search on metacpan

lib/WordList/Phrase/EN/Idiom/Wiktionary.pm  view on Meta::CPAN

highway robbery
hike up
hill of beans
hill to die on
hind tit
hindsight is 20/20
hired gun
hired muscle
his back is up
hit a snag
hit above one's weight

lib/WordList/Phrase/EN/Idiom/Wiktionary.pm  view on Meta::CPAN

twatfaced
twelve-ounce curls
twenty to
twenty to the dozen
twenty winks
twenty-twenty hindsight
twiddle one's thumbs
twilight years
twinkle in one's father's eye
twinkly-eyed
twist in the wind

 view all matches for this distribution


WordList-Phrase-EN-Proverb-Wiktionary

 view release on metacpan or  search on metacpan

lib/WordList/Phrase/EN/Proverb/Wiktionary.pm  view on Meta::CPAN

heaven helps those that help themselves
heaven helps those who help themselves
hell hath no fury like a woman scorned
here today, gone tomorrow
hic Rhodus, hic salta
hindsight is 20/20
history repeats itself
home is where the heart is
home is where you hang your hat
honesty is the best policy
honey catches more flies than vinegar

 view all matches for this distribution


Wurst

 view release on metacpan or  search on metacpan

src/wurstsrc/fx.h  view on Meta::CPAN

typedef struct FXParam {
    size_t nr_groups, nr_inst, nr_dbins;
    float  *cw;
    float  **Ijk, **Ijk_nbr, **Ijk_psi, *Ijk_dist;
    float  ***paa, ***pna;
    float  **psi, **dpsi, *pdav, *pdsig;
    float  *dbin;
} FXParam;

#endif /* FX_H */

 view all matches for this distribution


X11-Protocol

 view release on metacpan or  search on metacpan

Keysyms.pm  view on Meta::CPAN

	$Keysyms{"Cyrillic_ze"} = 0x6da;
	$Keysyms{"Cyrillic_sha"} = 0x6db;
	$Keysyms{"Cyrillic_e"} = 0x6dc;
	$Keysyms{"Cyrillic_shcha"} = 0x6dd;
	$Keysyms{"Cyrillic_che"} = 0x6de;
	$Keysyms{"Cyrillic_hardsign"} = 0x6df;
	$Keysyms{"Cyrillic_YU"} = 0x6e0;
	$Keysyms{"Cyrillic_A"} = 0x6e1;
	$Keysyms{"Cyrillic_BE"} = 0x6e2;
	$Keysyms{"Cyrillic_TSE"} = 0x6e3;
	$Keysyms{"Cyrillic_DE"} = 0x6e4;

 view all matches for this distribution


XML-CanonicalizeXML

 view release on metacpan or  search on metacpan

t/XML-CanonicalizeXML.t  view on Meta::CPAN

'<XPath xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
(//. | //@* | //namespace::*)[ancestor-or-self::SOAP-ENV:Body]
</XPath>';

#$si_xpath=
#'<XPath xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
#(//. | //@* | //namespace::*)[ancestor-or-self::ds:SignedInfo]
#</XPath>';*/

$testresult1=
'<SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" Id="myBody">

 view all matches for this distribution


XML-Compile-WSS-Signature

 view release on metacpan or  search on metacpan

lib/XML/Compile/WSS/Sign.pm  view on Meta::CPAN

use warnings;
use strict;

use Log::Report 'xml-compile-wss-sig';

use XML::Compile::WSS::Util   qw/:wss11 :dsig/;
use Scalar::Util              qw/blessed/;

my ($signs, $sigmns) = (DSIG_NS, DSIG_MORE_NS);


 view all matches for this distribution


XML-Compile-WSS

 view release on metacpan or  search on metacpan

lib/XML/Compile/WSS/Util.pm  view on Meta::CPAN

WSSE_10
DSIG_NS		XENC_NS		DSIG11_NS	DSP_NS		DSIG_MORE_NS
GHC_NS		WSU_NS
 /;

my @dsig  = qw/
DSIG_BASE64	DSIG_HMAC_SHA1	DSIG_OBJECT	DSIG_SHA1	DSIG_X509_DATA
DSIG_DSA_KV	DSIG_MANIFEST	DSIG_PGP_DATA	DSIG_SIGPROPS	DSIG_XPATH
DSIG_DSA_SHA1	DSIG_MGMT_DATA	DSIG_RSA_KV	DSIG_SPKI_DATA	DSIG_XSLT
DSIG_ENV_SIG	DSIG_NS		DSIG_RSA_SHA1	DSIG_X509_CERT
 /;

my @dsig_more = qw/
DSIGM_MD5		DSIGM_ECDSA_SHA224	DSIGM_CAM192
DSIGM_SHA224		DSIGM_ECDSA_SHA256	DSIGM_CAM256
DSIGM_SHA384		DSIGM_ECDSA_SHA384	DSIGM_KW_CAM128
DSIGM_HMAC_MD5		DSIGM_ECDSA_SHA512	DSIGM_KW_CAM192
DSIGM_HMAC_SHA224	DSIGM_ESIGN_SHA1	DSIGM_KW_CAM256

lib/XML/Compile/WSS/Util.pm  view on Meta::CPAN

DSIGM_RSA_SHA384	DSIGM_XPTR		DSIGM_RAW_SPKIS
DSIGM_RSA_SHA512	DSIGM_ARCFOUR		DSIGM_PKCS7_DATA
DSIGM_ECDSA_SHA1	DSIGM_CAM128		DSIGM_RAW_PKCS7_DATA
 /;

my @dsig11 = qw/
DSIG11_NS		DSIG11_EC_KV		DSIG11_DER_KV
 /;

my @xtp10 = qw/XTP10_X509 XTP10_X509v3 XTP10_X509PKI XTP10_X509PKC/;

lib/XML/Compile/WSS/Util.pm  view on Meta::CPAN

UTP11_PTEXT     UTP11_PDIGEST   UTP11_USERNAME
 /;

our @EXPORT    = 'WSS11MODULE';
our @EXPORT_OK
  = ( @wss11, @dsig, @dsig_more, @dsig11, @xenc, @ghc, @dsp, @utp11
    , @wsm10, @wsm11, @xtp10);

our %EXPORT_TAGS =
  ( wss11  => \@wss11
  , dsig   => \@dsig
  , dsig11 => \@dsig11
  , dsigm  => \@dsig_more
  , xenc   => \@xenc
  , ghc    => \@ghc
  , dsp    => \@dsp
  , utp11  => \@utp11
  , xtp10  => \@xtp10

lib/XML/Compile/WSS/Util.pm  view on Meta::CPAN



# Path components, not exported
use constant
  { WSS_BASE => 'http://docs.oasis-open.org/wss'
  , DSIG     => 'http://www.w3.org/2000/09/xmldsig'
  , DSIG11   => 'http://www.w3.org/2009/xmldsig11'
  , DSIGM    => 'http://www.w3.org/2001/04/xmldsig-more'
  , XENC     => 'http://www.w3.org/2001/04/xmlenc'
  , GHC      => 'http://www.w3.org/2010/xmlsec-ghc'
  , DSP      => 'http://www.w3.org/2009/xmldsig-properties'
  };


use constant WSS_WG200401 => WSS_BASE.'/2004/01/oasis-200401-wss';
use constant

 view all matches for this distribution


XML-Enc

 view release on metacpan or  search on metacpan

lib/XML/Enc.pm  view on Meta::CPAN


sub _assert_encryption_digest {
    my $algo = shift;

    state $ENC_DIGEST = {
        'http://www.w3.org/2000/09/xmldsig#sha1' => 'SHA1',
        'http://www.w3.org/2001/04/xmlenc#sha256' => 'SHA256',
        'http://www.w3.org/2001/04/xmldsig-more#sha224' => 'SHA224',
        'http://www.w3.org/2001/04/xmldsig-more#sha384' => 'SHA384',
        'http://www.w3.org/2001/04/xmlenc#sha512' => 'SHA512',
    };
    die "Unsupported encryption digest algo $algo" unless $ENC_DIGEST->{ $algo };
    return $ENC_DIGEST->{ $algo };
}

lib/XML/Enc.pm  view on Meta::CPAN

                                    load_ext_dtd    => 0,
                                    expand_entities => 0
                                );

    my $xpc = XML::LibXML::XPathContext->new($doc);
    $xpc->registerNs('dsig', 'http://www.w3.org/2000/09/xmldsig#');
    $xpc->registerNs('xenc', 'http://www.w3.org/2001/04/xmlenc#');
    $xpc->registerNs('xenc11', 'http://www.w3.org/2009/xmlenc11#');
    $xpc->registerNs('saml', 'urn:oasis:names:tc:SAML:2.0:assertion');

    return $doc unless $xpc->exists('//xenc:EncryptedData');

lib/XML/Enc.pm  view on Meta::CPAN

    my $xpc = shift;
    my $parser = shift;
    my %options = @_;

    my $k = $self->_get_named_key_nodes(
        '//xenc:EncryptedData/dsig:KeyInfo/xenc:EncryptedKey',
        $xpc, $options{key_name}
    );

    $k->foreach(
        sub {

lib/XML/Enc.pm  view on Meta::CPAN

    my $self = shift;
    my $xpc  = shift;
    my $parser = shift;
    my %options = @_;

    my $uri_nodes = $xpc->findnodes('//dsig:KeyInfo/dsig:RetrievalMethod/@URI');
    my @uri_nodes = $uri_nodes->map(sub { my $v = $_->getValue; $v =~ s/^#//; return $v; });

    foreach my $uri (@uri_nodes) {
        my $encrypted_key_nodes = $self->_get_named_key_nodes(
            sprintf('//xenc:EncryptedKey[@Id="%s"]', $uri),

lib/XML/Enc.pm  view on Meta::CPAN

            sub {

                my $key = $self->_get_key_from_node($_, $xpc);
                return unless $key;

                my $encrypted_nodes = $xpc->findnodes(sprintf('//dsig:KeyInfo/dsig:RetrievalMethod[@URI="#%s"]/../..', $uri));
                return unless $encrypted_nodes->size;

                $encrypted_nodes->foreach(sub {
                    $self->_decrypt_encrypted_node(
                        $_,

lib/XML/Enc.pm  view on Meta::CPAN


    my $nodes = $xpc->findnodes($xpath);
    return $nodes unless $name;
    return $nodes->grep(
        sub {
            $xpc->findvalue('dsig:KeyInfo/dsig:KeyName', $_) eq $name;
        }
    );
}

sub _decrypt_encrypted_node {

lib/XML/Enc.pm  view on Meta::CPAN

    my $self = shift;
    my $node = shift;
    my $xpc  = shift;

    my $value = $xpc->findvalue(
        './xenc:EncryptionMethod/dsig:DigestMethod/@Algorithm', $node);
    return _assert_encryption_digest($value) if $value;
    return;
}


lib/XML/Enc.pm  view on Meta::CPAN

                                    load_ext_dtd    => 0,
                                    expand_entities => 0
                                );

    my $xpc = XML::LibXML::XPathContext->new($encrypted);
    $xpc->registerNs('dsig', 'http://www.w3.org/2000/09/xmldsig#');
    $xpc->registerNs('xenc', 'http://www.w3.org/2001/04/xmlenc#');
    $xpc->registerNs('xenc11', 'http://www.w3.org/2009/xmlenc11#');
    $xpc->registerNs('saml', 'urn:oasis:names:tc:SAML:2.0:assertion');

    # Encrypt the data an empty key is passed by reference to allow

lib/XML/Enc.pm  view on Meta::CPAN

    my $self         = shift;
    my $context      = shift;
    my $xpc          = shift;
    my $keyname      = shift;

    my $node = $xpc->findnodes('//xenc:EncryptedKey/dsig:KeyInfo/dsig:KeyName', $context);

    $node->[0]->removeChildNodes();
    $node->[0]->appendText(defined $keyname ? $keyname : 'key_name');
    return $context;
}

lib/XML/Enc.pm  view on Meta::CPAN

sub _setOAEPDigest {
    my $self    = shift;
    my $method  = shift;

    state $OAEPDigest = {
        'sha1'      => 'http://www.w3.org/2000/09/xmldsig#sha1',
        'sha224'    => 'http://www.w3.org/2001/04/xmldsig-more#sha224',
        'sha256'    => 'http://www.w3.org/2001/04/xmlenc#sha256',
        'sha384'    => 'http://www.w3.org/2001/04/xmldsig-more#sha384',
        'sha512'    => 'http://www.w3.org/2001/04/xmlenc#sha512',
    };

    return $OAEPDigest->{$method} // $OAEPDigest->{'sha256'};
}

lib/XML/Enc.pm  view on Meta::CPAN

sub _getParamsAlgorithm {
    my $self    = shift;
    my $method  = shift;

    state $ParamsAlgorithm = {
        'http://www.w3.org/2000/09/xmldsig#sha1' => 'SHA1',
        'http://www.w3.org/2001/04/xmldsig-more#sha224' => 'SHA224',
        'http://www.w3.org/2001/04/xmlenc#sha256' => 'SHA256',
        'http://www.w3.org/2001/04/xmldsig-more#sha384' => 'SHA384',
        'http://www.w3.org/2001/04/xmlenc#sha512' => 'SHA512',
    };

    return $ParamsAlgorithm->{$method} // $ParamsAlgorithm->{'http://www.w3.org/2000/09/xmldsig#sha1'};
}

sub _setKeyEncryptionMethod {
    my $self    = shift;
    my $method  = shift;

lib/XML/Enc.pm  view on Meta::CPAN

    my $xpc          = shift;
    my $cipherdata   = shift;

    my $node;

    if ($xpc->findvalue('dsig:KeyInfo/dsig:RetrievalMethod/@Type', $context)
                eq 'http://www.w3.org/2001/04/xmlenc#EncryptedKey')
    {
        my $id = $xpc->findvalue('dsig:KeyInfo/dsig:RetrievalMethod/@URI', $context);
        $id    =~ s/#//g;

        my $keyinfo = $xpc->find('//*[@Id=\''. $id . '\']', $context);
        if (! $keyinfo ) {
            die "Unable to find EncryptedKey";
        }

        $node = $keyinfo->[0]->findnodes('//xenc:EncryptedKey/xenc:CipherData', $context)->[0];
    } else {
        $node = $xpc->findnodes('//dsig:KeyInfo/xenc:EncryptedKey/xenc:CipherData/xenc:CipherValue')->[0];
    }
    $node->removeChildNodes();
    $node->appendText($cipherdata);
}

lib/XML/Enc.pm  view on Meta::CPAN

        $self->{ key_type } = 'rsa';

        if (!$self->{ x509 }) {
            my $keyhash = $rsaKey->key2hash();

            $self->{KeyInfo} = "<dsig:KeyInfo>
                                 <dsig:KeyValue>
                                  <dsig:RSAKeyValue>
                                   <dsig:Modulus>$keyhash->{N}</dsig:Modulus>
                                   <dsig:Exponent>$keyhash->{d}</dsig:Exponent>
                                  </dsig:RSAKeyValue>
                                 </dsig:KeyValue>
                                </dsig:KeyInfo>";
        }
    }
    else {
        confess "did not get a new Crypt::PK::RSA object";
    }

lib/XML/Enc.pm  view on Meta::CPAN

    die "Could not load certificate from $file" unless $cert;

    $self->{ cert_obj } = $cert;
    my $cert_text = $cert->export_key_pem('public_x509');
    $cert_text =~ s/-----[^-]*-----//gm;
    $self->{KeyInfo} = "<dsig:KeyInfo><dsig:X509Data><dsig:X509Certificate>\n"._trim($cert_text)."\n</dsig:X509Certificate></dsig:X509Data></dsig:KeyInfo>";
    return;
}

sub _create_encrypted_data_xml {
    my $self    = shift;

    local $XML::LibXML::skipXMLDeclaration = $self->{ no_xml_declaration };
    my $doc = XML::LibXML::Document->new();

    my $xencns = 'http://www.w3.org/2001/04/xmlenc#';
    my $dsigns = 'http://www.w3.org/2000/09/xmldsig#';
    my $xenc11ns = 'http://www.w3.org/2009/xmlenc11#';

    my $encdata = $self->_create_node($doc, $xencns, $doc, 'xenc:EncryptedData',
                            {
                                Type    => 'http://www.w3.org/2001/04/xmlenc#Element',

lib/XML/Enc.pm  view on Meta::CPAN

                            }
                        );

    my $keyinfo = $self->_create_node(
                            $doc,
                            $dsigns,
                            $encdata,
                            'dsig:KeyInfo',
                        );

    my $enckey = $self->_create_node(
                            $doc,
                            $xencns,

lib/XML/Enc.pm  view on Meta::CPAN

    if ($self->{key_transport} eq 'http://www.w3.org/2009/xmlenc11#rsa-oaep' ||
        $self->{key_transport} eq 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p' &&
        $self->{oaep_label_hash}) {
        my $digestmethod = $self->_create_node(
                            $doc,
                            $dsigns,
                            $kencmethod,
                            'dsig:DigestMethod',
                            {
                                Algorithm => $self->{oaep_label_hash},
                            }
                        );
    };

lib/XML/Enc.pm  view on Meta::CPAN

                        );
    };

    my $keyinfo2 = $self->_create_node(
                            $doc,
                            $dsigns,
                            $enckey,
                            'dsig:KeyInfo',
                        );

    if (defined $self->{key_name}) {
        my $keyname = $self->_create_node(
                            $doc,
                            $dsigns,
                            $keyinfo2,
                            'dsig:KeyName',
                        );
    };

    my $keycipherdata = $self->_create_node(
                            $doc,

lib/XML/Enc.pm  view on Meta::CPAN


The default is sha1.  Supported algorithms are:

=over

=item * L<sha1|http://www.w3.org/2000/09/xmldsig#sha1>

=item * L<sha224|http://www.w3.org/2001/04/xmldsig-more#sha224>

=item * L<sha256|http://www.w3.org/2001/04/xmlenc#sha256>

=item * L<sha384|http://www.w3.org/2001/04/xmldsig-more#sha384>

=item * L<sha512|http://www.w3.org/2001/04/xmlenc#sha512>

=back

 view all matches for this distribution


XML-LibXML-xmlsec

 view release on metacpan or  search on metacpan

examples/verify.pl  view on Meta::CPAN


use XML::LibXML::xmlsec;

my $signeddoc= <<"EOX";
<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
  <Data id="hello">
     <content>Hello world</content>
  </Data>
  <ds:Signature>
    <ds:SignedInfo>
      <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
      <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
      <ds:Reference URI="#hello">
        <ds:Transforms>
          <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
        </ds:Transforms>
        <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
        <ds:DigestValue>H8+/9SNyFIQUr3D4ivpWwCjRwAU=</ds:DigestValue>
      </ds:Reference>
    </ds:SignedInfo>
    <ds:SignatureValue>gROBCm94jxE8tmSWiVD5Mg7V4PAg2z9720OkifhdZQ6o8BLhfO0T9tr7H/Buscdg
HIQUY4waNbQu3r3076WasOH8iMwXb7ffzbshhBWU73juGnXZBoLZ8chWR9To6C3w

examples/verify.pl  view on Meta::CPAN

</Envelope>
EOX

my $tampered= <<"EOX";
<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
  <Data id="hello">
     <content>Hello world!</content>
  </Data>
  <ds:Signature>
    <ds:SignedInfo>
      <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
      <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
      <ds:Reference URI="#hello">
        <ds:Transforms>
          <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
        </ds:Transforms>
        <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
        <ds:DigestValue>H8+/9SNyFIQUr3D4ivpWwCjRwAU=</ds:DigestValue>
      </ds:Reference>
    </ds:SignedInfo>
    <ds:SignatureValue>gROBCm94jxE8tmSWiVD5Mg7V4PAg2z9720OkifhdZQ6o8BLhfO0T9tr7H/Buscdg
HIQUY4waNbQu3r3076WasOH8iMwXb7ffzbshhBWU73juGnXZBoLZ8chWR9To6C3w

 view all matches for this distribution


XML-LibXML

 view release on metacpan or  search on metacpan

t/24c14n.t  view on Meta::CPAN

}

{

my $xml = <<'EOF';
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmln...
EOF

my $xpath = q{(//. | //@* | //namespace::*)[ancestor-or-self::x:MessageID]};
my $xpath2 = q{(//. | //@* | //namespace::*)[ancestor-or-self::*[local-name()='MessageID' and namespace-uri()='http://www.w3.org/2005/08/addressing']]};

 view all matches for this distribution


XML-Liberal

 view release on metacpan or  search on metacpan

t/bad/BAD-lowascii.xml  view on Meta::CPAN

    <link rel="alternate" type="text/html" href="http://www.livejournal.com/users/skippenskop/172746.html"/>
    <issued>2005-08-09T23:56:00</issued>
    <title>Yea, but that's like being the world's tallest midget</title>
    <published>2005-08-10T04:40:59Z</published>
    <updated>2005-08-10T04:40:59Z</updated>
    <content type="html">Tonight, on my way home, I was thinking of how chaoticly wonderful it would be if some bizarre occurance left the entire world without power for just an hour. In the middle of the night. But it didn't take long for rationalit...
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:skippenskop:172290</id>
    <link rel="alternate" type="text/html" href="http://www.livejournal.com/users/skippenskop/172290.html"/>
    <issued>2005-08-04T03:28:00</issued>

 view all matches for this distribution


XML-NewsML_G2

 view release on metacpan or  search on metacpan

t/xsds/NewsML-G2_2_12-spec-All-Power.xsd  view on Meta::CPAN

	<xs:complexType name="AnyItemType" abstract="true" block="restriction">
		<xs:annotation>
			<xs:documentation>An abstract class. All G2 items are inherited from this class.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:any namespace="http://www.w3.org/2000/09/xmldsig#" processContents="lax" minOccurs="0">
				<xs:annotation>
					<xs:documentation>W3C's XML Digital Signature</xs:documentation>
				</xs:annotation>
			</xs:any>
			<xs:choice maxOccurs="unbounded">

 view all matches for this distribution


XML-Sig-OO

 view release on metacpan or  search on metacpan

lib/XML/Sig/OO.pm  view on Meta::CPAN

  is=>'ro',
  isa=>CodeRef,
  default=>sub { sub { XML::LibXML->new() } },
);

=item * namespaces=>{ ds=>'http://www.w3.org/2000/09/xmldsig#', ec=>'http://www.w3.org/2001/10/xml-exc-c14n#'}

Contains the list of namespaces to set in our XML::LibXML::XPathContext object.

=cut

has namespaces=>(
  is=>'ro',
  isa=>HashRef,
  default=>sub {
    {
      ds=>'http://www.w3.org/2000/09/xmldsig#',
      ec=>'http://www.w3.org/2001/10/xml-exc-c14n#',
      samlp=>"urn:oasis:names:tc:SAML:2.0:protocol",
    }
  },
);

lib/XML/Sig/OO.pm  view on Meta::CPAN

Contains the digest callbacks.  The default handlers can be found in %XML::SIG::OO::DIGEST.

=cut

our %DIGEST=(
  'http://www.w3.org/2000/09/xmldsig#sha1'  => sub { my ($self,$content)=@_; $self->_get_digest(sha1 => $content) },
  'http://www.w3.org/2001/04/xmlenc#sha256' => sub { my ($self,$content)=@_; $self->_get_digest(sha256 => $content) },
  'http://www.w3.org/2001/04/xmlenc#sha512' => sub { my ($self,$content)=@_; $self->_get_digest(sha512 => $content) },
  'http://www.w3.org/2001/04/xmldsig-more#sha224' => sub { my ($self,$content)=@_; $self->_get_digest(sha224 => $content) },
  'http://www.w3.org/2001/04/xmldsig-more#sha384' => sub { my ($self,$content)=@_; $self->_get_digest(sha384 => $content) },
  'http://www.w3.org/2001/04/xmldsig-more#sha512' => sub { my ($self,$content)=@_; $self->_get_digest(sha512 => $content) },
  'http://www.w3.org/2001/04/xmldsig-more#sha1024' => sub { my ($self,$content)=@_; $self->_get_digest(sha1024 => $content) },
  'http://www.w3.org/2001/04/xmldsig-more#sha2048' => sub { my ($self,$content)=@_; $self->_get_digest(sha2048=> $content) },
  'http://www.w3.org/2001/04/xmldsig-more#sha3072' => sub { my ($self,$content)=@_; $self->_get_digest(sha3072=> $content) },
  'http://www.w3.org/2001/04/xmldsig-more#sha4096' => sub { my ($self,$content)=@_; $self->_get_digest(sha4096=> $content) },
);

=item * digest_method=>'http://www.w3.org/2000/09/xmldsig#sha1'

Sets the digest method to be used when signing xml

=cut

has digest_method=>(
  isa=>sub { exists $DIGEST{$_[0]} or croak "$_[0] is not a supported digest" },
  is=>'ro',
  default=>'http://www.w3.org/2000/09/xmldsig#sha1',
);

=item * key_type=>'rsa'

The signature method we will use

lib/XML/Sig/OO.pm  view on Meta::CPAN

  while (length($digest) % 4) { $digest .= '='  }
  return $digest;
}

our %TUNE_CERT=(
  'http://www.w3.org/2000/09/xmldsig#dsa-sha1' => sub { _tune_cert(@_,'sha1') },
  'http://www.w3.org/2000/09/xmldsig#rsa-sha1' => sub { _tune_cert(@_,'sha1') },
  'http://www.w3.org/2001/04/xmldsig-more#rsa-sha224' => sub { _tune_cert(@_,'sha224') },
  'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256' => sub { _tune_cert(@_,'sha256') },
  'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384' => sub { _tune_cert(@_,'sha384') },
  'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512' => sub { _tune_cert(@_,'sha512') },  
  'http://www.w3.org/2001/04/xmldsig-more#rsa-sha1024' => sub { _tune_cert(@_,'sha1024') },  
  'http://www.w3.org/2001/04/xmldsig-more#rsa-sha2048' => sub { _tune_cert(@_,'sha2048') },  
  'http://www.w3.org/2001/04/xmldsig-more#rsa-sha3072' => sub { _tune_cert(@_,'sha3072') },  
  'http://www.w3.org/2001/04/xmldsig-more#rsa-sha4096' => sub { _tune_cert(@_,'sha4096') },  
);

=item * signature_method=>'http://www.w3.org/2000/09/xmldsig#rsa-sha1'

Sets the signature method.

=cut

has signature_method=>(
  isa=>Str,
  is=>'ro',
  default=>'http://www.w3.org/2000/09/xmldsig#rsa-sha1',
);

sub _tune_cert {
  my ($self,$cert,$alg)=@_;

lib/XML/Sig/OO.pm  view on Meta::CPAN

  $node->removeChild($target) if defined($target);
  return $node->toString;
}

our %MUTATE=(
  'http://www.w3.org/2000/09/xmldsig#enveloped-signature'=>\&_envelope_transform,
  'http://www.w3.org/TR/2001/REC-xml-c14n-20010315' => _build_canon_coderef('toStringC14N',0),
  'http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments' => _build_canon_coderef('toStringC14N',1),
  'http://www.w3.org/2006/12/xml-c14n11' => _build_canon_coderef('toStringC14N_v1_1',0),
  'http://www.w3.org/2006/12/xml-c14n11#WithComments' => _build_canon_coderef('toStringC14N_v1_1',1),
  'http://www.w3.org/2001/10/xml-exc-c14n#' => _build_canon_coderef('toStringEC14N',0),

lib/XML/Sig/OO.pm  view on Meta::CPAN

  isa=>Str,
  required=>0,
  is=>'ro',
);

=item * envelope_method=>"http://www.w3.org/2000/09/xmldsig#enveloped-signature"

Sets the envelope method; This value most likely is the only valid value.

=cut

has envelope_method=>(
  isa=>Str,
  is=>'ro',
  default=>"http://www.w3.org/2000/09/xmldsig#enveloped-signature",
);

#=item * canon_method=>'http://www.w3.org/2001/10/xml-exc-c14n#'
=item * canon_method=>'http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments'

lib/XML/Sig/OO.pm  view on Meta::CPAN


sub BUILD {
  my ($self)=@_;

  # sanity check dsa signature method
  croak 'dsa key types only work with signature_method: http://www.w3.org/2000/09/xmldsig#dsa-sha1'
    if $self->key_type eq 'dsa' && $self->signature_method ne 'http://www.w3.org/2000/09/xmldsig#dsa-sha1';


  croak "namespaces does not contain: ".$self->tag_namespace unless exists $self->namespaces->{$self->tag_namespace};
  croak $self->signature_method." is an unsupported signature method" unless exists $self->tune_cert_cbs->{$self->signature_method};
  if(defined($self->key_file) && !defined($self->sign_cert)) {

 view all matches for this distribution


XML-Sig

 view release on metacpan or  search on metacpan

lib/XML/Sig.pm  view on Meta::CPAN

use XML::LibXML;
use MIME::Base64;
use Carp;


use constant TRANSFORM_ENV_SIG           => 'http://www.w3.org/2000/09/xmldsig#enveloped-signature';
use constant TRANSFORM_C14N              => 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315';
use constant TRANSFORM_C14N_COMMENTS     => 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments';
use constant TRANSFORM_C14N_V1_1         => 'http://www.w3.org/TR/2008/REC-xml-c14n11-20080502';
use constant TRANSFORM_C14N_V1_1_COMMENTS => 'http://www.w3.org/TR/2008/REC-xml-c14n11-20080502#WithComments';
use constant TRANSFORM_EXC_C14N          => 'http://www.w3.org/2001/10/xml-exc-c14n#';

lib/XML/Sig.pm  view on Meta::CPAN

    local $XML::LibXML::skipXMLDeclaration = $self->{ no_xml_declaration };

    my $dom = $self->_load_xml($xml);

    $self->{ parser } = XML::LibXML::XPathContext->new($dom);
    $self->{ parser }->registerNs('dsig', 'http://www.w3.org/2000/09/xmldsig#');
    $self->{ parser }->registerNs('ec', 'http://www.w3.org/2001/10/xml-exc-c14n#');
    $self->{ parser }->registerNs('saml', 'urn:oasis:names:tc:SAML:2.0:assertion');
    if ($self->{ns}) {
        foreach (keys %{$self->{ns}}) {
            $self->{ parser }->registerNs($_, $self->{ns}{$_});

lib/XML/Sig.pm  view on Meta::CPAN

        # Get the XML note to sign base on the ID
        my $xml = $self->_get_xml_to_sign($signid);

        # Canonicalize the XML to http://www.w3.org/2001/10/xml-exc-c14n#
        # TODO Change the Canonicalization method in the xml fragment from _signedinfo_xml
        #    <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
        #    <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
        my $xml_canon        = $xml->toStringEC14N();

        if(my $ref = Digest::SHA->can($self->{ digest_hash })) {
            $self->{digest_method} = $ref;
        }

lib/XML/Sig.pm  view on Meta::CPAN

        local $XML::LibXML::skipXMLDeclaration = $self->{ no_xml_declaration };

        my $signature_dom = $self->_load_xml($signature_xml);

        my $xpath = XML::LibXML::XPathContext->new($signature_dom);
        $xpath->registerNs('dsig', 'http://www.w3.org/2000/09/xmldsig#');
        $xpath->registerNs('ec', 'http://www.w3.org/2001/10/xml-exc-c14n#');

        # Canonicalize the SignedInfo to http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments
        # TODO Change the Canonicalization method in the xml fragment from _signedinfo_xml

        my ($signature_node) = $xpath->findnodes(
            '/dsig:Signature', $signature_xml);
        my ($signed_info_node) = $xpath->findnodes(
            '/dsig:Signature/dsig:SignedInfo',$signature_xml);

        # Add the digest value to the Signed info
        my ($digest_value_node) = $xpath->findnodes(
            '/dsig:Signature/dsig:SignedInfo/dsig:Reference/dsig:DigestValue', $signature_xml);
        $digest_value_node->removeChildNodes();
        $digest_value_node->appendText($digest);

        # At this point the SignedInfo includes the information
        # to allow us to use the _canonicalize_xml with the $signature_node

lib/XML/Sig.pm  view on Meta::CPAN

            }
        }

        # Add the Signature to the SignatureValue
        my ($signature_value_node) = $xpath->findnodes(
            '/dsig:Signature/dsig:SignatureValue', $signature_xml);
        $signature_value_node->removeChildNodes();
        $signature_value_node->appendText($signature);

        my $set = $xpath->findnodes('dsig:Signature');

        my $node = $set->get_node(1)->cloneNode( 1 );

        my $root = $dom->findnodes("//*[\@ID=\'$signid\']");

lib/XML/Sig.pm  view on Meta::CPAN

    my $xml = shift;

    my $dom = $self->_load_xml($xml);

    $self->{ parser } = XML::LibXML::XPathContext->new($dom);
    $self->{ parser }->registerNs('dsig', 'http://www.w3.org/2000/09/xmldsig#');
    $self->{ parser }->registerNs('ec', 'http://www.w3.org/2001/10/xml-exc-c14n#');
    $self->{ parser }->registerNs('saml', 'urn:oasis:names:tc:SAML:2.0:assertion');
    $self->{ parser }->registerNs('ecdsa', 'http://www.w3.org/2001/04/xmldsig-more#');

    my $signature_nodeset = $self->{ parser }->findnodes('//dsig:Signature');

    my $key_to_verify;
    if ($self->{id_attr}) {
        if ($self->{ns}) {
            foreach (keys %{$self->{ns}}) {

lib/XML/Sig.pm  view on Meta::CPAN

        $i++;
        print ("\nSignature $i\n") if $DEBUG;

        # Get SignedInfo Reference ID
        my $reference = $self->{ parser }->findvalue(
            'dsig:SignedInfo/dsig:Reference/@URI', $signature_node);
        $reference =~ s/#//g;

        print("   Reference URI: $reference\n") if $DEBUG;

        if ($key_to_verify && $key_to_verify ne $reference) {

lib/XML/Sig.pm  view on Meta::CPAN

            }
        }

        # Get SignedInfo DigestMethod Algorithim
        my $digest_method = $self->{ parser }->findvalue(
                'dsig:SignedInfo/dsig:Reference/dsig:DigestMethod/@Algorithm', $signature_node);
        $digest_method =~ s/^.*[#]//;
        print ("   Digest Method: $digest_method\n") if $DEBUG;

        # Get the DigestValue used to verify Canonical XML
        # Note that the digest may have embedded newlines in the XML
        # Decode the base64 and encode it with no newlines
        my $refdigest = encode_base64(decode_base64(_trim($self->{ parser }->findvalue(
                'dsig:SignedInfo/dsig:Reference/dsig:DigestValue', $signature_node))), "");
        print ("   Digest Value: $refdigest\n") if $DEBUG;

        # Get the SignatureValue used to verify the SignedInfo
        my $signature = _trim($self->{ parser }->findvalue('dsig:SignatureValue', $signature_node));
        print ("   Signature: $signature\n") if $DEBUG;

        # Get SignatureMethod Algorithim
        my $signature_method = $self->{ parser }->findvalue(
                'dsig:SignedInfo/dsig:SignatureMethod/@Algorithm', $signature_node);
        $signature_method =~ s/^.*[#]//;
        $signature_method =~ s/^rsa-//;
        $signature_method =~ s/^dsa-//;
        $signature_method =~ s/^ecdsa-//;
        $signature_method =~ s/^hmac-//;

        $self->{ sig_hash } = $signature_method;
        print ("   SignatureMethod: $signature_method\n") if $DEBUG;

        # Get the SignedInfo and obtain its Canonical form
        my ($signed_info) = $self->{ parser }->findnodes('dsig:SignedInfo', $signature_node);
        my $signed_info_canon = $self->_canonicalize_xml($signed_info, $signature_node);

        print "$signed_info_canon\n" if $DEBUG;

        if(my $ref = Digest::SHA->can($signature_method)) {

lib/XML/Sig.pm  view on Meta::CPAN

            );
            my $keyinfo_nodeset;
            foreach my $key_info_sig_type ( qw/X509Data RSAKeyValue DSAKeyValue ECDSAKeyValue/ ) {
                if ( $key_info_sig_type eq 'X509Data' ) {
                    $keyinfo_nodeset = $self->{ parser }->find(
                            "dsig:KeyInfo/dsig:$key_info_sig_type", $signature_node);
                    #print ("   keyinfo_nodeset X509Data: $keyinfo_nodeset\n") if $DEBUG;
                } else {
                    $keyinfo_nodeset = $self->{ parser }->find(
                            "dsig:KeyInfo/dsig:KeyValue/dsig:$key_info_sig_type", $signature_node);
                    #print ("   keyinfo_nodeset [DR]SAKeyValue: $keyinfo_nodeset\n") if $DEBUG;
                }
                if ( $keyinfo_nodeset->size ) {
                    my $verify_method = $verify_dispatch{$key_info_sig_type};
                    print ("   Verify Method: $verify_method\n") if $DEBUG;

lib/XML/Sig.pm  view on Meta::CPAN

##
sub _get_signed_xml {
    my $self = shift;
    my ($context) = @_;

    my $id = $self->{parser}->findvalue('./dsig:SignedInfo/dsig:Reference/@URI', $context);
    $id =~ s/^#//;
    print ("    Signed XML id: $id\n") if $DEBUG;

    $self->{'sign_id'} = $id;
    my $xpath = "//*[\@ID='$id']";

lib/XML/Sig.pm  view on Meta::CPAN

##
sub _transform {
    my $self = shift;
    my ($xml, $context) = @_;

    $context->setNamespace( 'http://www.w3.org/2000/09/xmldsig#', 'dsig' );
    my $transforms = $self->{parser}->find(
        'dsig:SignedInfo/dsig:Reference/dsig:Transforms/dsig:Transform',
        $context
    );

    print "_transform\n" if $DEBUG;
    foreach my $node ($transforms->get_nodelist) {

lib/XML/Sig.pm  view on Meta::CPAN

        require Crypt::PK::RSA;
    };
    confess "Crypt::PK::RSA needs to be installed so
                that we can handle X509 certificates" if $@;
    # Generate Public Key from XML
    my $mod = _trim($self->{parser}->findvalue('dsig:Modulus', $context));
    my $modBin = decode_base64( $mod );
    my $exp = _trim($self->{parser}->findvalue('dsig:Exponent', $context));
    my $expBin = decode_base64( $exp );
    my $n = unpack("H*", $modBin);
    my $e = unpack("H*", $expBin);

    my $pk = Crypt::PK::RSA->new();

lib/XML/Sig.pm  view on Meta::CPAN

        require Crypt::OpenSSL::X509;
    };
    confess "Crypt::OpenSSL::X509 needs to be installed so that we can handle X509 certificates" if $@;

    # Generate Public Key from XML
    my $certificate = _trim($self->{parser}->findvalue('dsig:X509Certificate', $context));

    # This is added because the X509 parser requires it for self-identification
    $certificate = $self->_clean_x509($certificate);

    my $cert = Crypt::OpenSSL::X509->new_from_string($certificate);

lib/XML/Sig.pm  view on Meta::CPAN


    confess "Crypt::OpenSSL::DSA >= 0.20 needs to be installed so
                    that we can handle DSA signatures" if ! $self->check_dsa_version();

    # Generate Public Key from XML
    my $p = decode_base64(_trim($self->{parser}->findvalue('dsig:P', $context)));
    my $q = decode_base64(_trim($self->{parser}->findvalue('dsig:Q', $context)));
    my $g = decode_base64(_trim($self->{parser}->findvalue('dsig:G', $context)));
    my $y = decode_base64(_trim($self->{parser}->findvalue('dsig:Y', $context)));
    my $dsa_pub = Crypt::OpenSSL::DSA->new();
    $dsa_pub->set_p($p);
    $dsa_pub->set_q($q);
    $dsa_pub->set_g($g);
    $dsa_pub->set_pub_key($y);

    # Decode signature and verify
    my $bin_signature = decode_base64($sig);

    # https://www.w3.org/TR/2002/REC-xmldsig-core-20020212/#sec-SignatureAlg
    # The output of the DSA algorithm consists of a pair of integers
    # The signature value consists of the base64 encoding of the
    # concatenation of r and s in that order ($r . $s)
    # Binary Signature is stored as a concatenation of r and s
    my $sig_size = ($dsa_pub->get_sig_size - 8)/2;

lib/XML/Sig.pm  view on Meta::CPAN


    eval {require Crypt::PK::ECC; CryptX->VERSION('0.036'); 1}
    or confess "Crypt::PK::ECC 0.036+ needs to be installed so
             that we can handle ECDSA signatures";
    # Generate Public Key from XML
    my $oid = _trim($self->{parser}->findvalue('.//dsig:NamedCurve/@URN', $context));

    use URI ();
    my $u1 = URI->new($oid);
    $oid = $u1->nss;

lib/XML/Sig.pm  view on Meta::CPAN

        '1.3.36.3.3.2.8.1.1.9'  => 'brainpoolP320r1',
        '1.3.36.3.3.2.8.1.1.11' => 'brainpoolP384r1',
        '1.3.36.3.3.2.8.1.1.13' => 'brainpoolP512r1',
    );

    my $x = $self->{parser}->findvalue('.//dsig:PublicKey/dsig:X/@Value', $context);
    my $y = $self->{parser}->findvalue('.//dsig:PublicKey/dsig:Y/@Value', $context);

    my $ecdsa_pub = Crypt::PK::ECC->new();

    $ecdsa_pub->import_key({
        kty => "EC",

lib/XML/Sig.pm  view on Meta::CPAN


        my $oid         = $key_hash->{ curve_oid };
        my $x           = $key_hash->{ pub_x };
        my $y           = $key_hash->{ pub_y };

        $self->{KeyInfo} = "<dsig:KeyInfo>
                             <dsig:KeyValue>
                                <dsig:ECDSAKeyValue>
                                    <dsig:DomainParameters>
                                        <dsig:NamedCurve URN=\"urn:oid:$oid\" />
                                    </dsig:DomainParameters>
                                    <dsig:PublicKey>
                                        <dsig:X Value=\"$x\" />
                                        <dsig:Y Value=\"$y\" />
                                    </dsig:PublicKey>
                                </dsig:ECDSAKeyValue>
                             </dsig:KeyValue>
                            </dsig:KeyInfo>";
        $self->{key_type} = 'ecdsa';
    }
    else {
        confess "did not get a new Crypt::PK::ECC object";
    }

lib/XML/Sig.pm  view on Meta::CPAN

        my $g = encode_base64( $dsa_key->get_g(), '' );
        my $p = encode_base64( $dsa_key->get_p(), '' );
        my $q = encode_base64( $dsa_key->get_q(), '' );
        my $y = encode_base64( $dsa_key->get_pub_key(), '' );

        $self->{KeyInfo} = "<dsig:KeyInfo>
                             <dsig:KeyValue>
                              <dsig:DSAKeyValue>
                               <dsig:P>$p</dsig:P>
                               <dsig:Q>$q</dsig:Q>
                               <dsig:G>$g</dsig:G>
                               <dsig:Y>$y</dsig:Y>
                              </dsig:DSAKeyValue>
                             </dsig:KeyValue>
                            </dsig:KeyInfo>";
        $self->{key_type} = 'dsa';
    }
    else {
        confess "did not get a new Crypt::PK::RSA object";
    }

lib/XML/Sig.pm  view on Meta::CPAN


        if (!$self->{ x509 }) {
            my $key_params = $rsaKey->key2hash;
            my $exp = encode_base64(pack("H*", $key_params->{e}), '');
            my $mod = encode_base64(pack("H*", $key_params->{N}), '');
            $self->{KeyInfo} = "<dsig:KeyInfo>
                                 <dsig:KeyValue>
                                  <dsig:RSAKeyValue>
                                   <dsig:Modulus>$mod</dsig:Modulus>
                                   <dsig:Exponent>$exp</dsig:Exponent>
                                  </dsig:RSAKeyValue>
                                 </dsig:KeyValue>
                                </dsig:KeyInfo>";
        }
    }
    else {
        confess "did not get a new Crypt::PK::RSA object";
    }

lib/XML/Sig.pm  view on Meta::CPAN


    if (! defined $self->{ key_name }) {
        return;
    }

    $self->{KeyInfo} = qq{<dsig:KeyInfo><dsig:KeyName>$self->{key_name}</dsig:KeyName></dsig:KeyInfo>};
}

##
## _load_x509_key($key_text)
##

lib/XML/Sig.pm  view on Meta::CPAN

        my $cert = Crypt::OpenSSL::X509->new_from_string($text);
        if ( $cert ) {
            $self->{ cert_obj } = $cert;
            my $cert_text = $cert->as_string;
            $cert_text =~ s/-----[^-]*-----//gm;
            $self->{KeyInfo} = "<dsig:KeyInfo><dsig:X509Data><dsig:X509Certificate>\n"._trim($cert_text)."\n</dsig:X509Certificate></dsig:X509Data></dsig:KeyInfo>";
        }
        else {
            confess "Could not load certificate from $file";
        }
    }

lib/XML/Sig.pm  view on Meta::CPAN

    my $cert = Crypt::OpenSSL::X509->new_from_string($text);
    if ( $cert ) {
        $self->{ cert_obj } = $cert;
        my $cert_text = $cert->as_string;
        $cert_text =~ s/-----[^-]*-----//gm;
        $self->{KeyInfo} = "<dsig:KeyInfo><dsig:X509Data><dsig:X509Certificate>\n"._trim($cert_text)."\n</dsig:X509Certificate></dsig:X509Data></dsig:KeyInfo>";
    }
    else {
            confess "Could not load certificate from given text.";
    }

lib/XML/Sig.pm  view on Meta::CPAN

##
sub _signature_xml {
    my $self = shift;
    my ($signed_info,$signature_value) = @_;

    return qq{<dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
            $signed_info
            <dsig:SignatureValue>$signature_value</dsig:SignatureValue>
            $self->{KeyInfo}
        </dsig:Signature>};
}

##
## _signedinfo_xml($digest_xml)
##

lib/XML/Sig.pm  view on Meta::CPAN

    if (! defined $self->{key_type} && defined $self->{ hmac_key } ) {
        $self->{key_type} = 'hmac';
    }

    if ( $self->{ sig_hash } eq 'sha1' && $self->{key_type} ne 'ecdsa' ) {
        $algorithm = "http://www.w3.org/2000/09/xmldsig#$self->{key_type}-$self->{ sig_hash }";
    }
    elsif ( $self->{key_type} eq 'ecdsa' ) {
        if ( $self->{ sig_hash } eq 'ripemd160' || $self->{ sig_hash } eq  'whirlpool' ) {
            $algorithm = "http://www.w3.org/2007/05/xmldsig-more#$self->{key_type}-$self->{ sig_hash }";
        }
        else {
            $algorithm = "http://www.w3.org/2001/04/xmldsig-more#$self->{key_type}-$self->{ sig_hash }";
        }
    }
    elsif ( $self->{ key_type } eq 'dsa' && $self->{ sig_hash } eq 'sha256') {
        $algorithm = "http://www.w3.org/2009/xmldsig11#$self->{key_type}-$self->{ sig_hash }";
    }
    else {
        $algorithm = "http://www.w3.org/2001/04/xmldsig-more#$self->{key_type}-$self->{ sig_hash }";
    }

    #return qq{<dsig:SignedInfo xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
    return qq{<dsig:SignedInfo xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
                <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                <dsig:SignatureMethod Algorithm="$algorithm" />
                $digest_xml
            </dsig:SignedInfo>};
}

##
## _reference_xml($id)
##

lib/XML/Sig.pm  view on Meta::CPAN

    my $id = shift;
    my ($digest) = @_;

    my $algorithm;
    if ( $self->{ digest_hash } eq 'sha1') {
        $algorithm = "http://www.w3.org/2000/09/xmldsig#$self->{ digest_hash }";
    }
    elsif (($self->{ digest_hash } eq 'sha224') || ($self->{ digest_hash } eq 'sha384')) {
        $algorithm = "http://www.w3.org/2001/04/xmldsig-more#$self->{ digest_hash }";
    }
    else {
        $algorithm = "http://www.w3.org/2001/04/xmlenc#$self->{ digest_hash }";
    }

    return qq{<dsig:Reference URI="#$id">
                        <dsig:Transforms>
                            <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
                            <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                        </dsig:Transforms>
                        <dsig:DigestMethod Algorithm="$algorithm" />
                        <dsig:DigestValue>$digest</dsig:DigestValue>
                    </dsig:Reference>};
}


##
## _canonicalize_xml($xml, $context)

lib/XML/Sig.pm  view on Meta::CPAN

    my $self = shift;
    my ($xml, $context) = @_;

    print ("_canonicalize_xml:\n") if $DEBUG;
    my $canon_method = $self->{ parser }->findnodes(
                'dsig:SignedInfo/dsig:CanonicalizationMethod', $context
    );

    foreach my $node ($canon_method->get_nodelist) {
        my $alg = $node->getAttribute('Algorithm');

lib/XML/Sig.pm  view on Meta::CPAN


    # DSA 1024-bit only permits the signing of 20 bytes or less, hence the sha1
    # DSA 2048-bit only permits the signing sha256
    my $bin_signature = $self->{key_obj}->do_sign( $self->{ sig_method }($signed_info_canon) );

    # https://www.w3.org/TR/2002/REC-xmldsig-core-20020212/#sec-SignatureAlg
    # The output of the DSA algorithm consists of a pair of integers
    # The signature value consists of the base64 encoding of the
    # concatenation of r and s in that order ($r . $s)
    my $r = $bin_signature->get_r;
    my $s = $bin_signature->get_s;

lib/XML/Sig.pm  view on Meta::CPAN

Now, let's insert a signature:

  <?xml version="1.0"?>
  <foo ID="abc">
    <bar>123</bar>
    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
      <SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
        <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
        <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
        <Reference URI="#abc">
          <Transforms>
            <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
          </Transforms>
          <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
          <DigestValue>9kpmrvv3peVJpNSTRycrV+jeHVY=</DigestValue>
        </Reference>
      </SignedInfo>
      <SignatureValue>
        HXUBnMgPJf//j4ihaWnaylNwAR5AzDFY83HljFIlLmTqX1w1C72ZTuRObvYve8TNEbVsQlTQkj4R

lib/XML/Sig.pm  view on Meta::CPAN

    </Signature>
  </foo>

=head1 SEE ALSO

L<http://www.w3.org/TR/xmldsig-core/>

=head1 VERSION CONTROL

L<https://github.com/perl-net-saml2/perl-XML-Sig>

 view all matches for this distribution


XML-WBXML

 view release on metacpan or  search on metacpan

t/samples/drmrel-002.xml  view on Meta::CPAN

<?xml version="1.0"?>
<!DOCTYPE o-ex:rights PUBLIC "-//OMA//DTD DRMREL 1.0//EN" "http://www.openmobilealliance.org/DTD/drmrel10.dtd">
<o-ex:rights xmlns:o-ex="http://odrl.net/1.1/ODRL-EX" xmlns:o-dd="http://odrl.net/1.1/ODRL-DD" xmlns:ds="http://www.w3.org/2000/09/xmldsig#/">
    <o-ex:context>
        <o-dd:version>1.0</o-dd:version>
    </o-ex:context>
    <o-ex:agreement>
        <o-ex:asset>

 view all matches for this distribution


XS-libcares

 view release on metacpan or  search on metacpan

c-ares-1.34.3/include/ares_nameser.h  view on Meta::CPAN

  ns_r_nxrrset  = 8,  /* RRset does not exist */
  ns_r_notauth  = 9,  /* Not authoritative for zone */
  ns_r_notzone  = 10, /* Zone of record different from zone section */
  ns_r_max      = 11,
  /* The following are TSIG extended errors */
  ns_r_badsig  = 16,
  ns_r_badkey  = 17,
  ns_r_badtime = 18
} ns_rcode;

#endif /* CARES_HAVE_ARPA_NAMESER_H */

c-ares-1.34.3/include/ares_nameser.h  view on Meta::CPAN

#endif
#ifndef NOTZONE
#  define NOTZONE 10 /* ns_r_notzone */
#endif
#ifndef TSIG_BADSIG
#  define TSIG_BADSIG 16 /* ns_r_badsig */
#endif
#ifndef TSIG_BADKEY
#  define TSIG_BADKEY 17 /* ns_r_badkey */
#endif
#ifndef TSIG_BADTIME

 view all matches for this distribution


XSConfig

 view release on metacpan or  search on metacpan

Config_xs.in  view on Meta::CPAN

d_vendorlib,		T_INV,0,ALN64I"@@d_vendorlib@@"
d_vendorscript,		T_INV,0,ALN64I"@@d_vendorscript@@"
d_vfork,		T_INV,0,ALN64I"@@d_vfork@@"
d_vms_case_sensitive_symbols,	T_INV,0,ALN64I"@@d_vms_case_sensitive_symbols@@"
d_void_closedir,	T_INV,0,ALN64I"@@d_void_closedir@@"
d_voidsig,		T_INV,0,ALN64I"@@d_voidsig@@"
d_voidtty,		T_INV,0,ALN64I"@@d_voidtty@@"
d_volatile,		T_INV,0,ALN64I"@@d_volatile@@"
d_vprintf,		T_INV,0,ALN64I"@@d_vprintf@@"
d_vsnprintf,		T_INV,0,ALN64I"@@d_vsnprintf@@"
d_wait4,		T_INV,0,ALN64I"@@d_wait4@@"

Config_xs.in  view on Meta::CPAN

getservbyname_r_proto,	T_INV,0,ALN64I"@@getservbyname_r_proto@@"
getservbyport_r_proto,	T_INV,0,ALN64I"@@getservbyport_r_proto@@"
getservent_r_proto,	T_INV,0,ALN64I"@@getservent_r_proto@@"
getspnam_r_proto,	T_INV,0,ALN64I"@@getspnam_r_proto@@"
gidformat,		T_INV,0,ALN64I"@@gidformat@@"
gidsign,		T_INV,0,ALN64I"@@gidsign@@"
gidsize,		T_INV,0,ALN64I"@@gidsize@@"
gidtype,		T_INV,0,ALN64I"@@gidtype@@"
git_ancestor,		T_INV,0,ALN64I"@@git_ancestor@@"
git_branch,		T_INV,0,ALN64I"@@git_branch@@"
git_commit_date,	T_INV,0,ALN64I"@@git_commit_date@@"

Config_xs.in  view on Meta::CPAN

u64size,		T_INV,0,ALN64I"@@u64size@@"
u64type,		T_INV,0,ALN64I"@@u64type@@"
u8size,			T_INV,0,ALN64I"@@u8size@@"
u8type,			T_INV,0,ALN64I"@@u8type@@"
uidformat,		T_INV,0,ALN64I"@@uidformat@@"
uidsign,		T_INV,0,ALN64I"@@uidsign@@"
uidsize,		T_INV,0,ALN64I"@@uidsize@@"
uidtype,		T_INV,0,ALN64I"@@uidtype@@"
uname,			T_INV,0,ALN64I"@@uname@@"
uniq,			T_INV,0,ALN64I"@@uniq@@"
uquadtype,		T_INV,0,ALN64I"@@uquadtype@@"

 view all matches for this distribution


Zydeco

 view release on metacpan or  search on metacpan

COPYRIGHT  view on Meta::CPAN

 t/31lexhas.t
 t/40loading.t
 t/41ps.t
 t/42mf.t
 t/50complextypes.t
 t/51mixedsigs.t
 t/52lists.t
 t/53outsiders.t
 t/80lines.t
 t/96box.t
 t/97defaults.t

 view all matches for this distribution


cpan2rpm

 view release on metacpan or  search on metacpan

cpan2rpm  view on Meta::CPAN

            system(@cmd);
            die "RPM build (@cmd) failed [$ret]" if $ret = $? >> 8;
            if ($info->{sign} && -r $info->{rpm}) {
                print "\n\nSigning package (passphrase required) ...\n\n";
                sleep 2;
                system "rpmsign", "--addsign", $info->{rpm};
                }
            }
        }

    print "RPM: $info->{rpm}\n" if -r $info->{rpm};

 view all matches for this distribution


frogbak

 view release on metacpan or  search on metacpan

rsh.c  view on Meta::CPAN

	struct servent *sp;
	long omask;
	int argoff, asrsh, ch, dflag, nflag, one, pid, rem, uid;
	register char *p;
	char *args, *host, *user, *copyargs();
	void sendsig();
	char *time_message;
	int timeout;

	argoff = asrsh = dflag = nflag = 0;
	one = 1;

rsh.c  view on Meta::CPAN

	}

	(void)setuid(uid);
	omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGTERM));
	if (signal(SIGINT, SIG_IGN) != SIG_IGN)
		(void)signal(SIGINT, sendsig);
	if (signal(SIGQUIT, SIG_IGN) != SIG_IGN)
		(void)signal(SIGQUIT, sendsig);
	if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
		(void)signal(SIGTERM, sendsig);

	if (!nflag) {
		pid = fork();
		if (pid < 0) {
			(void)fprintf(stderr,

rsh.c  view on Meta::CPAN

		}
	} while (readfrom);
}

void
sendsig(signo)
	char signo;
{
#ifdef KERBEROS
#ifdef CRYPT
	if (doencrypt)

 view all matches for this distribution


git-deploy

 view release on metacpan or  search on metacpan

design.pod  view on Meta::CPAN

=over 4

=item Use configuration not auto-detection

One problem with the ancestor of C<git-deploy> was that in a misguided attempt to
make things easier it attempted to do a lot of auto-detection. In hindsight
this was almost definitely counter productive.  It neither made it easier for
the users, nor for the developers. C<git-deploy> should avoid this mistake
and use explicit configuration for everything it does .

=item Delegate and not implement

 view all matches for this distribution


onsearch

 view release on metacpan or  search on metacpan

lib/OnSearch/Utils.pm  view on Meta::CPAN

}

sub sigwrapper {
    my ($signame, $sigsub, $wrapsub, @args) = @_;
    
    my $oldsig = $SIG{$signame} if $SIG{$signame}; 
    $SIG{$signame} = ($sigsub ? $sigsub : 'IGNORE');
    &$wrapsub (@args);
    $SIG{$signame} = $oldsig if $oldsig;
}

###
### TO DO - this so far is the most reliable way to index
### immediately.  Try to clean up this implementation.

 view all matches for this distribution


perl

 view release on metacpan or  search on metacpan

dist/Locale-Maketext/lib/Locale/Maketext.pm  view on Meta::CPAN

        DEBUG and warn '%' . $class . '::Lexicon contains ',
            scalar(keys %{$class . '::Lexicon'}), " entries\n";
    }

    # Implements depth(height?)-first recursive searching of superclasses.
    # In hindsight, I suppose I could have just used Class::ISA!
    foreach my $superclass (@{$class . '::ISA'}) {
        DEBUG and warn " Super-class search into $superclass\n";
        next if $seen_r->{$superclass}++;
        push @lex_refs, @{&_lex_refs($superclass, $seen_r)};  # call myself
    }

 view all matches for this distribution


perl_mlb

 view release on metacpan or  search on metacpan

Locale/Maketext.pm  view on Meta::CPAN

    print "%" . $class . "::Lexicon contains ",
         scalar(keys %{$class . '::Lexicon'}), " entries\n" if DEBUG;
  }

  # Implements depth(height?)-first recursive searching of superclasses.
  # In hindsight, I suppose I could have just used Class::ISA!
  foreach my $superclass (@{$class . "::ISA"}) {
    print " Super-class search into $superclass\n" if DEBUG;
    next if $seen_r->{$superclass}++;
    push @lex_refs, @{&_lex_refs($superclass, $seen_r)};  # call myself
  }

 view all matches for this distribution


tinyperl

 view release on metacpan or  search on metacpan

lib/Config.pm  view on Meta::CPAN

d_vendorarch='undef'
d_vendorbin='undef'
d_vendorlib='undef'
d_vfork='undef'
d_void_closedir='undef'
d_voidsig='define'
d_voidtty=''
d_volatile='define'
d_vprintf='define'
d_wait4='undef'
d_waitpid='define'

lib/Config.pm  view on Meta::CPAN

getservbyname_r_proto='0'
getservbyport_r_proto='0'
getservent_r_proto='0'
getspnam_r_proto='0'
gidformat='"ld"'
gidsign='-1'
gidsize='4'
gidtype='gid_t'
glibpth='/usr/shlib  /lib/pa1.1 /usr/lib/large /lib /usr/lib /usr/lib/386 /lib/386 /lib/large /usr/lib/small /lib/small /usr/ccs/lib /usr/ucblib /usr/shlib '
gmake='gmake'
gmtime_r_proto='0'

lib/Config.pm  view on Meta::CPAN

u64size='8'
u64type='unsigned __int64'
u8size='1'
u8type='unsigned char'
uidformat='"ld"'
uidsign='-1'
uidsize='4'
uidtype='uid_t'
uname='uname'
uniq='uniq'
uquadtype='unsigned __int64'

 view all matches for this distribution


uplug-main

 view release on metacpan or  search on metacpan

share/ext/gma/rc/ME.tralex  view on Meta::CPAN

belakang <> hindmost
corot <> hindmost
halang <> hindrance
hambatan <> hindrance
rintangan <> hindrance
alam <> hindsight
hindu <> hindu
berengsel <> hinge
bergantung <> hinge
engsel <> hinge
alamat <> hint

 view all matches for this distribution


( run in 1.909 second using v1.01-cache-2.11-cpan-71847e10f99 )