File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -674,20 +674,23 @@ async function unwrapKey({
674674 const url = `${ keySplitInfo . url } /v2/rewrap` ;
675675 let ephemeralEncryptionKeysRaw : AnyKeyPair ;
676676 let ephemeralEncryptionKeys : PemKeyPair ;
677+ let algorithm : string ;
677678 if ( wrappingKeyAlgorithm === 'ec:secp256r1' ) {
678679 ephemeralEncryptionKeysRaw = await generateKeyPair ( ) ;
679680 ephemeralEncryptionKeys = await cryptoService . cryptoToPemPair ( ephemeralEncryptionKeysRaw ) ;
681+ algorithm = 'ES256' ;
680682 } else if ( wrappingKeyAlgorithm === 'rsa:2048' || ! wrappingKeyAlgorithm ) {
681683 ephemeralEncryptionKeysRaw = await cryptoService . generateKeyPair ( ) ;
682684 ephemeralEncryptionKeys = await cryptoService . cryptoToPemPair ( ephemeralEncryptionKeysRaw ) ;
685+ algorithm = 'RS256' ;
683686 } else {
684687 throw new ConfigurationError ( `Unsupported wrapping key algorithm [${ wrappingKeyAlgorithm } ]` ) ;
685688 }
686689
687690 const clientPublicKey = ephemeralEncryptionKeys . publicKey ;
688691
689692 const requestBodyStr = JSON . stringify ( {
690- algorithm : 'RS256' ,
693+ algorithm,
691694 keyAccess : keySplitInfo ,
692695 policy : manifest . encryptionInformation . policy ,
693696 clientPublicKey,
You can’t perform that action at this time.
0 commit comments