newAccount_booleans()) {
next if !exists $opts{$name};
($opts{$name} &&= JSON::true()) ||= JSON::false();
}
return Net::ACME2::PromiseUtil::then(
$self->_post( 'newAcc
CME2::HTTP::Response;
use strict;
use warnings;
use parent qw( HTTP::Tiny::UA::Response );
use JSON ();
use Net::ACME2::X ();
sub die_because_unexpected {
my ($self) = @_;
die N
ut certificate issuance, apparently?
sub content_struct {
my ($self) = @_;
my $json = ($self->{'_json'} ||= JSON->new()->allow_nonref());
return $json->decode( $self->content() );
}
1;
-----------------------------------------------------------------
use strict;
use warnings;
use JSON ();
use MIME::Base64 ();
use Net::ACME2::X ();
BEGIN {
*_encode_b64u = *M
r
$header->{alg} = $alg;
# encode header
my $json_header = $self->_encode_json($header);
my $b64u_header = _encode_b64u($json_header);
my $b64u_signature = _encode_b64u( $signer_
$self->_encode_json(
{
protected => $b64u_header,
payload => $b64u_payload,
signature => $b64u_signature,
}
);
}
sub _encode_json {
my ($se
my $json = qq<{"e":"$e","kty":"RSA","n":"$n"}>;
require Digest::SHA;
my $hash_cr = Digest::SHA->can( _JWK_THUMBPRINT_DIGEST() );
return MIME::Base64::encode_base64url( $hash_cr->($json) )
l.
It wraps POSTs in JWSes (JSON Web Signatures) as needed.
There should be no reason to interact with this class in production.
=cut
use strict;
use warnings;
use JSON ();
use Net::ACME2::Error
seUtil ();
use Net::ACME2::X ();
use constant _CONTENT_TYPE => 'application/jose+json';
my $_MAX_RETRIES = 5;
#accessed from tests
our $_NONCE_HEADER = 'replay-nonce';
#Used in tes
my $jws = shift;
# local $opts_hr->{'headers'}{'Content-Type'} = 'application/jose+json';
return Net::ACME2::PromiseUtil::do_then_catch(
sub {