Latest commit c5599e4 Feb 20, 2017 @retupmoca retupmoca Attempt to support openssl pubkey exports; version bump
The RSAPublicKey call reads a PEM formatted key in PKCS#1 format.
However, 'openssl rsa' exports public keys using 'SubjectPublicKeyInfo'
format, which requires the RSA_PUBKEY call to read in.

We attempt to autodetect the type of key it is ('BEGIN RSA PUBLIC KEY'
vs 'BEGIN PUBLIC KEY'), and use the correct function.

OpenSSL Build Status Build status

OpenSSL bindings for Perl 6


Socket connection class. You probably want to use IO::Socket::SSL instead of this (low-level) interface.

use OpenSSL;

my $ssl =, :client);
my $s =$host, :port(443));
# $ssl.write, etc


Public key signing tools

use OpenSSL::RSATools;

my $pem = slurp 'key.pem';
my $rsa = => $pem);
my $data = 'as df jk l';
my $signature = $rsa.sign($data.encode);
my $rsa = => $public);
if $rsa.verify($data.encode, $signature) { ... }


Symmetric encryption tools (currently only AES256/192/128 encrypt/decrypt)

use OpenSSL::CryptTools;

my $ciphertext = encrypt("asdf".encode,
                         :iv(("0" x 16).encode),
                         :key(('x' x 32).encode));
my $plaintext = decrypt($ciphertext,
                        :iv(("0" x 16).encode),
                        :key(('x' x 32).encode));


Digest Functions (currently only md5/sha1/sha256)

use OpenSSL::Digest;
my Blob $digest = md5("xyz".encode);