Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit 9937d48

Browse files
author
exoego
committed
1 parent 62f7c2b commit 9937d48

File tree

3 files changed

+0
-36
lines changed

3 files changed

+0
-36
lines changed

app/current/src/main/scala/io/scalajs/nodejs/crypto/Certificate.scala

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@ import scala.scalajs.js
66
import scala.scalajs.js.annotation.JSImport
77
import scala.scalajs.js.|
88

9-
@deprecated("Legacy API, not recommended to create new instance. Use Certificate object.", "v0.10.0")
10-
@js.native
11-
@JSImport("crypto", "Certificate")
12-
class Certificate extends js.Object {
13-
def exportChallenge(spkac: String | BufferLike): Buffer = js.native
14-
def exportPublicKey(spkac: String | BufferLike, encoding: String = js.native): Buffer = js.native
15-
def verifySpkac(spkac: BufferLike): Boolean = js.native
16-
}
17-
189
@js.native
1910
@JSImport("crypto", "Certificate")
2011
object Certificate extends js.Object {

app/current/src/main/scala/io/scalajs/nodejs/crypto/Crypto.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,6 @@ trait Crypto extends js.Object {
282282
@js.native
283283
@JSImport("crypto", JSImport.Namespace)
284284
object Crypto extends Crypto {
285-
@deprecated("Legacy API, not recommended to create new instance. Use Certificate object.", "v0.10.0")
286-
type Certificate = io.scalajs.nodejs.crypto.Certificate
287285
type Cipher = io.scalajs.nodejs.crypto.Cipher
288286
type Decipher = io.scalajs.nodejs.crypto.Decipher
289287
type DiffieHellman = io.scalajs.nodejs.crypto.DiffieHellman

app/nodejs-v10/src/test/scala/io/scalajs/nodejs/crypto/CertificateTest.scala

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,6 @@ class CertificateTest extends AnyFunSpec with Matchers {
88
val spkacExample =
99
"MIIBXjCByDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA3L0IfUijj7+A8CPC8EmhcdNoe5fUAog7OrBdhn7EkxFButUp40P7+LiYiygYG1TmoI/a5EgsLU3s9twEz3hmgY9mYIqb/rb+SF8qlD/K6KVyUORC7Wlz1Df4L8O3DuRGzx6/+3jIW6cPBpfgH1sVuYS1vDBsP/gMMIxwTsKJ4P0CAwEAARYkYzBkZjFlYjctMTU0NC00MWVkLWFmN2EtZDRkYjBkNDc5ZjZmMA0GCSqGSIb3DQEBBAUAA4GBALEiapUjaIPs5uEdvCP0gFK2qofo+4GpeK1A43mu28lirYPAvCWsmYvKIZIT9TxvzmQIxAfxobf70aSNlSm6MJJKmvurAK+Bpn6ZUKQZ6A1m927LvctVSYJuUi+WVmr0fGE/OfdQ+BqSm/eQ3jnm3fBPVx1uwLPgjC5g4EvGMh8M"
1010

11-
describe("Certificate class (Legacy)") {
12-
val instance = new Certificate()
13-
14-
it("exportChallenge") {
15-
assert(instance.exportChallenge(spkacExample).toString("utf8") === "c0df1eb7-1544-41ed-af7a-d4db0d479f6f")
16-
}
17-
18-
it("exportPublicKey") {
19-
assert(
20-
instance.exportPublicKey(spkacExample).toString("utf8") ===
21-
"""-----BEGIN PUBLIC KEY-----
22-
|MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDcvQh9SKOPv4DwI8LwSaFx02h7
23-
|l9QCiDs6sF2GfsSTEUG61SnjQ/v4uJiLKBgbVOagj9rkSCwtTez23ATPeGaBj2Zg
24-
|ipv+tv5IXyqUP8ropXJQ5ELtaXPUN/gvw7cO5EbPHr/7eMhbpw8Gl+AfWxW5hLW8
25-
|MGw/+AwwjHBOwong/QIDAQAB
26-
|-----END PUBLIC KEY-----
27-
|""".stripMargin
28-
)
29-
}
30-
31-
it("verifySpkac") {
32-
assert(instance.verifySpkac(Buffer.from("foo")) === false)
33-
}
34-
}
35-
3611
describe("Certificate object") {
3712
it("exportChallenge") {
3813
assert(Certificate.exportChallenge(spkacExample).toString("utf8") === "c0df1eb7-1544-41ed-af7a-d4db0d479f6f")

0 commit comments

Comments
 (0)