CHEF::Encoder
1.0
use CHEF::Encoder; my $obj = new CHEF::Encoder ( 'data' => $data , 'private_key_file' => ../data/private_key.pem ); $obj->pki->sign ( 'data' => $data ); $obj->sha1->digest ( 'data' => $data ); $obj->base64->encode( 'data' => $data ); $obj->base64->decode( 'data' => $data );
This module imiplements methods that perform the encoding and decoding and signing of the header once you load this module it will inturn load three classes
CHEF::Encode::pki
CHEF::Encode::sha1
CHEF::Encode::base64
return new object initialzied as per %params.
returns $private_key_file
returns $private_key
returns $data
loads CHEF::Encoder::pki class and returns new object of class CHEF::Encoder::pki it accepts ( 'private_key_file' => $private_key_file , 'private_key' => $private_key ) if none is provided it will try to use the values initialized from parent class CHEF::Encoder
CHEF::Encoder::pki
This class provides siging request as per private key specified.
returns signed data based on the private_key_file or privete_key
loads CHEF::Encoder::sha1 class and returns new object of class CHEF::Encoder::sha1 it accepts ( 'data' => $data ) if none is provided it will try to use the values initialized from parent class CHEF::Encoder
CHEF::Encoder::sha1
This class provides sha1 digest of the data initialized
it accepts data as parameter $obj->digest( 'data' => $data ) returns sha1 digest in binary encoded with base64 of the data passed.
loads CHEF::Encoder::base64 class and returns new object of class CHEF::Encoder::base64 it accepts ( 'data' => $data ) if none is provided it will try to use the values initialized from parent class CHEF::Encoder
CHEF::Encoder::base64
This class provides base64 encoding and ecoding functionality
it accepts data as parameter $obj->encode( 'data' => $data ) returns base64 encoded value of data
it accepts data as parameter $obj->decode( 'data' => $data ) returns base64 decoded value of data
open a github ticket or email comments to Bhavin Patel <bpatel10@nyit.edu>
This Software is free to use , licensed under : The Artisic License 2.0 (GPL Compatible)
To install CHEF::REST::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CHEF::REST::Client
CPAN shell
perl -MCPAN -e shell install CHEF::REST::Client
For more information on module installation, please visit the detailed CPAN module installation guide.