NAME
GPLVote::SignDoc::Client - module for helping create GPLVote SignDoc client software.
SYNOPSIS
use GPLVote::SignDoc::Client;
if (user_sign_is_valid($public_key, $sign, $data)) {
print "Sign of document is CORRECT\n";
} else {
print "BAD SIGN!!!\n";
};
my $pub_key_id = calc_pub_key_id($public_key);
my $enc_data = encrypt($public_key, $data);
Methods
user_sign_is_valid(base64_plain public_key, base64_plain sign, raw data, boolean sha256sign)
Check signature of data.
public_key - RSA public key for check signature. Encoded in Base64 in one string without special begin/finish strings and without line breaks.
sign - RSA signature. Some format like public_key.
data - signing data for verify signature.
sha256sign - boolean flag for check signature as "SHA256withRSA", else checking as "SHA1withRSA".
Returning true if signature is valid.
split_base64(base_64 string)
Helping method for separate one long line Base64 on different lines with length 72 chars.
calc_pub_key_id(base64_plain public_key)
Calculate ID of public key.
encrypt(base64_plain public_key, raw data)
Encrypt data over public key.
Returning plain Base64 string with encrypted data.
BUGS
No known bugs, but this does not mean no bugs exist.
SEE ALSO
http://gplvote.org/
MAINTAINER
Andrey Velikoredchanin <andy@andyhost.ru>
AUTHOR
Andrey Velikoredchanin
COPYRIGHT
GPLVote::SignDoc::Client - module for helping create GPLVote SignDoc client software Copyright (c) 2014, Andrey Velikoredchanin.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
BECAUSE THIS LIBRARY IS LICENSED FREE OF CHARGE, THIS LIBRARY IS BEING PROVIDED "AS IS WITH ALL FAULTS," WITHOUT ANY WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF TITLE, NONINFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, AND THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH THE YOU. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA