Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

214
Vistas
Desempaquetar una clave RSA con clave AES WebCrypto

Estoy tratando de desenvolver una clave RSA-OAEP que acabo de encapsular con una clave AES-GCM. El paso de envoltura parece funcionar. Pero cuando traté de desenvolver la clave, esta excepción arroja: DOMException: Data provided to an operation does not meet requirements que no ayudan... Ejecuté el código en Firefox (78.15.0esr)

 var iv = window.crypto.getRandomValues(new Uint8Array(12)); //create an initialization vector var AESkey= await window.crypto.subtle.generateKey( //create an AES key => the wrapping key { name: "AES-GCM", length: 256 }, true, ["wrapKey","unwrapKey"] ); var keyPair= await window.crypto.subtle.generateKey(//create an RSA keypair { name: "RSA-OAEP", modulusLength: 4096, publicExponent: new Uint8Array([1, 0, 1]), hash: "SHA-256" }, true, ["encrypt", "decrypt"] ); var privateRSAKey=keyPair.privateKey;//=> this key will be wrapped //the function below works var wrappedRSAKey= await window.crypto.subtle.wrapKey(// we wrap the RSA key with the AES "jwk", privateRSAKey, AESkey, {name: "AES-GCM",iv: iv} ); // The function below doesn't work X( //exeception DataError: Data provided to an operation does not meet requirements var unwrapped = await window.crypto.subtle.unwrapKey( "jwk", // it's the right format wrappedRSAKey, // wrappedRSAKey is a ArrayBuffer AESkey, // the encryption key {name: "AES-GCM",iv: iv}, // algorithm params for key encryption key { // algorithm params for key to unwrap name: "RSA-OAEP", hash: "SHA-256" }, true, // extractability of key to unwrap ["encrypt", "decrypt"] // key usages for key to unwrap );

¡Cualquier ayuda para decirme qué está mal en unwrapKey sería apreciada!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda