Skip to content

Make crypto.subtle.importKey return a js.Promise[CryptoKey] #431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api-reports/2_12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ crypto/SubtleCrypto[JT] def digest(algorithm: HashAlgorithmIdentifier, data: Buf
crypto/SubtleCrypto[JT] def encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): js.Promise[js.Any]
crypto/SubtleCrypto[JT] def exportKey(format: KeyFormat, key: CryptoKey): js.Promise[js.Any]
crypto/SubtleCrypto[JT] def generateKey(algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any]
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: BufferSource, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any]
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: JsonWebKey, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any]
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: BufferSource, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[CryptoKey]
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: JsonWebKey, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[CryptoKey]
crypto/SubtleCrypto[JT] def sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): js.Promise[js.Any]
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]
crypto/SubtleCrypto[JT] def verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource): js.Promise[js.Any]
Expand Down
4 changes: 2 additions & 2 deletions api-reports/2_13.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ crypto/SubtleCrypto[JT] def digest(algorithm: HashAlgorithmIdentifier, data: Buf
crypto/SubtleCrypto[JT] def encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): js.Promise[js.Any]
crypto/SubtleCrypto[JT] def exportKey(format: KeyFormat, key: CryptoKey): js.Promise[js.Any]
crypto/SubtleCrypto[JT] def generateKey(algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any]
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: BufferSource, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any]
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: JsonWebKey, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any]
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: BufferSource, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[CryptoKey]
crypto/SubtleCrypto[JT] def importKey(format: KeyFormat, keyData: JsonWebKey, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[CryptoKey]
crypto/SubtleCrypto[JT] def sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): js.Promise[js.Any]
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]
crypto/SubtleCrypto[JT] def verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource): js.Promise[js.Any]
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/org/scalajs/dom/crypto/Crypto.scala
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ trait SubtleCrypto extends js.Object {
*/
def importKey(format: KeyFormat, keyData: BufferSource,
algorithm: KeyAlgorithmIdentifier, extractable: Boolean,
keyUsages: js.Array[KeyUsage]): js.Promise[js.Any] = js.native
keyUsages: js.Array[KeyUsage]): js.Promise[CryptoKey] = js.native

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

/**
* Returns a Promise of a buffer containing the key in the format requested.
Expand Down