+ #handle the challenge/response handshake
+ if ( $self->error_message eq '_challenge' ) { #XXX infinite loop protection?
+
+ die "no private key available" unless $self->private_key;
+
+ #decrypt the challenge with the private key
+ my $challenge = decode_base64($response{'card_challenge'});
+
+ #here is the hardest part to implement at each client side
+ my $rsa_priv = Crypt::OpenSSL::RSA->new_private_key($self->private_key);
+ my $response = $rsa_priv->decrypt($challenge);
+
+ #try the transaction again with the challenge response
+ # (B:OP could sure use a better way to alter one value)
+ my %content = $self->content;
+ $content{'card_response'} = encode_base64($response, '');
+ $self->content(%content);
+ $self->submit;
+ }
+