This repository was archived by the owner on Jul 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +0
-36
lines changed
current/src/main/scala/io/scalajs/nodejs/crypto
nodejs-v10/src/test/scala/io/scalajs/nodejs/crypto Expand file tree Collapse file tree 3 files changed +0
-36
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,6 @@ import scala.scalajs.js
6
6
import scala .scalajs .js .annotation .JSImport
7
7
import scala .scalajs .js .|
8
8
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
-
18
9
@ js.native
19
10
@ JSImport (" crypto" , " Certificate" )
20
11
object Certificate extends js.Object {
Original file line number Diff line number Diff line change @@ -282,8 +282,6 @@ trait Crypto extends js.Object {
282
282
@ js.native
283
283
@ JSImport (" crypto" , JSImport .Namespace )
284
284
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
287
285
type Cipher = io.scalajs.nodejs.crypto.Cipher
288
286
type Decipher = io.scalajs.nodejs.crypto.Decipher
289
287
type DiffieHellman = io.scalajs.nodejs.crypto.DiffieHellman
Original file line number Diff line number Diff line change @@ -8,31 +8,6 @@ class CertificateTest extends AnyFunSpec with Matchers {
8
8
val spkacExample =
9
9
" MIIBXjCByDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA3L0IfUijj7+A8CPC8EmhcdNoe5fUAog7OrBdhn7EkxFButUp40P7+LiYiygYG1TmoI/a5EgsLU3s9twEz3hmgY9mYIqb/rb+SF8qlD/K6KVyUORC7Wlz1Df4L8O3DuRGzx6/+3jIW6cPBpfgH1sVuYS1vDBsP/gMMIxwTsKJ4P0CAwEAARYkYzBkZjFlYjctMTU0NC00MWVkLWFmN2EtZDRkYjBkNDc5ZjZmMA0GCSqGSIb3DQEBBAUAA4GBALEiapUjaIPs5uEdvCP0gFK2qofo+4GpeK1A43mu28lirYPAvCWsmYvKIZIT9TxvzmQIxAfxobf70aSNlSm6MJJKmvurAK+Bpn6ZUKQZ6A1m927LvctVSYJuUi+WVmr0fGE/OfdQ+BqSm/eQ3jnm3fBPVx1uwLPgjC5g4EvGMh8M"
10
10
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
-
36
11
describe(" Certificate object" ) {
37
12
it(" exportChallenge" ) {
38
13
assert(Certificate .exportChallenge(spkacExample).toString(" utf8" ) === " c0df1eb7-1544-41ed-af7a-d4db0d479f6f" )
You can’t perform that action at this time.
0 commit comments