Skip to content

Commit 6d9ae70

Browse files
authored
Merge pull request #431 from japgolly/importKey
Make crypto.subtle.importKey return a js.Promise[CryptoKey]
2 parents ed69be7 + caa307d commit 6d9ae70

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

api-reports/2_12.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ crypto/SubtleCrypto[JT] def digest(algorithm: HashAlgorithmIdentifier, data: Buf
192192
crypto/SubtleCrypto[JT] def encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): js.Promise[js.Any]
193193
crypto/SubtleCrypto[JT] def exportKey(format: KeyFormat, key: CryptoKey): js.Promise[js.Any]
194194
crypto/SubtleCrypto[JT] def generateKey(algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any]
195-
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: BufferSource, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any]
196-
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: JsonWebKey, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any]
195+
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: BufferSource, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[CryptoKey]
196+
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: JsonWebKey, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[CryptoKey]
197197
crypto/SubtleCrypto[JT] def sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): js.Promise[js.Any]
198198
crypto/SubtleCrypto[JT] def unwrapKey(format: String, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any]
199199
crypto/SubtleCrypto[JT] def verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource): js.Promise[js.Any]

api-reports/2_13.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ crypto/SubtleCrypto[JT] def digest(algorithm: HashAlgorithmIdentifier, data: Buf
192192
crypto/SubtleCrypto[JT] def encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): js.Promise[js.Any]
193193
crypto/SubtleCrypto[JT] def exportKey(format: KeyFormat, key: CryptoKey): js.Promise[js.Any]
194194
crypto/SubtleCrypto[JT] def generateKey(algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any]
195-
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: BufferSource, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any]
196-
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: JsonWebKey, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any]
195+
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: BufferSource, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[CryptoKey]
196+
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: JsonWebKey, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[CryptoKey]
197197
crypto/SubtleCrypto[JT] def sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): js.Promise[js.Any]
198198
crypto/SubtleCrypto[JT] def unwrapKey(format: String, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any]
199199
crypto/SubtleCrypto[JT] def verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource): js.Promise[js.Any]

src/main/scala/org/scalajs/dom/crypto/Crypto.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ trait SubtleCrypto extends js.Object {
265265
*/
266266
def importKey(format: KeyFormat, keyData: BufferSource,
267267
algorithm: KeyAlgorithmIdentifier, extractable: Boolean,
268-
keyUsages: js.Array[KeyUsage]): js.Promise[js.Any] = js.native
268+
keyUsages: js.Array[KeyUsage]): js.Promise[CryptoKey] = js.native
269269

270270
/**
271271
* Returns a Promise of a CryptoKey corresponding to the format, the
@@ -280,7 +280,7 @@ trait SubtleCrypto extends js.Object {
280280
*/
281281
def importKey(format: KeyFormat, keyData: JsonWebKey,
282282
algorithm: KeyAlgorithmIdentifier, extractable: Boolean,
283-
keyUsages: js.Array[KeyUsage]): js.Promise[js.Any] = js.native
283+
keyUsages: js.Array[KeyUsage]): js.Promise[CryptoKey] = js.native
284284

285285
/**
286286
* Returns a Promise of a buffer containing the key in the format requested.

0 commit comments

Comments
 (0)