OpenSSL bindings for Perl 6
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Check for LibreSSL (#67) Aug 20, 2018
resources Update Windows libs to 1.0.2k Apr 29, 2017
t Add OpenSSL::Version (#65) Jul 30, 2018
.travis.yml Allow network tests to be enabled/disabled Sep 28, 2017
META6.json Bump version 0.1.21 Aug 20, 2018 add appveyor badge Mar 29, 2018

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/sha384/sha512)

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


OO-Interface supporting incremental digesting

use OpenSSL::Digest::MD5;

my $md5 =; # Create fresh object
$md5.add('abc');                    # pass in Str or Blob
$md5.add('def');                    # Add some more data
my $digest = $md5.hash;             # Blob hash (and reset)
$md5.addfile('myfile');             # Read a file
my $hexdigest = $md5.hex;           # hex hash  (and reset)