@simplewebauthn/server 11.0.0 → 13.0.0-alpha1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (372) hide show
  1. package/README.md +11 -12
  2. package/esm/authentication/generateAuthenticationOptions.d.ts +14 -13
  3. package/esm/authentication/generateAuthenticationOptions.d.ts.map +1 -0
  4. package/esm/authentication/verifyAuthenticationResponse.d.ts +19 -15
  5. package/esm/authentication/verifyAuthenticationResponse.d.ts.map +1 -0
  6. package/esm/helpers/convertAAGUIDToString.d.ts +1 -0
  7. package/esm/helpers/convertAAGUIDToString.d.ts.map +1 -0
  8. package/esm/helpers/convertAAGUIDToString.js +4 -4
  9. package/esm/helpers/convertCOSEtoPKCS.d.ts +1 -0
  10. package/esm/helpers/convertCOSEtoPKCS.d.ts.map +1 -0
  11. package/esm/helpers/convertCertBufferToPEM.d.ts +2 -1
  12. package/esm/helpers/convertCertBufferToPEM.d.ts.map +1 -0
  13. package/esm/helpers/convertPEMToBytes.d.ts +1 -0
  14. package/esm/helpers/convertPEMToBytes.d.ts.map +1 -0
  15. package/esm/helpers/convertX509PublicKeyToCOSE.d.ts +1 -0
  16. package/esm/helpers/convertX509PublicKeyToCOSE.d.ts.map +1 -0
  17. package/esm/helpers/convertX509PublicKeyToCOSE.js +4 -1
  18. package/esm/helpers/cose.d.ts +23 -0
  19. package/esm/helpers/cose.d.ts.map +1 -0
  20. package/esm/helpers/cose.js +20 -0
  21. package/esm/helpers/decodeAttestationObject.d.ts +5 -0
  22. package/esm/helpers/decodeAttestationObject.d.ts.map +1 -0
  23. package/esm/helpers/decodeAttestationObject.js +4 -1
  24. package/esm/helpers/decodeAuthenticatorExtensions.d.ts +1 -0
  25. package/esm/helpers/decodeAuthenticatorExtensions.d.ts.map +1 -0
  26. package/esm/helpers/decodeClientDataJSON.d.ts +6 -1
  27. package/esm/helpers/decodeClientDataJSON.d.ts.map +1 -0
  28. package/esm/helpers/decodeClientDataJSON.js +4 -1
  29. package/esm/helpers/decodeCredentialPublicKey.d.ts +5 -0
  30. package/esm/helpers/decodeCredentialPublicKey.d.ts.map +1 -0
  31. package/esm/helpers/decodeCredentialPublicKey.js +4 -1
  32. package/esm/helpers/fetch.d.ts +5 -0
  33. package/esm/helpers/fetch.d.ts.map +1 -0
  34. package/esm/helpers/fetch.js +5 -2
  35. package/esm/helpers/generateChallenge.d.ts +5 -0
  36. package/esm/helpers/generateChallenge.d.ts.map +1 -0
  37. package/esm/helpers/generateChallenge.js +4 -1
  38. package/esm/helpers/generateUserID.d.ts +5 -0
  39. package/esm/helpers/generateUserID.d.ts.map +1 -0
  40. package/esm/helpers/generateUserID.js +4 -1
  41. package/esm/helpers/getCertificateInfo.d.ts +2 -1
  42. package/esm/helpers/getCertificateInfo.d.ts.map +1 -0
  43. package/esm/helpers/getCertificateInfo.js +2 -1
  44. package/esm/helpers/index.d.ts +17 -23
  45. package/esm/helpers/index.d.ts.map +1 -0
  46. package/esm/helpers/index.js +16 -17
  47. package/esm/helpers/isCertRevoked.d.ts +2 -1
  48. package/esm/helpers/isCertRevoked.d.ts.map +1 -0
  49. package/esm/helpers/isCertRevoked.js +2 -1
  50. package/esm/helpers/iso/index.d.ts +1 -0
  51. package/esm/helpers/iso/index.d.ts.map +1 -0
  52. package/esm/helpers/iso/isoBase64URL.d.ts +2 -1
  53. package/esm/helpers/iso/isoBase64URL.d.ts.map +1 -0
  54. package/esm/helpers/iso/isoBase64URL.js +5 -1
  55. package/esm/helpers/iso/isoCBOR.d.ts +6 -1
  56. package/esm/helpers/iso/isoCBOR.d.ts.map +1 -0
  57. package/esm/helpers/iso/isoCBOR.js +5 -1
  58. package/esm/helpers/iso/isoCrypto/digest.d.ts +1 -0
  59. package/esm/helpers/iso/isoCrypto/digest.d.ts.map +1 -0
  60. package/esm/helpers/iso/isoCrypto/getRandomValues.d.ts +1 -0
  61. package/esm/helpers/iso/isoCrypto/getRandomValues.d.ts.map +1 -0
  62. package/esm/helpers/iso/isoCrypto/getWebCrypto.d.ts +2 -1
  63. package/esm/helpers/iso/isoCrypto/getWebCrypto.d.ts.map +1 -0
  64. package/esm/helpers/iso/isoCrypto/importKey.d.ts +1 -0
  65. package/esm/helpers/iso/isoCrypto/importKey.d.ts.map +1 -0
  66. package/esm/helpers/iso/isoCrypto/index.d.ts +5 -0
  67. package/esm/helpers/iso/isoCrypto/index.d.ts.map +1 -0
  68. package/esm/helpers/iso/isoCrypto/index.js +4 -0
  69. package/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts +1 -0
  70. package/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts.map +1 -0
  71. package/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts +1 -0
  72. package/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts.map +1 -0
  73. package/esm/helpers/iso/isoCrypto/structs.d.ts +1 -0
  74. package/esm/helpers/iso/isoCrypto/structs.d.ts.map +1 -0
  75. package/esm/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts +1 -0
  76. package/esm/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts.map +1 -0
  77. package/esm/helpers/iso/isoCrypto/unwrapEC2Signature.js +2 -1
  78. package/esm/helpers/iso/isoCrypto/verify.d.ts +1 -0
  79. package/esm/helpers/iso/isoCrypto/verify.d.ts.map +1 -0
  80. package/esm/helpers/iso/isoCrypto/verifyEC2.d.ts +1 -0
  81. package/esm/helpers/iso/isoCrypto/verifyEC2.d.ts.map +1 -0
  82. package/esm/helpers/iso/isoCrypto/verifyOKP.d.ts +1 -0
  83. package/esm/helpers/iso/isoCrypto/verifyOKP.d.ts.map +1 -0
  84. package/esm/helpers/iso/isoCrypto/verifyRSA.d.ts +1 -0
  85. package/esm/helpers/iso/isoCrypto/verifyRSA.d.ts.map +1 -0
  86. package/esm/helpers/iso/isoUint8Array.d.ts +5 -0
  87. package/esm/helpers/iso/isoUint8Array.d.ts.map +1 -0
  88. package/esm/helpers/iso/isoUint8Array.js +4 -0
  89. package/esm/helpers/logging.d.ts +1 -0
  90. package/esm/helpers/logging.d.ts.map +1 -0
  91. package/esm/helpers/logging.js +0 -1
  92. package/esm/helpers/mapX509SignatureAlgToCOSEAlg.d.ts +1 -0
  93. package/esm/helpers/mapX509SignatureAlgToCOSEAlg.d.ts.map +1 -0
  94. package/esm/helpers/matchExpectedRPID.d.ts +1 -0
  95. package/esm/helpers/matchExpectedRPID.d.ts.map +1 -0
  96. package/esm/helpers/parseAuthenticatorData.d.ts +5 -0
  97. package/esm/helpers/parseAuthenticatorData.d.ts.map +1 -0
  98. package/esm/helpers/parseAuthenticatorData.js +10 -7
  99. package/esm/helpers/parseBackupFlags.d.ts +2 -1
  100. package/esm/helpers/parseBackupFlags.d.ts.map +1 -0
  101. package/esm/helpers/toHash.d.ts +1 -0
  102. package/esm/helpers/toHash.d.ts.map +1 -0
  103. package/esm/helpers/validateCertificatePath.d.ts +4 -3
  104. package/esm/helpers/validateCertificatePath.d.ts.map +1 -0
  105. package/esm/helpers/validateCertificatePath.js +82 -59
  106. package/esm/helpers/validateExtFIDOGenCEAAGUID.d.ts +2 -1
  107. package/esm/helpers/validateExtFIDOGenCEAAGUID.d.ts.map +1 -0
  108. package/esm/helpers/validateExtFIDOGenCEAAGUID.js +1 -1
  109. package/esm/helpers/verifySignature.d.ts +5 -0
  110. package/esm/helpers/verifySignature.d.ts.map +1 -0
  111. package/esm/helpers/verifySignature.js +4 -1
  112. package/esm/index.d.ts +9 -17
  113. package/esm/index.d.ts.map +1 -0
  114. package/esm/index.js +8 -11
  115. package/esm/metadata/mdsTypes.d.ts +6 -1
  116. package/esm/metadata/mdsTypes.d.ts.map +1 -0
  117. package/esm/metadata/parseJWT.d.ts +1 -0
  118. package/esm/metadata/parseJWT.d.ts.map +1 -0
  119. package/esm/metadata/verifyAttestationWithMetadata.d.ts +3 -2
  120. package/esm/metadata/verifyAttestationWithMetadata.d.ts.map +1 -0
  121. package/esm/metadata/verifyAttestationWithMetadata.js +1 -1
  122. package/esm/metadata/verifyJWT.d.ts +1 -0
  123. package/esm/metadata/verifyJWT.d.ts.map +1 -0
  124. package/esm/registration/generateRegistrationOptions.d.ts +22 -19
  125. package/esm/registration/generateRegistrationOptions.d.ts.map +1 -0
  126. package/esm/registration/generateRegistrationOptions.js +22 -1
  127. package/esm/registration/verifications/tpm/constants.d.ts +1 -0
  128. package/esm/registration/verifications/tpm/constants.d.ts.map +1 -0
  129. package/esm/registration/verifications/tpm/constants.js +4 -4
  130. package/esm/registration/verifications/tpm/parseCertInfo.d.ts +1 -0
  131. package/esm/registration/verifications/tpm/parseCertInfo.d.ts.map +1 -0
  132. package/esm/registration/verifications/tpm/parsePubArea.d.ts +1 -0
  133. package/esm/registration/verifications/tpm/parsePubArea.d.ts.map +1 -0
  134. package/esm/registration/verifications/tpm/verifyAttestationTPM.d.ts +1 -0
  135. package/esm/registration/verifications/tpm/verifyAttestationTPM.d.ts.map +1 -0
  136. package/esm/registration/verifications/tpm/verifyAttestationTPM.js +2 -1
  137. package/esm/registration/verifications/verifyAttestationAndroidKey.d.ts +1 -0
  138. package/esm/registration/verifications/verifyAttestationAndroidKey.d.ts.map +1 -0
  139. package/esm/registration/verifications/verifyAttestationAndroidKey.js +3 -1
  140. package/esm/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts +1 -0
  141. package/esm/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts.map +1 -0
  142. package/esm/registration/verifications/verifyAttestationApple.d.ts +1 -0
  143. package/esm/registration/verifications/verifyAttestationApple.d.ts.map +1 -0
  144. package/esm/registration/verifications/verifyAttestationApple.js +2 -1
  145. package/esm/registration/verifications/verifyAttestationFIDOU2F.d.ts +1 -0
  146. package/esm/registration/verifications/verifyAttestationFIDOU2F.d.ts.map +1 -0
  147. package/esm/registration/verifications/verifyAttestationPacked.d.ts +1 -0
  148. package/esm/registration/verifications/verifyAttestationPacked.d.ts.map +1 -0
  149. package/esm/registration/verifyRegistrationResponse.d.ts +18 -14
  150. package/esm/registration/verifyRegistrationResponse.d.ts.map +1 -0
  151. package/esm/services/defaultRootCerts/android-key.d.ts +1 -0
  152. package/esm/services/defaultRootCerts/android-key.d.ts.map +1 -0
  153. package/esm/services/defaultRootCerts/android-safetynet.d.ts +1 -0
  154. package/esm/services/defaultRootCerts/android-safetynet.d.ts.map +1 -0
  155. package/esm/services/defaultRootCerts/apple.d.ts +1 -0
  156. package/esm/services/defaultRootCerts/apple.d.ts.map +1 -0
  157. package/esm/services/defaultRootCerts/mds.d.ts +1 -0
  158. package/esm/services/defaultRootCerts/mds.d.ts.map +1 -0
  159. package/esm/services/metadataService.d.ts +30 -11
  160. package/esm/services/metadataService.d.ts.map +1 -0
  161. package/esm/services/metadataService.js +8 -22
  162. package/esm/services/settingsService.d.ts +18 -5
  163. package/esm/services/settingsService.d.ts.map +1 -0
  164. package/esm/services/settingsService.js +14 -10
  165. package/esm/types/dom.d.ts +329 -0
  166. package/esm/types/dom.d.ts.map +1 -0
  167. package/esm/types/dom.js +1 -0
  168. package/esm/types/index.d.ts +205 -0
  169. package/esm/types/index.d.ts.map +1 -0
  170. package/esm/types/index.js +1 -0
  171. package/package.json +27 -32
  172. package/script/authentication/generateAuthenticationOptions.d.ts +14 -13
  173. package/script/authentication/generateAuthenticationOptions.d.ts.map +1 -0
  174. package/script/authentication/generateAuthenticationOptions.js +1 -2
  175. package/script/authentication/verifyAuthenticationResponse.d.ts +19 -15
  176. package/script/authentication/verifyAuthenticationResponse.d.ts.map +1 -0
  177. package/script/authentication/verifyAuthenticationResponse.js +1 -2
  178. package/script/helpers/convertAAGUIDToString.d.ts +1 -0
  179. package/script/helpers/convertAAGUIDToString.d.ts.map +1 -0
  180. package/script/helpers/convertAAGUIDToString.js +5 -6
  181. package/script/helpers/convertCOSEtoPKCS.d.ts +1 -0
  182. package/script/helpers/convertCOSEtoPKCS.d.ts.map +1 -0
  183. package/script/helpers/convertCOSEtoPKCS.js +1 -2
  184. package/script/helpers/convertCertBufferToPEM.d.ts +2 -1
  185. package/script/helpers/convertCertBufferToPEM.d.ts.map +1 -0
  186. package/script/helpers/convertCertBufferToPEM.js +1 -2
  187. package/script/helpers/convertPEMToBytes.d.ts +1 -0
  188. package/script/helpers/convertPEMToBytes.d.ts.map +1 -0
  189. package/script/helpers/convertPEMToBytes.js +1 -2
  190. package/script/helpers/convertX509PublicKeyToCOSE.d.ts +1 -0
  191. package/script/helpers/convertX509PublicKeyToCOSE.d.ts.map +1 -0
  192. package/script/helpers/convertX509PublicKeyToCOSE.js +11 -9
  193. package/script/helpers/cose.d.ts +23 -0
  194. package/script/helpers/cose.d.ts.map +1 -0
  195. package/script/helpers/cose.js +31 -11
  196. package/script/helpers/decodeAttestationObject.d.ts +5 -0
  197. package/script/helpers/decodeAttestationObject.d.ts.map +1 -0
  198. package/script/helpers/decodeAttestationObject.js +6 -3
  199. package/script/helpers/decodeAuthenticatorExtensions.d.ts +1 -0
  200. package/script/helpers/decodeAuthenticatorExtensions.d.ts.map +1 -0
  201. package/script/helpers/decodeAuthenticatorExtensions.js +1 -2
  202. package/script/helpers/decodeClientDataJSON.d.ts +6 -1
  203. package/script/helpers/decodeClientDataJSON.d.ts.map +1 -0
  204. package/script/helpers/decodeClientDataJSON.js +6 -3
  205. package/script/helpers/decodeCredentialPublicKey.d.ts +5 -0
  206. package/script/helpers/decodeCredentialPublicKey.d.ts.map +1 -0
  207. package/script/helpers/decodeCredentialPublicKey.js +6 -3
  208. package/script/helpers/fetch.d.ts +5 -0
  209. package/script/helpers/fetch.d.ts.map +1 -0
  210. package/script/helpers/fetch.js +8 -5
  211. package/script/helpers/generateChallenge.d.ts +5 -0
  212. package/script/helpers/generateChallenge.d.ts.map +1 -0
  213. package/script/helpers/generateChallenge.js +6 -3
  214. package/script/helpers/generateUserID.d.ts +5 -0
  215. package/script/helpers/generateUserID.d.ts.map +1 -0
  216. package/script/helpers/generateUserID.js +6 -3
  217. package/script/helpers/getCertificateInfo.d.ts +2 -1
  218. package/script/helpers/getCertificateInfo.d.ts.map +1 -0
  219. package/script/helpers/getCertificateInfo.js +6 -6
  220. package/script/helpers/index.d.ts +17 -23
  221. package/script/helpers/index.d.ts.map +1 -0
  222. package/script/helpers/index.js +20 -36
  223. package/script/helpers/isCertRevoked.d.ts +2 -1
  224. package/script/helpers/isCertRevoked.d.ts.map +1 -0
  225. package/script/helpers/isCertRevoked.js +10 -10
  226. package/script/helpers/iso/index.d.ts +1 -0
  227. package/script/helpers/iso/index.d.ts.map +1 -0
  228. package/script/helpers/iso/isoBase64URL.d.ts +2 -1
  229. package/script/helpers/iso/isoBase64URL.d.ts.map +1 -0
  230. package/script/helpers/iso/isoBase64URL.js +24 -18
  231. package/script/helpers/iso/isoCBOR.d.ts +6 -1
  232. package/script/helpers/iso/isoCBOR.d.ts.map +1 -0
  233. package/script/helpers/iso/isoCBOR.js +32 -6
  234. package/script/helpers/iso/isoCrypto/digest.d.ts +1 -0
  235. package/script/helpers/iso/isoCrypto/digest.d.ts.map +1 -0
  236. package/script/helpers/iso/isoCrypto/digest.js +1 -2
  237. package/script/helpers/iso/isoCrypto/getRandomValues.d.ts +1 -0
  238. package/script/helpers/iso/isoCrypto/getRandomValues.d.ts.map +1 -0
  239. package/script/helpers/iso/isoCrypto/getRandomValues.js +1 -2
  240. package/script/helpers/iso/isoCrypto/getWebCrypto.d.ts +2 -1
  241. package/script/helpers/iso/isoCrypto/getWebCrypto.d.ts.map +1 -0
  242. package/script/helpers/iso/isoCrypto/getWebCrypto.js +2 -2
  243. package/script/helpers/iso/isoCrypto/importKey.d.ts +1 -0
  244. package/script/helpers/iso/isoCrypto/importKey.d.ts.map +1 -0
  245. package/script/helpers/iso/isoCrypto/importKey.js +1 -2
  246. package/script/helpers/iso/isoCrypto/index.d.ts +5 -0
  247. package/script/helpers/iso/isoCrypto/index.d.ts.map +1 -0
  248. package/script/helpers/iso/isoCrypto/index.js +4 -0
  249. package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts +1 -0
  250. package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.d.ts.map +1 -0
  251. package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.js +1 -2
  252. package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts +1 -0
  253. package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.d.ts.map +1 -0
  254. package/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js +1 -2
  255. package/script/helpers/iso/isoCrypto/structs.d.ts +1 -0
  256. package/script/helpers/iso/isoCrypto/structs.d.ts.map +1 -0
  257. package/script/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts +1 -0
  258. package/script/helpers/iso/isoCrypto/unwrapEC2Signature.d.ts.map +1 -0
  259. package/script/helpers/iso/isoCrypto/unwrapEC2Signature.js +4 -4
  260. package/script/helpers/iso/isoCrypto/verify.d.ts +1 -0
  261. package/script/helpers/iso/isoCrypto/verify.d.ts.map +1 -0
  262. package/script/helpers/iso/isoCrypto/verify.js +1 -2
  263. package/script/helpers/iso/isoCrypto/verifyEC2.d.ts +1 -0
  264. package/script/helpers/iso/isoCrypto/verifyEC2.d.ts.map +1 -0
  265. package/script/helpers/iso/isoCrypto/verifyEC2.js +1 -2
  266. package/script/helpers/iso/isoCrypto/verifyOKP.d.ts +1 -0
  267. package/script/helpers/iso/isoCrypto/verifyOKP.d.ts.map +1 -0
  268. package/script/helpers/iso/isoCrypto/verifyOKP.js +1 -2
  269. package/script/helpers/iso/isoCrypto/verifyRSA.d.ts +1 -0
  270. package/script/helpers/iso/isoCrypto/verifyRSA.d.ts.map +1 -0
  271. package/script/helpers/iso/isoCrypto/verifyRSA.js +1 -2
  272. package/script/helpers/iso/isoUint8Array.d.ts +5 -0
  273. package/script/helpers/iso/isoUint8Array.d.ts.map +1 -0
  274. package/script/helpers/iso/isoUint8Array.js +12 -9
  275. package/script/helpers/logging.d.ts +1 -0
  276. package/script/helpers/logging.d.ts.map +1 -0
  277. package/script/helpers/logging.js +2 -4
  278. package/script/helpers/mapX509SignatureAlgToCOSEAlg.d.ts +1 -0
  279. package/script/helpers/mapX509SignatureAlgToCOSEAlg.d.ts.map +1 -0
  280. package/script/helpers/mapX509SignatureAlgToCOSEAlg.js +1 -2
  281. package/script/helpers/matchExpectedRPID.d.ts +1 -0
  282. package/script/helpers/matchExpectedRPID.d.ts.map +1 -0
  283. package/script/helpers/matchExpectedRPID.js +1 -2
  284. package/script/helpers/parseAuthenticatorData.d.ts +5 -0
  285. package/script/helpers/parseAuthenticatorData.d.ts.map +1 -0
  286. package/script/helpers/parseAuthenticatorData.js +12 -9
  287. package/script/helpers/parseBackupFlags.d.ts +2 -1
  288. package/script/helpers/parseBackupFlags.d.ts.map +1 -0
  289. package/script/helpers/parseBackupFlags.js +2 -2
  290. package/script/helpers/toHash.d.ts +1 -0
  291. package/script/helpers/toHash.d.ts.map +1 -0
  292. package/script/helpers/toHash.js +1 -2
  293. package/script/helpers/validateCertificatePath.d.ts +4 -3
  294. package/script/helpers/validateCertificatePath.d.ts.map +1 -0
  295. package/script/helpers/validateCertificatePath.js +83 -61
  296. package/script/helpers/validateExtFIDOGenCEAAGUID.d.ts +2 -1
  297. package/script/helpers/validateExtFIDOGenCEAAGUID.d.ts.map +1 -0
  298. package/script/helpers/validateExtFIDOGenCEAAGUID.js +3 -4
  299. package/script/helpers/verifySignature.d.ts +5 -0
  300. package/script/helpers/verifySignature.d.ts.map +1 -0
  301. package/script/helpers/verifySignature.js +6 -3
  302. package/script/index.d.ts +9 -17
  303. package/script/index.d.ts.map +1 -0
  304. package/script/index.js +22 -17
  305. package/script/metadata/mdsTypes.d.ts +6 -1
  306. package/script/metadata/mdsTypes.d.ts.map +1 -0
  307. package/script/metadata/parseJWT.d.ts +1 -0
  308. package/script/metadata/parseJWT.d.ts.map +1 -0
  309. package/script/metadata/parseJWT.js +1 -2
  310. package/script/metadata/verifyAttestationWithMetadata.d.ts +3 -2
  311. package/script/metadata/verifyAttestationWithMetadata.d.ts.map +1 -0
  312. package/script/metadata/verifyAttestationWithMetadata.js +2 -2
  313. package/script/metadata/verifyJWT.d.ts +1 -0
  314. package/script/metadata/verifyJWT.d.ts.map +1 -0
  315. package/script/metadata/verifyJWT.js +1 -2
  316. package/script/registration/generateRegistrationOptions.d.ts +22 -19
  317. package/script/registration/generateRegistrationOptions.d.ts.map +1 -0
  318. package/script/registration/generateRegistrationOptions.js +24 -3
  319. package/script/registration/verifications/tpm/constants.d.ts +1 -0
  320. package/script/registration/verifications/tpm/constants.d.ts.map +1 -0
  321. package/script/registration/verifications/tpm/constants.js +4 -4
  322. package/script/registration/verifications/tpm/parseCertInfo.d.ts +1 -0
  323. package/script/registration/verifications/tpm/parseCertInfo.d.ts.map +1 -0
  324. package/script/registration/verifications/tpm/parseCertInfo.js +1 -2
  325. package/script/registration/verifications/tpm/parsePubArea.d.ts +1 -0
  326. package/script/registration/verifications/tpm/parsePubArea.d.ts.map +1 -0
  327. package/script/registration/verifications/tpm/parsePubArea.js +1 -2
  328. package/script/registration/verifications/tpm/verifyAttestationTPM.d.ts +1 -0
  329. package/script/registration/verifications/tpm/verifyAttestationTPM.d.ts.map +1 -0
  330. package/script/registration/verifications/tpm/verifyAttestationTPM.js +8 -8
  331. package/script/registration/verifications/verifyAttestationAndroidKey.d.ts +1 -0
  332. package/script/registration/verifications/verifyAttestationAndroidKey.d.ts.map +1 -0
  333. package/script/registration/verifications/verifyAttestationAndroidKey.js +7 -6
  334. package/script/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts +1 -0
  335. package/script/registration/verifications/verifyAttestationAndroidSafetyNet.d.ts.map +1 -0
  336. package/script/registration/verifications/verifyAttestationAndroidSafetyNet.js +1 -2
  337. package/script/registration/verifications/verifyAttestationApple.d.ts +1 -0
  338. package/script/registration/verifications/verifyAttestationApple.d.ts.map +1 -0
  339. package/script/registration/verifications/verifyAttestationApple.js +4 -4
  340. package/script/registration/verifications/verifyAttestationFIDOU2F.d.ts +1 -0
  341. package/script/registration/verifications/verifyAttestationFIDOU2F.d.ts.map +1 -0
  342. package/script/registration/verifications/verifyAttestationFIDOU2F.js +1 -2
  343. package/script/registration/verifications/verifyAttestationPacked.d.ts +1 -0
  344. package/script/registration/verifications/verifyAttestationPacked.d.ts.map +1 -0
  345. package/script/registration/verifications/verifyAttestationPacked.js +1 -2
  346. package/script/registration/verifyRegistrationResponse.d.ts +18 -14
  347. package/script/registration/verifyRegistrationResponse.d.ts.map +1 -0
  348. package/script/registration/verifyRegistrationResponse.js +1 -2
  349. package/script/services/defaultRootCerts/android-key.d.ts +1 -0
  350. package/script/services/defaultRootCerts/android-key.d.ts.map +1 -0
  351. package/script/services/defaultRootCerts/android-safetynet.d.ts +1 -0
  352. package/script/services/defaultRootCerts/android-safetynet.d.ts.map +1 -0
  353. package/script/services/defaultRootCerts/apple.d.ts +1 -0
  354. package/script/services/defaultRootCerts/apple.d.ts.map +1 -0
  355. package/script/services/defaultRootCerts/mds.d.ts +1 -0
  356. package/script/services/defaultRootCerts/mds.d.ts.map +1 -0
  357. package/script/services/metadataService.d.ts +30 -11
  358. package/script/services/metadataService.d.ts.map +1 -0
  359. package/script/services/metadataService.js +8 -22
  360. package/script/services/settingsService.d.ts +18 -5
  361. package/script/services/settingsService.d.ts.map +1 -0
  362. package/script/services/settingsService.js +14 -10
  363. package/script/types/dom.d.ts +329 -0
  364. package/script/types/dom.d.ts.map +1 -0
  365. package/script/types/dom.js +2 -0
  366. package/script/types/index.d.ts +205 -0
  367. package/script/types/index.d.ts.map +1 -0
  368. package/script/types/index.js +2 -0
  369. package/esm/deps.d.ts +0 -9
  370. package/esm/deps.js +0 -12
  371. package/script/deps.d.ts +0 -9
  372. package/script/deps.js +0 -70
@@ -3,3 +3,4 @@ import type { AttestationFormatVerifierOpts } from '../verifyRegistrationRespons
3
3
  * Verify an attestation response with fmt 'packed'
4
4
  */
5
5
  export declare function verifyAttestationPacked(options: AttestationFormatVerifierOpts): Promise<boolean>;
6
+ //# sourceMappingURL=verifyAttestationPacked.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifyAttestationPacked.d.ts","sourceRoot":"","sources":["../../../src/registration/verifications/verifyAttestationPacked.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAYtF;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,OAAO,CAAC,CAyJlB"}
@@ -1,16 +1,10 @@
1
- import type { COSEAlgorithmIdentifier, CredentialDeviceType, RegistrationResponseJSON, WebAuthnCredential } from '../deps.js';
2
- import { AttestationFormat, AttestationStatement } from '../helpers/decodeAttestationObject.js';
3
- import { AuthenticationExtensionsAuthenticatorOutputs } from '../helpers/decodeAuthenticatorExtensions.js';
4
- export type VerifyRegistrationResponseOpts = {
5
- response: RegistrationResponseJSON;
6
- expectedChallenge: string | ((challenge: string) => boolean | Promise<boolean>);
7
- expectedOrigin: string | string[];
8
- expectedRPID?: string | string[];
9
- expectedType?: string | string[];
10
- requireUserPresence?: boolean;
11
- requireUserVerification?: boolean;
12
- supportedAlgorithmIDs?: COSEAlgorithmIdentifier[];
13
- };
1
+ import type { COSEAlgorithmIdentifier, CredentialDeviceType, RegistrationResponseJSON, WebAuthnCredential } from '../types/index.js';
2
+ import { type AttestationFormat, type AttestationStatement } from '../helpers/decodeAttestationObject.js';
3
+ import type { AuthenticationExtensionsAuthenticatorOutputs } from '../helpers/decodeAuthenticatorExtensions.js';
4
+ /**
5
+ * Configurable options when calling `verifyRegistrationResponse()`
6
+ */
7
+ export type VerifyRegistrationResponseOpts = Parameters<typeof verifyRegistrationResponse>[0];
14
8
  /**
15
9
  * Verify that the user has legitimately completed the registration process
16
10
  *
@@ -25,7 +19,16 @@ export type VerifyRegistrationResponseOpts = {
25
19
  * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
26
20
  * @param supportedAlgorithmIDs **(Optional)** - Array of numeric COSE algorithm identifiers supported for attestation by this RP. See https://www.iana.org/assignments/cose/cose.xhtml#algorithms. Defaults to all supported algorithm IDs
27
21
  */
28
- export declare function verifyRegistrationResponse(options: VerifyRegistrationResponseOpts): Promise<VerifiedRegistrationResponse>;
22
+ export declare function verifyRegistrationResponse(options: {
23
+ response: RegistrationResponseJSON;
24
+ expectedChallenge: string | ((challenge: string) => boolean | Promise<boolean>);
25
+ expectedOrigin: string | string[];
26
+ expectedRPID?: string | string[];
27
+ expectedType?: string | string[];
28
+ requireUserPresence?: boolean;
29
+ requireUserVerification?: boolean;
30
+ supportedAlgorithmIDs?: COSEAlgorithmIdentifier[];
31
+ }): Promise<VerifiedRegistrationResponse>;
29
32
  /**
30
33
  * Result of registration verification
31
34
  *
@@ -82,3 +85,4 @@ export type AttestationFormatVerifierOpts = {
82
85
  rpIdHash: Uint8Array;
83
86
  verifyTimestampMS?: boolean;
84
87
  };
88
+ //# sourceMappingURL=verifyRegistrationResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifyRegistrationResponse.d.ts","sourceRoot":"","sources":["../../src/registration/verifyRegistrationResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAE1B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,4CAA4C,EAAE,MAAM,6CAA6C,CAAC;AAoBhH;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9F;;;;;;;;;;;;;GAaG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE;IACP,QAAQ,EAAE,wBAAwB,CAAC;IACnC,iBAAiB,EAAE,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAChF,cAAc,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,qBAAqB,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACnD,GACA,OAAO,CAAC,4BAA4B,CAAC,CAsPvC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE;QACjB,GAAG,EAAE,iBAAiB,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,kBAAkB,CAAC;QAC/B,cAAc,EAAE,YAAY,CAAC;QAC7B,iBAAiB,EAAE,UAAU,CAAC;QAC9B,YAAY,EAAE,OAAO,CAAC;QACtB,oBAAoB,EAAE,oBAAoB,CAAC;QAC3C,kBAAkB,EAAE,OAAO,CAAC;QAC5B,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,6BAA6B,CAAC,EAAE,4CAA4C,CAAC;KAC9E,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,QAAQ,EAAE,UAAU,CAAC;IACrB,cAAc,EAAE,UAAU,CAAC;IAC3B,YAAY,EAAE,UAAU,CAAC;IACzB,mBAAmB,EAAE,UAAU,CAAC;IAChC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,EAAE,UAAU,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC"}
@@ -22,3 +22,4 @@ export declare const Google_Hardware_Attestation_Root_1 = "-----BEGIN CERTIFICAT
22
22
  * 1E:F1:A0:4B:8B:A5:8A:B9:45:89:AC:49:8C:89:82:A7:83:F2:4E:A7:30:7E:01:59:A0:C3:A7:3B:37:7D:87:CC
23
23
  */
24
24
  export declare const Google_Hardware_Attestation_Root_2 = "-----BEGIN CERTIFICATE-----\nMIIFHDCCAwSgAwIBAgIJANUP8luj8tazMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV\nBAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTkxMTIyMjAzNzU4WhcNMzQxMTE4MjAz\nNzU4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B\nAQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS\nSxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7\ntv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj\nnar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq\nC4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ\noVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O\nJtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg\nsTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi\nigHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M\nRPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E\naDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um\nAGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud\nIwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD\nVR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQBOMaBc8oumXb2voc7XCWnu\nXKhBBK3e2KMGz39t7lA3XXRe2ZLLAkLM5y3J7tURkf5a1SutfdOyXAmeE6SRo83U\nh6WszodmMkxK5GM4JGrnt4pBisu5igXEydaW7qq2CdC6DOGjG+mEkN8/TA6p3cno\nL/sPyz6evdjLlSeJ8rFBH6xWyIZCbrcpYEJzXaUOEaxxXxgYz5/cTiVKN2M1G2ok\nQBUIYSY6bjEL4aUN5cfo7ogP3UvliEo3Eo0YgwuzR2v0KR6C1cZqZJSTnghIC/vA\nD32KdNQ+c3N+vl2OTsUVMC1GiWkngNx1OO1+kXW+YTnnTUOtOIswUP/Vqd5SYgAI\nmMAfY8U9/iIgkQj6T2W6FsScy94IN9fFhE1UtzmLoBIuUFsVXJMTz+Jucth+IqoW\nFua9v1R93/k98p41pjtFX+H8DslVgfP097vju4KDlqN64xV1grw3ZLl4CiOe/A91\noeLm2UHOq6wn3esB4r2EIQKb6jTVGu5sYCcdWpXr0AUVqcABPdgL+H7qJguBw09o\njm6xNIrw2OocrDKsudk/okr/AwqEyPKw9WnMlQgLIKw1rODG2NvU9oR3GVGdMkUB\nZutL8VuFkERQGt6vQ2OCw0sV47VMkuYbacK/xyZFiRcrPJPb41zgbQj9XAEyLKCH\nex0SdDrx+tWUDqG8At2JHA==\n-----END CERTIFICATE-----\n";
25
+ //# sourceMappingURL=android-key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"android-key.d.ts","sourceRoot":"","sources":["../../../src/services/defaultRootCerts/android-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kCAAkC,u6DA+B9C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kCAAkC,60DA8B9C,CAAC"}
@@ -9,3 +9,4 @@
9
9
  * EB:D4:10:40:E4:BB:3E:C7:42:C9:E3:81:D3:1E:F2:A4:1A:48:B6:68:5C:96:E7:CE:F3:C1:DF:6C:D4:33:1C:99
10
10
  */
11
11
  export declare const GlobalSign_Root_CA = "-----BEGIN CERTIFICATE-----\nMIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG\nA1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv\nb3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw\nMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i\nYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT\naWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ\njc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp\nxy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp\n1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG\nsnUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ\nU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8\n9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E\nBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B\nAQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz\nyj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE\n38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP\nAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad\nDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME\nHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==\n-----END CERTIFICATE-----\n";
12
+ //# sourceMappingURL=android-safetynet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"android-safetynet.d.ts","sourceRoot":"","sources":["../../../src/services/defaultRootCerts/android-safetynet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,uwCAqB9B,CAAC"}
@@ -9,3 +9,4 @@
9
9
  * 09:15:DD:5C:07:A2:8D:B5:49:D1:F6:77:BB:5A:75:D4:BF:BE:95:61:A7:73:42:43:27:76:2E:9E:02:F9:BB:29
10
10
  */
11
11
  export declare const Apple_WebAuthn_Root_CA = "-----BEGIN CERTIFICATE-----\nMIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w\nHQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ\nbmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx\nNTAwMDAwMFowSzEfMB0GA1UEAwwWQXBwbGUgV2ViQXV0aG4gUm9vdCBDQTETMBEG\nA1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTB2MBAGByqGSM49\nAgEGBSuBBAAiA2IABCJCQ2pTVhzjl4Wo6IhHtMSAzO2cv+H9DQKev3//fG59G11k\nxu9eI0/7o6V5uShBpe1u6l6mS19S1FEh6yGljnZAJ+2GNP1mi/YK2kSXIuTHjxA/\npcoRf7XkOtO4o1qlcaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJtdk\n2cV4wlpn0afeaxLQG2PxxtcwDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cA\nMGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3\njAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B\n1bWeT0vT\n-----END CERTIFICATE-----\n";
12
+ //# sourceMappingURL=apple.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apple.d.ts","sourceRoot":"","sources":["../../../src/services/defaultRootCerts/apple.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,6xBAclC,CAAC"}
@@ -9,3 +9,4 @@
9
9
  * CB:B5:22:D7:B7:F1:27:AD:6A:01:13:86:5B:DF:1C:D4:10:2E:7D:07:59:AF:63:5A:7C:F4:72:0D:C9:63:C5:3B
10
10
  */
11
11
  export declare const GlobalSign_Root_CA_R3 = "-----BEGIN CERTIFICATE-----\n MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G\n A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp\n Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4\n MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG\n A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI\n hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8\n RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT\n gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm\n KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd\n QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ\n XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw\n DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o\n LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU\n RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp\n jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK\n 6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX\n mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs\n Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH\n WD9f\n -----END CERTIFICATE-----\n ";
12
+ //# sourceMappingURL=mds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mds.d.ts","sourceRoot":"","sources":["../../../src/services/defaultRootCerts/mds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,4vCAqBhC,CAAC"}
@@ -1,16 +1,10 @@
1
1
  import type { MetadataStatement } from '../metadata/mdsTypes.js';
2
- type VerificationMode = 'permissive' | 'strict';
3
2
  /**
4
- * A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB
5
- * download and parsing, and on-demand requesting and caching of individual metadata statements.
6
- *
7
- * https://fidoalliance.org/metadata/
3
+ * Allow MetadataService to accommodate unregistered AAGUIDs (`"permissive"`), or only allow
4
+ * registered AAGUIDs (`"strict"`). Currently primarily impacts how `getStatement()` operates
8
5
  */
9
- export declare class BaseMetadataService {
10
- private mdsCache;
11
- private statementCache;
12
- private state;
13
- private verificationMode;
6
+ export type VerificationMode = 'permissive' | 'strict';
7
+ interface MetadataService {
14
8
  /**
15
9
  * Prepare the service to handle remote MDS servers and/or cache local metadata statements.
16
10
  *
@@ -36,6 +30,24 @@ export declare class BaseMetadataService {
36
30
  * BLOB download.
37
31
  */
38
32
  getStatement(aaguid: string | Uint8Array): Promise<MetadataStatement | undefined>;
33
+ }
34
+ /**
35
+ * An implementation of `MetadataService` that can download and parse BLOBs, and support on-demand
36
+ * requesting and caching of individual metadata statements.
37
+ *
38
+ * https://fidoalliance.org/metadata/
39
+ */
40
+ export declare class BaseMetadataService implements MetadataService {
41
+ private mdsCache;
42
+ private statementCache;
43
+ private state;
44
+ private verificationMode;
45
+ initialize(opts?: {
46
+ mdsServers?: string[];
47
+ statements?: MetadataStatement[];
48
+ verificationMode?: VerificationMode;
49
+ }): Promise<void>;
50
+ getStatement(aaguid: string | Uint8Array): Promise<MetadataStatement | undefined>;
39
51
  /**
40
52
  * Download and process the latest BLOB from MDS
41
53
  */
@@ -49,5 +61,12 @@ export declare class BaseMetadataService {
49
61
  */
50
62
  private setState;
51
63
  }
52
- export declare const MetadataService: BaseMetadataService;
64
+ /**
65
+ * A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB
66
+ * download and parsing, and on-demand requesting and caching of individual metadata statements.
67
+ *
68
+ * https://fidoalliance.org/metadata/
69
+ */
70
+ export declare const MetadataService: MetadataService;
53
71
  export {};
72
+ //# sourceMappingURL=metadataService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadataService.d.ts","sourceRoot":"","sources":["../../src/services/metadataService.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIV,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AA6BjC;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,QAAQ,CAAC;AAIvD,UAAU,eAAe;IACvB;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,IAAI,CAAC,EAAE;QAChB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;QACjC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;KACrC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClB;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC;CACnF;AAED;;;;;GAKG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IACzD,OAAO,CAAC,QAAQ,CAAoC;IACpD,OAAO,CAAC,cAAc,CAA6C;IACnE,OAAO,CAAC,KAAK,CAAyC;IACtD,OAAO,CAAC,gBAAgB,CAA8B;IAEhD,UAAU,CACd,IAAI,GAAE;QACJ,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;QACjC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;KAChC,GACL,OAAO,CAAC,IAAI,CAAC;IA+DV,YAAY,CAChB,MAAM,EAAE,MAAM,GAAG,UAAU,GAC1B,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IA6DzC;;OAEG;YACW,YAAY;IAoE1B;;OAEG;IACH,OAAO,CAAC,eAAe;IAgCvB;;OAEG;IACH,OAAO,CAAC,QAAQ;CAWjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,eAA2C,CAAC"}
@@ -16,8 +16,8 @@ var SERVICE_STATE;
16
16
  })(SERVICE_STATE || (SERVICE_STATE = {}));
17
17
  const log = getLogger('MetadataService');
18
18
  /**
19
- * A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB
20
- * download and parsing, and on-demand requesting and caching of individual metadata statements.
19
+ * An implementation of `MetadataService` that can download and parse BLOBs, and support on-demand
20
+ * requesting and caching of individual metadata statements.
21
21
  *
22
22
  * https://fidoalliance.org/metadata/
23
23
  */
@@ -48,19 +48,6 @@ export class BaseMetadataService {
48
48
  value: 'strict'
49
49
  });
50
50
  }
51
- /**
52
- * Prepare the service to handle remote MDS servers and/or cache local metadata statements.
53
- *
54
- * **Options:**
55
- *
56
- * @param opts.mdsServers An array of URLs to FIDO Alliance Metadata Service
57
- * (version 3.0)-compatible servers. Defaults to the official FIDO MDS server
58
- * @param opts.statements An array of local metadata statements
59
- * @param opts.verificationMode How MetadataService will handle unregistered AAGUIDs. Defaults to
60
- * `"strict"` which throws errors during registration response verification when an
61
- * unregistered AAGUID is encountered. Set to `"permissive"` to allow registration by
62
- * authenticators with unregistered AAGUIDs
63
- */
64
51
  async initialize(opts = {}) {
65
52
  const { mdsServers = [defaultURLMDS], statements, verificationMode } = opts;
66
53
  this.setState(SERVICE_STATE.REFRESHING);
@@ -112,12 +99,6 @@ export class BaseMetadataService {
112
99
  }
113
100
  this.setState(SERVICE_STATE.READY);
114
101
  }
115
- /**
116
- * Get a metadata statement for a given AAGUID.
117
- *
118
- * This method will coordinate updating the cache as per the `nextUpdate` property in the initial
119
- * BLOB download.
120
- */
121
102
  async getStatement(aaguid) {
122
103
  if (this.state === SERVICE_STATE.DISABLED) {
123
104
  return;
@@ -269,5 +250,10 @@ export class BaseMetadataService {
269
250
  }
270
251
  }
271
252
  }
272
- // Export a service singleton
253
+ /**
254
+ * A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB
255
+ * download and parsing, and on-demand requesting and caching of individual metadata statements.
256
+ *
257
+ * https://fidoalliance.org/metadata/
258
+ */
273
259
  export const MetadataService = new BaseMetadataService();
@@ -1,8 +1,6 @@
1
1
  import { AttestationFormat } from '../helpers/decodeAttestationObject.js';
2
- type RootCertIdentifier = AttestationFormat | 'mds';
3
- declare class BaseSettingsService {
4
- private pemCertificates;
5
- constructor();
2
+ export type RootCertIdentifier = AttestationFormat | 'mds';
3
+ interface SettingsService {
6
4
  /**
7
5
  * Set potential root certificates for attestation formats that use them. Root certs will be tried
8
6
  * one-by-one when validating a certificate path.
@@ -21,5 +19,20 @@ declare class BaseSettingsService {
21
19
  identifier: RootCertIdentifier;
22
20
  }): string[];
23
21
  }
24
- export declare const SettingsService: BaseSettingsService;
22
+ /**
23
+ * A basic service for specifying acceptable root certificates for all supported attestation
24
+ * statement formats.
25
+ *
26
+ * In addition, default root certificates are included for the following statement formats:
27
+ *
28
+ * - `'android-key'`
29
+ * - `'android-safetynet'`
30
+ * - `'apple'`
31
+ * - `'android-mds'`
32
+ *
33
+ * These can be overwritten as needed by setting alternative root certificates for their format
34
+ * identifier using `setRootCertificates()`.
35
+ */
36
+ export declare const SettingsService: SettingsService;
25
37
  export {};
38
+ //# sourceMappingURL=settingsService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingsService.d.ts","sourceRoot":"","sources":["../../src/services/settingsService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAW1E,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,GAAG,KAAK,CAAC;AAE3D,UAAU,eAAe;IACvB;;;;;;OAMG;IACH,mBAAmB,CAAC,IAAI,EAAE;QACxB,UAAU,EAAE,kBAAkB,CAAC;QAC/B,YAAY,EAAE,CAAC,UAAU,GAAG,MAAM,CAAC,EAAE,CAAC;KACvC,GAAG,IAAI,CAAC;IAET;;OAEG;IACH,mBAAmB,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,kBAAkB,CAAA;KAAE,GAAG,MAAM,EAAE,CAAC;CACzE;AAkCD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,EAAE,eAA2C,CAAC"}
@@ -14,13 +14,6 @@ class BaseSettingsService {
14
14
  });
15
15
  this.pemCertificates = new Map();
16
16
  }
17
- /**
18
- * Set potential root certificates for attestation formats that use them. Root certs will be tried
19
- * one-by-one when validating a certificate path.
20
- *
21
- * Certificates can be specified as a raw `Buffer`, or as a PEM-formatted string. If a
22
- * `Buffer` is passed in it will be converted to PEM format.
23
- */
24
17
  setRootCertificates(opts) {
25
18
  const { identifier, certificates } = opts;
26
19
  const newCertificates = [];
@@ -34,14 +27,25 @@ class BaseSettingsService {
34
27
  }
35
28
  this.pemCertificates.set(identifier, newCertificates);
36
29
  }
37
- /**
38
- * Get any registered root certificates for the specified attestation format
39
- */
40
30
  getRootCertificates(opts) {
41
31
  const { identifier } = opts;
42
32
  return this.pemCertificates.get(identifier) ?? [];
43
33
  }
44
34
  }
35
+ /**
36
+ * A basic service for specifying acceptable root certificates for all supported attestation
37
+ * statement formats.
38
+ *
39
+ * In addition, default root certificates are included for the following statement formats:
40
+ *
41
+ * - `'android-key'`
42
+ * - `'android-safetynet'`
43
+ * - `'apple'`
44
+ * - `'android-mds'`
45
+ *
46
+ * These can be overwritten as needed by setting alternative root certificates for their format
47
+ * identifier using `setRootCertificates()`.
48
+ */
45
49
  export const SettingsService = new BaseSettingsService();
46
50
  // Initialize default certificates
47
51
  SettingsService.setRootCertificates({
@@ -0,0 +1,329 @@
1
+ /**
2
+ * DO NOT MODIFY THESE FILES!
3
+ *
4
+ * These files were copied from the **types** package. To update this file, make changes to those
5
+ * files instead and then run the following command from the monorepo root folder:
6
+ *
7
+ * deno task codegen:types
8
+ */
9
+ /**
10
+ * Generated from typescript@5.6.3
11
+ * To regenerate, run the following command from the package root:
12
+ * deno task extract-dom-types
13
+ */
14
+ /**
15
+ * Available only in secure contexts.
16
+ *
17
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse)
18
+ */
19
+ export interface AuthenticatorAssertionResponse extends AuthenticatorResponse {
20
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/authenticatorData) */
21
+ readonly authenticatorData: ArrayBuffer;
22
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/signature) */
23
+ readonly signature: ArrayBuffer;
24
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/userHandle) */
25
+ readonly userHandle: ArrayBuffer | null;
26
+ }
27
+ /**
28
+ * Available only in secure contexts.
29
+ *
30
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse)
31
+ */
32
+ export interface AuthenticatorAttestationResponse extends AuthenticatorResponse {
33
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/attestationObject) */
34
+ readonly attestationObject: ArrayBuffer;
35
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getAuthenticatorData) */
36
+ getAuthenticatorData(): ArrayBuffer;
37
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKey) */
38
+ getPublicKey(): ArrayBuffer | null;
39
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKeyAlgorithm) */
40
+ getPublicKeyAlgorithm(): COSEAlgorithmIdentifier;
41
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getTransports) */
42
+ getTransports(): string[];
43
+ }
44
+ export interface AuthenticationExtensionsClientInputs {
45
+ appid?: string;
46
+ credProps?: boolean;
47
+ hmacCreateSecret?: boolean;
48
+ minPinLength?: boolean;
49
+ }
50
+ export interface AuthenticationExtensionsClientOutputs {
51
+ appid?: boolean;
52
+ credProps?: CredentialPropertiesOutput;
53
+ hmacCreateSecret?: boolean;
54
+ }
55
+ export interface AuthenticatorSelectionCriteria {
56
+ authenticatorAttachment?: AuthenticatorAttachment;
57
+ requireResidentKey?: boolean;
58
+ residentKey?: ResidentKeyRequirement;
59
+ userVerification?: UserVerificationRequirement;
60
+ }
61
+ /**
62
+ * Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives.
63
+ *
64
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto)
65
+ */
66
+ export interface Crypto {
67
+ /**
68
+ * Available only in secure contexts.
69
+ *
70
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle)
71
+ */
72
+ readonly subtle: SubtleCrypto;
73
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
74
+ getRandomValues<T extends ArrayBufferView | null>(array: T): T;
75
+ /**
76
+ * Available only in secure contexts.
77
+ *
78
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
79
+ */
80
+ randomUUID(): `${string}-${string}-${string}-${string}-${string}`;
81
+ }
82
+ /**
83
+ * Available only in secure contexts.
84
+ *
85
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential)
86
+ */
87
+ export interface PublicKeyCredential extends Credential {
88
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/authenticatorAttachment) */
89
+ readonly authenticatorAttachment: string | null;
90
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/rawId) */
91
+ readonly rawId: ArrayBuffer;
92
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/response) */
93
+ readonly response: AuthenticatorResponse;
94
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/getClientExtensionResults) */
95
+ getClientExtensionResults(): AuthenticationExtensionsClientOutputs;
96
+ }
97
+ export interface PublicKeyCredentialCreationOptions {
98
+ attestation?: AttestationConveyancePreference;
99
+ authenticatorSelection?: AuthenticatorSelectionCriteria;
100
+ challenge: BufferSource;
101
+ excludeCredentials?: PublicKeyCredentialDescriptor[];
102
+ extensions?: AuthenticationExtensionsClientInputs;
103
+ pubKeyCredParams: PublicKeyCredentialParameters[];
104
+ rp: PublicKeyCredentialRpEntity;
105
+ timeout?: number;
106
+ user: PublicKeyCredentialUserEntity;
107
+ }
108
+ export interface PublicKeyCredentialDescriptor {
109
+ id: BufferSource;
110
+ transports?: AuthenticatorTransport[];
111
+ type: PublicKeyCredentialType;
112
+ }
113
+ export interface PublicKeyCredentialParameters {
114
+ alg: COSEAlgorithmIdentifier;
115
+ type: PublicKeyCredentialType;
116
+ }
117
+ export interface PublicKeyCredentialRequestOptions {
118
+ allowCredentials?: PublicKeyCredentialDescriptor[];
119
+ challenge: BufferSource;
120
+ extensions?: AuthenticationExtensionsClientInputs;
121
+ rpId?: string;
122
+ timeout?: number;
123
+ userVerification?: UserVerificationRequirement;
124
+ }
125
+ export interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity {
126
+ displayName: string;
127
+ id: BufferSource;
128
+ }
129
+ /**
130
+ * Available only in secure contexts.
131
+ *
132
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorResponse)
133
+ */
134
+ export interface AuthenticatorResponse {
135
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorResponse/clientDataJSON) */
136
+ readonly clientDataJSON: ArrayBuffer;
137
+ }
138
+ export interface CredentialPropertiesOutput {
139
+ rk?: boolean;
140
+ }
141
+ /**
142
+ * This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto).
143
+ * Available only in secure contexts.
144
+ *
145
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto)
146
+ */
147
+ export interface SubtleCrypto {
148
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */
149
+ decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
150
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */
151
+ deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
152
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
153
+ deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
154
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */
155
+ digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
156
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */
157
+ encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
158
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
159
+ exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
160
+ exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
161
+ exportKey(format: KeyFormat, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
162
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
163
+ generateKey(algorithm: "Ed25519", extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
164
+ generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
165
+ generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
166
+ generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
167
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */
168
+ importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
169
+ importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
170
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */
171
+ sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
172
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */
173
+ unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
174
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */
175
+ verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise<boolean>;
176
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */
177
+ wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise<ArrayBuffer>;
178
+ }
179
+ /**
180
+ * Available only in secure contexts.
181
+ *
182
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential)
183
+ */
184
+ export interface Credential {
185
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential/id) */
186
+ readonly id: string;
187
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential/type) */
188
+ readonly type: string;
189
+ }
190
+ export interface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity {
191
+ id?: string;
192
+ }
193
+ export interface PublicKeyCredentialEntity {
194
+ name: string;
195
+ }
196
+ export interface RsaOaepParams extends Algorithm {
197
+ label?: BufferSource;
198
+ }
199
+ export interface AesCtrParams extends Algorithm {
200
+ counter: BufferSource;
201
+ length: number;
202
+ }
203
+ export interface AesCbcParams extends Algorithm {
204
+ iv: BufferSource;
205
+ }
206
+ export interface AesGcmParams extends Algorithm {
207
+ additionalData?: BufferSource;
208
+ iv: BufferSource;
209
+ tagLength?: number;
210
+ }
211
+ /**
212
+ * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
213
+ * Available only in secure contexts.
214
+ *
215
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey)
216
+ */
217
+ export interface CryptoKey {
218
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */
219
+ readonly algorithm: KeyAlgorithm;
220
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */
221
+ readonly extractable: boolean;
222
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */
223
+ readonly type: KeyType;
224
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */
225
+ readonly usages: KeyUsage[];
226
+ }
227
+ export interface EcdhKeyDeriveParams extends Algorithm {
228
+ public: CryptoKey;
229
+ }
230
+ export interface HkdfParams extends Algorithm {
231
+ hash: HashAlgorithmIdentifier;
232
+ info: BufferSource;
233
+ salt: BufferSource;
234
+ }
235
+ export interface Pbkdf2Params extends Algorithm {
236
+ hash: HashAlgorithmIdentifier;
237
+ iterations: number;
238
+ salt: BufferSource;
239
+ }
240
+ export interface AesDerivedKeyParams extends Algorithm {
241
+ length: number;
242
+ }
243
+ export interface HmacImportParams extends Algorithm {
244
+ hash: HashAlgorithmIdentifier;
245
+ length?: number;
246
+ }
247
+ export interface JsonWebKey {
248
+ alg?: string;
249
+ crv?: string;
250
+ d?: string;
251
+ dp?: string;
252
+ dq?: string;
253
+ e?: string;
254
+ ext?: boolean;
255
+ k?: string;
256
+ key_ops?: string[];
257
+ kty?: string;
258
+ n?: string;
259
+ oth?: RsaOtherPrimesInfo[];
260
+ p?: string;
261
+ q?: string;
262
+ qi?: string;
263
+ use?: string;
264
+ x?: string;
265
+ y?: string;
266
+ }
267
+ export interface CryptoKeyPair {
268
+ privateKey: CryptoKey;
269
+ publicKey: CryptoKey;
270
+ }
271
+ export interface RsaHashedKeyGenParams extends RsaKeyGenParams {
272
+ hash: HashAlgorithmIdentifier;
273
+ }
274
+ export interface EcKeyGenParams extends Algorithm {
275
+ namedCurve: NamedCurve;
276
+ }
277
+ export interface AesKeyGenParams extends Algorithm {
278
+ length: number;
279
+ }
280
+ export interface HmacKeyGenParams extends Algorithm {
281
+ hash: HashAlgorithmIdentifier;
282
+ length?: number;
283
+ }
284
+ export interface RsaHashedImportParams extends Algorithm {
285
+ hash: HashAlgorithmIdentifier;
286
+ }
287
+ export interface EcKeyImportParams extends Algorithm {
288
+ namedCurve: NamedCurve;
289
+ }
290
+ export interface AesKeyAlgorithm extends KeyAlgorithm {
291
+ length: number;
292
+ }
293
+ export interface RsaPssParams extends Algorithm {
294
+ saltLength: number;
295
+ }
296
+ export interface EcdsaParams extends Algorithm {
297
+ hash: HashAlgorithmIdentifier;
298
+ }
299
+ export interface Algorithm {
300
+ name: string;
301
+ }
302
+ export interface KeyAlgorithm {
303
+ name: string;
304
+ }
305
+ export interface RsaOtherPrimesInfo {
306
+ d?: string;
307
+ r?: string;
308
+ t?: string;
309
+ }
310
+ export interface RsaKeyGenParams extends Algorithm {
311
+ modulusLength: number;
312
+ publicExponent: BigInteger;
313
+ }
314
+ export type AttestationConveyancePreference = "direct" | "enterprise" | "indirect" | "none";
315
+ export type AuthenticatorTransport = "ble" | "hybrid" | "internal" | "nfc" | "usb";
316
+ export type COSEAlgorithmIdentifier = number;
317
+ export type UserVerificationRequirement = "discouraged" | "preferred" | "required";
318
+ export type AuthenticatorAttachment = "cross-platform" | "platform";
319
+ export type ResidentKeyRequirement = "discouraged" | "preferred" | "required";
320
+ export type BufferSource = ArrayBufferView | ArrayBuffer;
321
+ export type PublicKeyCredentialType = "public-key";
322
+ export type AlgorithmIdentifier = Algorithm | string;
323
+ export type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey";
324
+ export type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
325
+ export type KeyType = "private" | "public" | "secret";
326
+ export type HashAlgorithmIdentifier = AlgorithmIdentifier;
327
+ export type NamedCurve = string;
328
+ export type BigInteger = Uint8Array;
329
+ //# sourceMappingURL=dom.d.ts.map