Mark Overmeer > XML-Compile-WSS-Signature-0.90 > XML::Compile::WSS::Sign::RSA

Download:
XML-Compile-WSS-Signature-0.90.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.90   Source   Latest Release: XML-Compile-WSS-Signature-2.01

NAME ^

XML::Compile::WSS::Sign::RSA - WSS Signing with RSA

INHERITANCE ^

 XML::Compile::WSS::Sign::RSA
   is a XML::Compile::WSS::Sign

SYNOPSIS ^

  # either
  use XML::Compile::WSS::Util qw/DSIG_RSA_SHA1/;
  my $sign = XML::Compile::WSS::Sign->new(type => DSIG_RSA_SHA1);

  # or
  use XML::Compile::WSS::Sign::RSA;
  my $token = XML::Compile::WSS::Sign::RSA->new(
     hashing => 'SHA1', ...);

METHODS ^

Constructors

XML::Compile::WSS::Sign::RSA->fromConfig(CONFIG, [PRIVKEY])

See "Constructors" in XML::Compile::WSS::Sign

XML::Compile::WSS::Sign::RSA->new(OPTIONS)
 -Option     --Defined in             --Default
  hashing                               <derived from type>
  private_key                           undef
  public_key                            <from private key>
  type         XML::Compile::WSS::Sign  DSIG_RSA_SHA1
hashing => STRING

For instance, SHA1.

private_key => OBJECT|STRING|FILENAME

Required if you want to use this object to sign(). See privateKey()

public_key => OBJECT|STRING|FILENAME

Required if you want to use this object to check(). See publicKey() Usually, you need either the public or the private key, not both. However, when you specify a private key, you can ask for the public key as well: it is included.

type => TYPE

Attributes

$obj->hashing()
$obj->privateKey([KEY, [HASHING]])

The private key must be set with new(private_key) or this method before you can sign(). This method will return the text of the key.

  • an Crypt::OpenSSL::RSA object
  • PEM formatted key, as accepted by Crypt::OpenSSL::RSA method new_private_key()
  • a filename which contains such bytes.
$obj->privateKeyRSA()

Returns the private key wrapped in a Crypt::OpenSSL::RSA object.

$obj->publicKey([KEY])

Set the public key. You can pass a KEY, which is one of

$obj->publicKeyRSA()

Returns the Crypt::OpenSSL::RSA-wrapped public key.

$obj->publicKeyString('PKCS1'|'X509')
$obj->type()

See "Attributes" in XML::Compile::WSS::Sign

Handlers

$obj->check(ref-BYTES, SIGNATURE)

Use TOKEN to check whether the BYTES (passed by reference) match the SIGNATURE.

For RSA signing, the token can be

$obj->sign(ref-BYTES)

See "Handlers" in XML::Compile::WSS::Sign

DETAILS ^

Read DETAILS in XML::Compile::WSS::Sign first.

Signing, the generic part

Defend against man-in-the-middle

Signing with RSA

Limitations

The signing algorithm uses Crypt::OpenSSL::RSA. According to its manual-page, the current implementation is limited to

SEE ALSO ^

This module is part of XML-Compile-WSS-Signature distribution version 0.90, built on November 05, 2012. Website: http://perl.overmeer.net/xml-compile/

Other distributions in this suite: XML::Compile, XML::Compile::SOAP, XML::Compile::SOAP12, XML::Compile::SOAP::Daemon, XML::Compile::SOAP::WSA, XML::Compile::C14N, XML::Compile::WSS, XML::Compile::WSS::Signature, XML::Compile::Tester, XML::Compile::Cache, XML::Compile::Dumper, XML::Compile::RPC, XML::Rewrite, XML::eXistDB, and XML::LibXML::Simple.

Please post questions or ideas to the mailinglist at http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile

For live contact with other developers, visit the #xml-compile channel on irc.perl.org.

LICENSE ^

Copyrights 2012 by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html

syntax highlighting: