o reload
confguration as needed
=head2 $self->encrypt_data(data => $data)
Serialize I<$data> to JSON, encrypt it, and encode as base64. Also compute HMAC
code for the encrypted data. Returns hash re
pt_data>. First checks HMAC code for data.
If data was not tampered, decrypts it and decodes from JSON. Returns data, or
undef if decryption failed.
=head2 $self->encrypt_payload(data => $data)
Enc
structures, scalars, and references provided that the data can be serialized
as an attribute on a JSON document.
=head2 $self->decrypt_payload(value => $value)
Accepts payload encrypted with I<encry
.
=cut
use Carp;
use Crypt::CBC;
use Digest::SHA qw(hmac_sha256_base64 sha256);
use Encode;
use JSON::MaybeXS;
use MIME::Base64;
use String::Compare::ConstantTime;
use YAML::XS;
our $VERSION = '1.1
_secret(@_)); ## nocritic
};
=head2 $self->encrypt_data(data => $data)
Serialize I<$data> to JSON, encrypt it, and encode as base64. Also compute HMAC
code for the encrypted data. Returns hash re
my $json = JSON::MaybeXS->new;
sub encrypt_data {
my ($self, %args) = @_;
croak "data argument is required and must be a reference" unless $args{data} and ref $args{data};
my $json_data