Protocol::OTR::Contact - Off-the-Record Contact
version 0.05
use Protocol::OTR qw( :constants ); my $otr = Protocol::OTR->new( { privkeys_file => "otr.private_key", contacts_file => "otr.fingerprints", instance_tags_file => "otr.instance_tags", } ); # find or create account my $alice = $otr->account('alice@domain', 'prpl-jabber'); # find or create contact known by $alice my $bob = $alice->contact('bob@domain'); # return all $bob's fingerprints my @fingerprints = $bob->fingerprints(); # current active fingerprint my $active_fingerprint = $bob->active_fingerprint(); # create secure channel to Bob my $channel = $bob->channel( { policy => ..., max_message_size => ..., on_write => sub { ... }, on_read => sub { ... }, on_gone_secure => sub { ... }, on_gone_insecure => sub { ... }, on_still_secure => sub { ... }, on_unverified_fingerprint => sub { ... }, on_symkey => sub { ... }, on_timer => sub { ... }, on_smp => sub { ... }, on_error => sub { ... }, on_event => sub { ... }, on_smp_event => sub { ... }, on_before_encrypt => sub { ... }, on_after_decrypt => sub { ... }, on_is_contact_logged_in => sub { ... }, } );
Protocol::OTR::Contact represents the OTR contact.
my $account = $contact->account();
Returns contact's Protocol::OTR::Account object.
my $name = $contact->name();
Returns contact's name.
my @fingerprints = $contact->fingerprints();
Returns a list of fingerprint objects Protocol::OTR::Fingerprint for given contact.
my $active_fingerprint = $contact->active_fingerprint();
Returns currently used fingerprint objects Protocol::OTR::Fingerprint for that contact.
my $channel = $contact->channel( { policy => ..., max_message_size => ..., on_write => sub { ... }, on_read => sub { ... }, on_gone_secure => sub { ... }, on_gone_insecure => sub { ... }, on_still_secure => sub { ... }, on_unverified_fingerprint => sub { ... }, on_symkey => sub { ... }, on_timer => sub { ... }, on_smp => sub { ... }, on_error => sub { ... }, on_event => sub { ... }, on_smp_event => sub { ... }, on_before_encrypt => sub { ... }, on_after_decrypt => sub { ... }, on_is_contact_logged_in => sub { ... }, } );
Create secure channel with that contact.
Please see Protocol::OTR::Channel for callbacks description.
Protocol::OTR
Protocol::OTR::Account
Protocol::OTR::Contact
Protocol::OTR::Fingerprint
Protocol::OTR::Channel
Alex J. G. Burzyński <ajgb@cpan.org>
This software is copyright (c) 2014 by Alex J. G. Burzyński <ajgb@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Protocol::OTR, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Protocol::OTR
CPAN shell
perl -MCPAN -e shell install Protocol::OTR
For more information on module installation, please visit the detailed CPAN module installation guide.