Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
OpenXPKI::Crypto::SecrUserPContributed Perl OpenXPKI::Crypto::Secret::Plain(3)

Name
       OpenXPKI::Crypto::Secret::Plain - Simple	PIN concatenation

Description
       Simple PIN container that supports "secret splitting" by	dividing the
       PIN in n	components that	are simply concatenated.

       Usage example: simple one-part pin (not very useful)

	 my $secret = OpenXPKI::Crypto::Secret->new();	 # 'Plain' pin,	one part

	 $secret->is_complete()		      #	returns	undef
	 my $result = $secret->get_secret();  #	undef

	 $secret->set_secret('foobar');

	 $secret->is_complete()		      #	returns	true
	 $result = $secret->get_secret();     #	'foobar'

       Usage example: simple multi-part	pin

	 my $secret = OpenXPKI::Crypto::Secret->new(
	     {
		 TYPE => 'Plain',
		 PARTS => 3,
	     });   # 'Plain' pin, three	part

	 my $result = $secret->get_secret();  #	undef

	 $secret->set_secret(
	     {
		 PART => 1,
		 SECRET	=> 'foo',
	     });
	 $secret->set_secret(
	     {
		 PART => 3,
		 SECRET	=> 'baz',
	     });

	 $secret->is_complete();	   # returns undef
	 $result = $secret->get_secret();  # still undef

	 $secret->set_secret(
	     {
		 PART => 2,
		 SECRET	=> 'bar',
	     });

	 $secret->is_complete();	      #	returns	true
	 $result = $secret->get_secret();     #	'foobarbaz'

   Methods
       new

       Constructor. If a hash reference	is given the following named
       parameters are accepted:

       o   TYPE

	   Must	be 'Plain'

       o   PARTS

	   Integer, defaults to	1. Specifies the total number of secret	parts.

       is_complete

       Returns true once all secret componentents are available.

       get_secret

       Returns the complete secret or undef if not yet available.

       set_secret

       Sets (part of) the secret.

perl v5.24.1			  2017-07-03OpenXPKI::Crypto::Secret::Plain(3)

Name | Description

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=OpenXPKI::Crypto::Secret::Plain&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help