function importEcdsaPublicKeyPem(pemText) {

  const derPublicKey = getDerPublicKeyFromPem(pemText);

  return window.crypto.subtle.importKey(
    "spki",  // SubjectPublicKeyInfo format
    derPublicKey,
    { // EcKeyImportParams algorithm
      name: "ECDSA",
      namedCurve: "P-256",
    },
    true,  // Extractable key
    ["verify"],
  );
}
// Key is imported for signature verification only.
Key is imported for signature verification only.
Key is imported for signature verification only .
function importEcdsaPublicKeyPem(pemText) {
  const derPublicKey = getDerPublicKeyFromPem(pemText);
  return window.crypto.subtle.importKey(
    "spki",  
    derPublicKey,
    { 
      name: "ECDSA",
      namedCurve: "P-256",
    },
    true,  
    ["verify"],
  );
}
function importEcdsaPublicKeyPem ( pemText ) { const derPublicKey = getDerPublicKeyFromPem ( pemText ) ; return window . crypto . subtle . importKey ( "spki" , derPublicKey , { name : "ECDSA" , namedCurve : "P-256" , } , true , [ "verify" ] , ) ; }
Key is imported for signature verification only.
Key is imported for signature verification only .
// SubjectPublicKeyInfo format // EcKeyImportParams algorithm // Extractable key