Crypt-MagicSignatures-Envelope

 view release on metacpan or  search on metacpan

Readme.pod  view on Meta::CPAN

If one key succeeds, the envelope is verified.

An element can be a L<Crypt::MagicSignatures::Key> object,
a MagicKey in
L<compact notation|http://salmon-protocol.googlecode.com/svn/trunk/draft-panzer-magicsig-01.html#rfc.section.8.1>
or a hash reference
containing the non-generation parameters accepted by the
L<Crypt::MagicSignatures::Key> constructor.

For referring to a certain key, an array reference
can be passed, containing the key (defined as described above)
with an optional prepended key id and an optional flag appended,
referring to the data to be verified.
Conforming with the specification the default value is C<-base>,
referring to the
L<signature base string|http://salmon-protocol.googlecode.com/svn/trunk/draft-panzer-magicsig-01.html#rfc.section.3.2>
of the MagicEnvelope.
C<-data> will verify against the data only, C<-compatible> will first try to
verify against the base signature string and then will
verify against the data on failure
(this is implemented for compatibility with non-standard implementations).

B<This method is experimental and may change without warnings!>


=head2 to_compact

  my $compact_string = $me->to_compact;

Returns the MagicEnvelope in
L<compact notation|http://salmon-protocol.googlecode.com/svn/trunk/draft-panzer-magicsig-01.html#compact>.


=head2 to_json

  my $json_string = $me->to_json;

Returns the MagicEnvelope as a stringified
L<JSON representation|http://salmon-protocol.googlecode.com/svn/trunk/draft-panzer-magicsig-01.html#anchor5>.


=head2 to_xml

  my $xml_string = $me->to_xml;
  my $xml_provenance_string = $me->to_xml(1);

Returns the MagicEnvelope as a stringified
L<xml representation|http://salmon-protocol.googlecode.com/svn/trunk/draft-panzer-magicsig-01.html#anchor4>.
If a C<true> value is passed, a provenance fragment will be returned instead
of a valid xml document.


=head1 DEPENDENCIES

L<Crypt::MagicSignatures::Key>,
L<Mojolicious>.
For speed improvements, see the recommendations in
L<Crypt::MagicSignatures::Key|Crypt::MagicSignatures::Key/DEPENDENCIES>.


=head1 KNOWN BUGS AND LIMITATIONS

The signing and verification is not guaranteed to be
compatible with other implementations, due to different
versions of the specification.
Implementations like L<StatusNet|http://status.net/> (L<Identi.ca|http://identi.ca/>),
L<MiniMe|https://code.google.com/p/minime-microblogger/>, and examples from the
L<reference implementation|https://code.google.com/p/salmon-protocol/source/browse/>
are tested.

See the test suite for further information.


=head1 AVAILABILITY

  https://github.com/Akron/Crypt-MagicSignatures-Envelope


=head1 COPYRIGHT AND LICENSE

Copyright (C) 2012-2021, L<Nils Diewald|https://www.nils-diewald.de/>.

This program is free software, you can redistribute it
and/or modify it under the terms of the Artistic License version 2.0.

=cut



( run in 2.000 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )