NAME
Crypt::Bear::RSA::PublicKey - An RSA public key in BearSSL
VERSION
version 0.002
SYNOPSIS
my $ciphertext = $public_key->oaep_encrypt('sha256', $data, $prng, '');
if ($public_key->pkcs1_verify('sha256', $signature) eq $hash) {
...
}
DESCRIPTION
This represents an RSA public key.
METHODS
oaep_encrypt($digest, $plaintext, $prng, $label)
This encrypts the $plaintext
, using the given $digest
, $prng
and $label
(which may be an empty string).
pkcs1_verify($digest, $signature)
This verifies a signature, and returns the hash that was signed. It's the user's responsibility to check if that hash matches the expected value.
AUTHOR
Leon Timmermans <fawaka@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2024 by Leon Timmermans.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.