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

FreeBSD Manual Pages


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

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

       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->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

		 PART => 1,
		 SECRET	=> 'foo',
		 PART => 3,
		 SECRET	=> 'baz',

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

		 PART => 2,
		 SECRET	=> 'bar',

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


       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.


       Returns true once all secret componentents are available.


       Returns the complete secret or undef if not yet available.


       Sets (part of) the secret.

perl v5.32.0			  2020-08-29OpenXPKI::Crypto::Secret::Plain(3)

Name | Description

Want to link to this manual page? Use this URL:

home | help