The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Protocol::OTR::Fingerprint - Off-the-Record contact's Fingerprint

VERSION

version 0.05

SYNOPSIS

    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
    for my $fingerprint ( $bob->fingerprints() ) {
        print "Fingerprint:\n";
        print " * hash: ",        $fingerprint->hash,        "\n";
        print " * status: ",      $fingerprint->status,      "\n";
        print " * is_verified: ", $fingerprint->is_verified, "\n";
    }

DESCRIPTION

Protocol::OTR::Fingerprint represents the fingerprint for OTR contact.

METHODS

contact

    my $contact = $fingerprint->contact();

Returns fingerprint's Protocol::OTR::Contact object.

hash

    my $hash = $fingerprint->hash();

Returns fingerprint's hash in human readable format 12345678 90ABCDEF 12345678 90ABCDEF 12345678.

status

    my $status = $fingerprint->status;

Returns current status of fingerprint used in communication, which is one of:

  • Unused

  • Not private

  • Unverified

  • Private

  • Finished

is_verified

    my $is_verified = $fingerprint->is_verified;

Returns true if current fingerprint is verified, false otherwise.

set_verified

    $fingerprint->set_verified( $true_or_false );

Sets fingerprint as verified or not.

SEE ALSO

AUTHOR

Alex J. G. Burzyński <ajgb@cpan.org>

COPYRIGHT AND LICENSE

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.