| 1 | #!/usr/bin/env perl | ||
| 2 | |||
| 3 | use Net::OneTimeSecret; | ||
| 4 | |||
| 5 | # Note: replace these with yours in order for this to work! | ||
| 6 | my $customerId = 'chris@onetimesecret.com'; | ||
| 7 | my $testApiKey = '4dc74a03fwr9aya5qur5wa8vavo4gih1hasj6181'; | ||
| 8 | |||
| 9 | my $api = Net::OneTimeSecret->new( $customerId, $testApiKey ); | ||
| 10 | my $result = $api->shareSecret( 'Jazz, jazz and more jazz.', | ||
| 11 | passphrase => 'thepassword', | ||
| 12 | recipient => 'kyle@shoffle.com', | ||
| 13 | ttl => 7200, | ||
| 14 | ); | ||
| 15 | printf( "%s\n", $result->{secret_key} ); | ||
| 16 | |||
| 17 | my $secret = $api->retrieveSecret( $result->{secret_key}, passphrase => "thepassword" ); | ||
| 18 | printf( "%s\n", $secret->{value} ); |