@@ -135,21 +135,23 @@ Used in encryption. Optional. Default method: aes256-cbc
135135
136136Specify the encryption method to be used for key transport. Supported methods are:
137137
138- Used in encryption. Optional. Default method: rsa-1_5
138+ Used in encryption. Optional. Default method: rsa-oaep-mgf1p
139139
140140=over
141141
142142=item * L<rsa-1_5|https://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#rsa-1_5>
143143
144144=item * L<rsa-oaep-mgf1p|https://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#rsa-oaep-mgf1p>
145145
146- =item * L<rsa-oaep (Experimental)| http://www.w3.org/2009/xmlenc11#rsa-oaep>
146+ =item * L<rsa-oaep| http://www.w3.org/2009/xmlenc11#rsa-oaep>
147147
148148=back
149149
150- =item B<oaep_method >
150+ =item B<oaep_mgf_alg >
151151
152- Specify the Algorithm to be used for rsa-oaep. Supported methods are:
152+ Specify the Algorithm to be used for rsa-oaep. Supported algorithms are:
153+
154+ Used in encryption. Optional. Default method: mgf1sha1
153155
154156=over
155157
@@ -194,8 +196,8 @@ sub new {
194196 my $key_method = exists ($params -> {' key_transport' }) ? $params -> {' key_transport' } : ' rsa-oaep-mgf1p ' ;
195197 $self -> {' key_transport' } = $self -> _setKeyEncryptionMethod($key_method );
196198
197- my $oaep_method = exists ($params -> {' oaep_method ' }) ? $params -> {' oaep_method ' } : ' http://www.w3.org/2009/xmlenc11#mgf1sha1' ;
198- $self -> {' oaep_method ' } = $self -> _setOAEPAlgorithm($oaep_method );
199+ my $oaep_mgf_alg = exists ($params -> {' oaep_mgf_alg ' }) ? $params -> {' oaep_mgf_alg ' } : ' http://www.w3.org/2009/xmlenc11#mgf1sha1' ;
200+ $self -> {' oaep_mgf_alg ' } = $self -> _setOAEPAlgorithm($oaep_mgf_alg );
199201
200202 $self -> {' oaep_params' } = exists ($params -> {' oaep_params' }) ? $params -> {' oaep_params' } : ' ' ;
201203
@@ -558,7 +560,7 @@ sub _EncryptKey {
558560 ${$key} = $rsa_pub -> encrypt(${$key} , ' oaep' , ' SHA1' , $self -> {oaep_params });
559561 }
560562 elsif ($keymethod eq ' http://www.w3.org/2009/xmlenc11#rsa-oaep' ) {
561- ${$key} = $rsa_pub -> encrypt(${$key} , ' oaep' , $self -> _getOAEPAlgorithm($self -> {oaep_method }), $self -> {oaep_params });
563+ ${$key} = $rsa_pub -> encrypt(${$key} , ' oaep' , $self -> _getOAEPAlgorithm($self -> {oaep_mgf_alg }), $self -> {oaep_params });
562564 } else {
563565 die " Unsupported Key Encryption Method" ;
564566 }
@@ -919,7 +921,7 @@ sub _create_encrypted_data_xml {
919921 $kencmethod ,
920922 ' xenc:MGF' ,
921923 {
922- Algorithm => $self -> {oaep_method },
924+ Algorithm => $self -> {oaep_mgf_alg },
923925 }
924926 );
925927 };
0 commit comments