PEM PKCS#8 private key or public key string
signature algorithm (SHA{1,224,256,384,512}with{RSA,RSAandMGF1,ECDSA})
Optional
sigopt: string | numbersaltLength for RSA-PSS
CryptoKey object of W3C Web Crypto API
https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey
This function import a CryptoKey object from PEM key file.
NOTE: For EC key, namedCurve value will be automatically
detected by PEM file. So no need to specify.
key = await importPEM("-----BEGIN PRIVATE...", "SHA256withRSA");
key = await importPEM("-----BEGIN PUBLIC...", "SHA256withECDSA");
key = await importPEM("-----BEGIN PRIVATE...", "SHA256withRSAandMGF1");
import key from PEM private/public key string