Crypt-MagicSignatures-Envelope
view release on metacpan or search on metacpan
The algorithm used for signing the MagicEnvelope.
Defaults to C<RSA-SHA256>, which is the only supported algorithm.
=head2 data
my $data = $me->data;
$me->data('Hello world!');
The decoded data folded in the MagicEnvelope.
=head2 data_type
my $data_type = $me->data_type;
$me->data_type('text/plain');
The Mime type of the data folded in the MagicEnvelope.
Defaults to C<text/plain>.
<author><uri>alice@example.com</uri></author>
</entry>
XML
# Define an xml mime type
$me->data_type('application/atom+xml');
print $me->dom->at('author > uri')->text;
# alice@example.com
The L<Mojo::DOM> object of the decoded data,
in the case the MagicEnvelope contains XML.
B<This attribute is experimental and may change without warnings!>
=head2 encoding
my $encoding = $me->encoding;
The encoding of the MagicEnvelope.
lib/Crypt/MagicSignatures/Envelope.pm view on Meta::CPAN
unless (defined $data) {
carp 'No data payload defined';
return;
};
my $temp;
# Add data type if given
$self->data_type( $temp ) if $temp = $data->attr->{type};
# Add decoded data
$self->data( b64url_decode( $data->text ) );
# The envelope is empty
unless ($self->data) {
carp 'No data payload defined';
return;
};
# Check algorithm
if (($temp = $env->at('alg')) &&
lib/Crypt/MagicSignatures/Envelope.pm view on Meta::CPAN
The algorithm used for signing the MagicEnvelope.
Defaults to C<RSA-SHA256>, which is the only supported algorithm.
=head2 data
my $data = $me->data;
$me->data('Hello world!');
The decoded data folded in the MagicEnvelope.
=head2 data_type
my $data_type = $me->data_type;
$me->data_type('text/plain');
The Mime type of the data folded in the MagicEnvelope.
Defaults to C<text/plain>.
lib/Crypt/MagicSignatures/Envelope.pm view on Meta::CPAN
<author><uri>alice@example.com</uri></author>
</entry>
XML
# Define an xml mime type
$me->data_type('application/atom+xml');
print $me->dom->at('author > uri')->text;
# alice@example.com
The L<Mojo::DOM> object of the decoded data,
in the case the MagicEnvelope contains XML.
B<This attribute is experimental and may change without warnings!>
=head2 encoding
my $encoding = $me->encoding;
The encoding of the MagicEnvelope.
( run in 0.357 second using v1.01-cache-2.11-cpan-26ccb49234f )