-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgstsdp-1.0.d.ts
More file actions
2085 lines (1954 loc) · 70.4 KB
/
gstsdp-1.0.d.ts
File metadata and controls
2085 lines (1954 loc) · 70.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/// <reference path="./gst-1.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://GstSdp?version=1.0' {
// Module dependencies
import type Gst from 'gi://Gst?version=1.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace GstSdp {
/**
* GstSdp-1.0
*/
/**
* The different cache types
*/
enum MIKEYCacheType {
/**
* The envelope key MUST NOT be cached
*/
NONE,
/**
* The envelope key MUST be cached
*/
ALWAYS,
/**
* The envelope key MUST be cached, but only
* to be used for the specific CSB.
*/
FOR_CSB,
}
/**
* The encryption algorithm used to encrypt the Encr data field
*/
enum MIKEYEncAlg {
/**
* no encryption
*/
NULL,
/**
* AES-CM using a 128-bit key
*/
AES_CM_128,
/**
* AES Key Wrap using a 128-bit key
*/
AES_KW_128,
/**
* AES-GCM using a 128-bit key (Since: 1.16)
*/
AES_GCM_128,
}
/**
* The key validity type
*/
enum MIKEYKVType {
/**
* No specific usage rule
*/
NULL,
/**
* The key is associated with the SPI/MKI
*/
SPI,
/**
* The key has a start and expiration time
*/
INTERVAL,
}
/**
* The type of key.
*/
enum MIKEYKeyDataType {
/**
* a TEK Generation Key
*/
TGK,
/**
* Traffic-Encrypting Key
*/
TEK,
}
/**
* Specifies the authentication algorithm used
*/
enum MIKEYMacAlg {
/**
* no authentication
*/
NULL,
/**
* HMAC-SHA-1-160
*/
HMAC_SHA_1_160,
}
/**
* Specifies the method of uniquely mapping Crypto Sessions to the security
* protocol sessions.
*/
enum MIKEYMapType {
/**
* SRTP
*/
MIKEY_MAP_TYPE_SRTP,
}
/**
* The PRF function that has been/will be used for key derivation
*/
enum MIKEYPRFFunc {
/**
* MIKEY-1 PRF function
*/
MIKEY_PRF_MIKEY_1,
}
/**
* Different MIKEY Payload types.
*/
enum MIKEYPayloadType {
/**
* Last payload
*/
LAST,
/**
* Key data transport payload
*/
KEMAC,
/**
* Envelope data payload
*/
PKE,
/**
* DH data payload
*/
DH,
/**
* Signature payload
*/
SIGN,
/**
* Timestamp payload
*/
T,
/**
* ID payload
*/
ID,
/**
* Certificate Payload
*/
CERT,
/**
* Cert hash payload
*/
CHASH,
/**
* Verification message payload
*/
V,
/**
* Security Policy payload
*/
SP,
/**
* RAND payload
*/
RAND,
/**
* Error payload
*/
ERR,
/**
* Key data sub-payload
*/
KEY_DATA,
/**
* General Extension Payload
*/
GEN_EXT,
}
/**
* Specifies the security protocol
*/
enum MIKEYSecProto {
/**
* SRTP
*/
MIKEY_SEC_PROTO_SRTP,
}
/**
* This policy specifies the parameters for SRTP and SRTCP
*/
enum MIKEYSecSRTP {
/**
* Encryption algorithm
*/
ENC_ALG,
/**
* Session Encr. key length
*/
ENC_KEY_LEN,
/**
* Authentication algorithm
*/
AUTH_ALG,
/**
* Session Auth. key length
*/
AUTH_KEY_LEN,
/**
* Session Salt key length
*/
SALT_KEY_LEN,
/**
* SRTP Pseudo Random Function
*/
PRF,
/**
* Key derivation rate
*/
KEY_DERIV_RATE,
/**
* SRTP encryption off/on, 0 if off, 1 if on
*/
SRTP_ENC,
/**
* SRTCP encryption off/on, 0 if off, 1 if on
*/
SRTCP_ENC,
/**
* sender's FEC order
*/
FEC_ORDER,
/**
* SRTP authentication off/on, 0 if off, 1 if on
*/
SRTP_AUTH,
/**
* Authentication tag length
*/
AUTH_TAG_LEN,
/**
* SRTP prefix length
*/
SRTP_PREFIX_LEN,
/**
* AEAD authentication tag length (Since: 1.16)
*/
AEAD_AUTH_TAG_LEN,
}
/**
* Specifies the timestamp type.
*/
enum MIKEYTSType {
/**
* an NTP time in UTC timezone
*/
NTP_UTC,
/**
* an NTP time
*/
NTP,
/**
* a counter
*/
COUNTER,
}
/**
* Different MIKEY data types.
*/
enum MIKEYType {
/**
* Invalid type
*/
INVALID,
/**
* Initiator's pre-shared key message
*/
PSK_INIT,
/**
* Verification message of a Pre-shared key message
*/
PSK_VERIFY,
/**
* Initiator's public-key transport message
*/
PK_INIT,
/**
* Verification message of a public-key message
*/
PK_VERIFY,
/**
* Initiator's DH exchange message
*/
DH_INIT,
/**
* Responder's DH exchange message
*/
DH_RESP,
/**
* Error message
*/
ERROR,
}
/**
* Return values for the SDP functions.
*/
enum SDPResult {
/**
* A successful return value
*/
OK,
/**
* a function was given invalid parameters
*/
EINVAL,
}
/**
* The supported MIKEY version 1.
*/
const MIKEY_VERSION: number;
/**
* The Application-Specific Maximum bandwidth modifier.
*/
const SDP_BWTYPE_AS: string;
/**
* The Conference Total bandwidth modifier.
*/
const SDP_BWTYPE_CT: string;
/**
* The extension prefix bandwidth modifier.
*/
const SDP_BWTYPE_EXT_PREFIX: string;
/**
* RTCP bandwidth allocated to data receivers (RFC 3556).
*/
const SDP_BWTYPE_RR: string;
/**
* RTCP bandwidth allocated to active data senders (RFC 3556).
*/
const SDP_BWTYPE_RS: string;
/**
* Transport Independent Application Specific Maximum bandwidth (RFC 3890).
*/
const SDP_BWTYPE_TIAS: string;
/**
* Check if the given `addr` is a multicast address.
* @param nettype a network type
* @param addrtype an address type
* @param addr an address
* @returns TRUE when @addr is multicast.
*/
function sdp_address_is_multicast(nettype: string, addrtype: string, addr: string): boolean;
/**
* Makes key management data
* @param uri a #gchar URI
* @param base64 a #gchar base64-encoded key data
* @returns a #gchar key-mgmt data,
*/
function sdp_make_keymgmt(uri: string, base64: string): string;
/**
* Initialize `media` so that its contents are as if it was freshly allocated
* with gst_sdp_media_new(). This function is mostly used to initialize a media
* allocated on the stack. gst_sdp_media_uninit() undoes this operation.
*
* When this function is invoked on newly allocated data (with malloc or on the
* stack), its contents should be set to 0 before calling this function.
* @returns a #GstSDPResult.
*/
function sdp_media_init(): [SDPResult, SDPMedia];
/**
* Allocate a new GstSDPMedia and store the result in `media`.
* @returns a #GstSDPResult.
*/
function sdp_media_new(): [SDPResult, SDPMedia];
/**
* Mapping of caps to SDP fields:
*
* a=rtpmap:(payload) (encoding_name) or (clock_rate)[or (encoding_params)]
*
* a=framesize:(payload) (width)-(height)
*
* a=fmtp:(payload) (param)[=(value)];...
*
* a=rtcp-fb:(payload) (param1) [param2]...
*
* a=extmap:(id)[/direction] (extensionname) (extensionattributes)
* @param caps a #GstCaps
* @returns a #GstSDPResult.
*/
function sdp_media_set_media_from_caps(caps: Gst.Caps): [SDPResult, SDPMedia];
/**
* Creates a uri from `msg` with the given `scheme`. The uri has the format:
*
* \`scheme:`///[#type=value *[&type=value]]
*
* Where each value is url encoded.
* @param scheme the uri scheme
* @param msg the #GstSDPMessage
* @returns a uri for @msg.
*/
function sdp_message_as_uri(scheme: string, msg: SDPMessage): string;
/**
* Initialize `msg` so that its contents are as if it was freshly allocated
* with gst_sdp_message_new(). This function is mostly used to initialize a message
* allocated on the stack. gst_sdp_message_uninit() undoes this operation.
*
* When this function is invoked on newly allocated data (with malloc or on the
* stack), its contents should be set to 0 before calling this function.
* @returns a #GstSDPResult.
*/
function sdp_message_init(): [SDPResult, SDPMessage];
/**
* Allocate a new GstSDPMessage and store the result in `msg`.
* @returns a #GstSDPResult.
*/
function sdp_message_new(): [SDPResult, SDPMessage];
/**
* Parse `text` and create a new SDPMessage from these.
* @param text A dynamically allocated string representing the SDP description
* @returns a #GstSDPResult.
*/
function sdp_message_new_from_text(text: string): [SDPResult, SDPMessage];
/**
* Parse the contents of `size` bytes pointed to by `data` and store the result in
* `msg`.
* @param data the start of the buffer
* @param msg the result #GstSDPMessage
* @returns #GST_SDP_OK on success.
*/
function sdp_message_parse_buffer(data: Uint8Array | string, msg: SDPMessage): SDPResult;
/**
* Parse the null-terminated `uri` and store the result in `msg`.
*
* The uri should be of the form:
*
* scheme://[address[:ttl=ttl][:noa=noa]]/[sessionname]
* [#type=value *[&type=value]]
*
* where value is url encoded. This looslely resembles
* http://tools.ietf.org/html/draft-fujikawa-sdp-url-01
* @param uri the start of the uri
* @param msg the result #GstSDPMessage
* @returns #GST_SDP_OK on success.
*/
function sdp_message_parse_uri(uri: string, msg: SDPMessage): SDPResult;
abstract class MIKEYDecryptInfo {
static $gtype: GObject.GType<MIKEYDecryptInfo>;
}
abstract class MIKEYEncryptInfo {
static $gtype: GObject.GType<MIKEYEncryptInfo>;
}
/**
* The Security policy Map item for SRTP
*/
class MIKEYMapSRTP {
static $gtype: GObject.GType<MIKEYMapSRTP>;
// Fields
policy: number;
ssrc: number;
roc: number;
// Constructors
constructor(
properties?: Partial<{
policy: number;
ssrc: number;
roc: number;
}>,
);
}
/**
* Structure holding the information of the MIKEY message
*/
class MIKEYMessage {
static $gtype: GObject.GType<MIKEYMessage>;
// Fields
version: number;
type: MIKEYType;
V: boolean;
prf_func: MIKEYPRFFunc;
CSB_id: number;
map_type: MIKEYMapType;
map_info: any[];
payloads: any[];
// Constructors
constructor(
properties?: Partial<{
version: number;
type: MIKEYType;
V: boolean;
prf_func: MIKEYPRFFunc;
CSB_id: number;
map_type: MIKEYMapType;
map_info: any[];
payloads: any[];
}>,
);
static ['new'](): MIKEYMessage;
static new_from_bytes(bytes: GLib.Bytes | Uint8Array, info: MIKEYDecryptInfo): MIKEYMessage;
static new_from_caps(caps: Gst.Caps): MIKEYMessage;
static new_from_data(data: Uint8Array | string, info: MIKEYDecryptInfo): MIKEYMessage;
// Methods
/**
* Add a Crypto policy for SRTP to `msg`.
* @param policy The security policy applied for the stream with @ssrc
* @param ssrc the SSRC that must be used for the stream
* @param roc current rollover counter
* @returns %TRUE on success
*/
add_cs_srtp(policy: number, ssrc: number, roc: number): boolean;
/**
* Add a new payload to `msg`.
* @param payload a #GstMIKEYPayload
* @returns %TRUE on success
*/
add_payload(payload: MIKEYPayload): boolean;
/**
* Add a new PKE payload to `msg` with the given parameters.
* @param C envelope key cache indicator
* @param data the encrypted envelope key
* @returns %TRUE on success
*/
add_pke(C: MIKEYCacheType | null, data: Uint8Array | string): boolean;
/**
* Add a new RAND payload to `msg` with the given parameters.
* @param rand random data
* @returns %TRUE on success
*/
add_rand(rand: Uint8Array | string): boolean;
/**
* Add a new RAND payload to `msg` with `len` random bytes.
* @param len length
* @returns %TRUE on success
*/
add_rand_len(len: number): boolean;
/**
* Add a new T payload to `msg` with the given parameters.
* @param type specifies the timestamp type used
* @param ts_value The timestamp value of the specified @type
* @returns %TRUE on success
*/
add_t(type: MIKEYTSType | null, ts_value: Uint8Array | string): boolean;
/**
* Add a new T payload to `msg` that contains the current time
* in NTP-UTC format.
* @returns %TRUE on success
*/
add_t_now_ntp_utc(): boolean;
base64_encode(): string;
/**
* Find the `nth` occurrence of the payload with `type` in `msg`.
* @param type a #GstMIKEYPayloadType
* @param nth payload to find
* @returns the @nth #GstMIKEYPayload of @type.
*/
find_payload(type: MIKEYPayloadType | null, nth: number): MIKEYPayload | null;
/**
* Get the policy information of `msg` at `idx`.
* @param idx an index
* @returns a #GstMIKEYMapSRTP
*/
get_cs_srtp(idx: number): MIKEYMapSRTP | null;
/**
* Get the number of crypto sessions in `msg`.
* @returns the number of crypto sessions
*/
get_n_cs(): number;
/**
* Get the number of payloads in `msg`.
* @returns the number of payloads in @msg
*/
get_n_payloads(): number;
/**
* Get the #GstMIKEYPayload at `idx` in `msg`
* @param idx an index
* @returns the #GstMIKEYPayload at @idx. The payload remains valid for as long as it is part of @msg.
*/
get_payload(idx: number): MIKEYPayload | null;
/**
* Insert a Crypto Session map for SRTP in `msg` at `idx`
*
* When `idx` is -1, the policy will be appended.
* @param idx the index to insert at
* @param map the map info
* @returns %TRUE on success
*/
insert_cs_srtp(idx: number, map: MIKEYMapSRTP): boolean;
/**
* Insert the `payload` at index `idx` in `msg`. If `idx` is -1, the payload
* will be appended to `msg`.
* @param idx an index
* @param payload a #GstMIKEYPayload
* @returns %TRUE on success
*/
insert_payload(idx: number, payload: MIKEYPayload): boolean;
/**
* Remove the SRTP policy at `idx`.
* @param idx the index to remove
* @returns %TRUE on success
*/
remove_cs_srtp(idx: number): boolean;
/**
* Remove the payload in `msg` at `idx`
* @param idx an index
* @returns %TRUE on success
*/
remove_payload(idx: number): boolean;
/**
* Replace a Crypto Session map for SRTP in `msg` at `idx` with `map`.
* @param idx the index to insert at
* @param map the map info
* @returns %TRUE on success
*/
replace_cs_srtp(idx: number, map: MIKEYMapSRTP): boolean;
/**
* Replace the payload at `idx` in `msg` with `payload`.
* @param idx an index
* @param payload a #GstMIKEYPayload
* @returns %TRUE on success
*/
replace_payload(idx: number, payload: MIKEYPayload): boolean;
/**
* Set the information in `msg`.
* @param version a version
* @param type a #GstMIKEYType
* @param V verify flag
* @param prf_func the #GstMIKEYPRFFunc function to use
* @param CSB_id the Crypto Session Bundle id
* @param map_type the #GstMIKEYMapType
* @returns %TRUE on success
*/
set_info(
version: number,
type: MIKEYType | null,
V: boolean,
prf_func: MIKEYPRFFunc | null,
CSB_id: number,
map_type: MIKEYMapType | null,
): boolean;
/**
* Convert `msg` to a #GBytes.
* @param info a #GstMIKEYEncryptInfo
* @returns a new #GBytes for @msg.
*/
to_bytes(info: MIKEYEncryptInfo): GLib.Bytes;
to_caps(caps: Gst.Caps): boolean;
}
/**
* Hold the common fields for all payloads
*/
class MIKEYPayload {
static $gtype: GObject.GType<MIKEYPayload>;
// Fields
type: MIKEYPayloadType;
len: number;
// Constructors
constructor(type: MIKEYPayloadType);
static ['new'](type: MIKEYPayloadType): MIKEYPayload;
// Methods
/**
* Add a new sub payload to `payload`.
* @param newpay a #GstMIKEYPayload to add
* @returns %TRUE on success.
*/
kemac_add_sub(newpay: MIKEYPayload): boolean;
/**
* Get the number of sub payloads of `payload`. `payload` should be of type
* %GST_MIKEY_PT_KEMAC.
* @returns the number of sub payloads in @payload
*/
kemac_get_n_sub(): number;
/**
* Get the sub payload of `payload` at `idx`. `payload` should be of type
* %GST_MIKEY_PT_KEMAC.
* @param idx an index
* @returns the #GstMIKEYPayload at @idx.
*/
kemac_get_sub(idx: number): MIKEYPayload | null;
/**
* Remove the sub payload at `idx` in `payload`.
* @param idx the index to remove
* @returns %TRUE on success.
*/
kemac_remove_sub(idx: number): boolean;
/**
* Set the KEMAC parameters. `payload` should point to a %GST_MIKEY_PT_KEMAC
* payload.
* @param enc_alg the #GstMIKEYEncAlg
* @param mac_alg a #GstMIKEYMacAlg
* @returns %TRUE on success
*/
kemac_set(enc_alg: MIKEYEncAlg | null, mac_alg: MIKEYMacAlg | null): boolean;
/**
* Set the key validity period in the %GST_MIKEY_PT_KEY_DATA `payload`.
* @param vf_data the Valid From data
* @param vt_data the Valid To data
* @returns %TRUE on success
*/
key_data_set_interval(vf_data: Uint8Array | string, vt_data: Uint8Array | string): boolean;
/**
* Set `key_len` bytes of `key_data` of type `key_type` as the key for the
* %GST_MIKEY_PT_KEY_DATA `payload`.
* @param key_type a #GstMIKEYKeyDataType
* @param key_data the key of type @key_type
* @returns %TRUE on success
*/
key_data_set_key(key_type: MIKEYKeyDataType | null, key_data: Uint8Array | string): boolean;
/**
* Set the salt key data. If `salt_len` is 0 and `salt_data` is %NULL, the
* salt data will be removed.
* @param salt_data the salt
* @returns %TRUE on success
*/
key_data_set_salt(salt_data?: Uint8Array | null): boolean;
/**
* Set the SPI/MKI validity in the %GST_MIKEY_PT_KEY_DATA `payload`.
* @param spi_data the SPI/MKI data
* @returns %TRUE on success
*/
key_data_set_spi(spi_data: Uint8Array | string): boolean;
/**
* Set the PKE values in `payload`. `payload` must be of type
* %GST_MIKEY_PT_PKE.
* @param C envelope key cache indicator
* @param data the encrypted envelope key
* @returns %TRUE on success
*/
pke_set(C: MIKEYCacheType | null, data: Uint8Array | string): boolean;
/**
* Set the random values in a %GST_MIKEY_PT_RAND `payload`.
* @param rand random values
* @returns %TRUE on success
*/
rand_set(rand: Uint8Array | string): boolean;
/**
* Add a new parameter to the %GST_MIKEY_PT_SP `payload` with `type,` `len`
* and `val`.
* @param type a type
* @param val @len bytes of data
* @returns %TRUE on success
*/
sp_add_param(type: number, val: Uint8Array | string): boolean;
/**
* Get the number of security policy parameters in a %GST_MIKEY_PT_SP
* `payload`.
* @returns the number of parameters in @payload
*/
sp_get_n_params(): number;
/**
* Get the Security Policy parameter in a %GST_MIKEY_PT_SP `payload`
* at `idx`.
* @param idx an index
* @returns the #GstMIKEYPayloadSPParam at @idx in @payload
*/
sp_get_param(idx: number): MIKEYPayloadSPParam | null;
/**
* Remove the Security Policy parameters from a %GST_MIKEY_PT_SP
* `payload` at `idx`.
* @param idx an index
* @returns %TRUE on success
*/
sp_remove_param(idx: number): boolean;
/**
* Set the Security Policy parameters for `payload`.
* @param policy the policy number
* @param proto a #GstMIKEYSecProto
* @returns %TRUE on success
*/
sp_set(policy: number, proto: MIKEYSecProto | null): boolean;
/**
* Set the timestamp in a %GST_MIKEY_PT_T `payload`.
* @param type the #GstMIKEYTSType
* @param ts_value the timestamp value
* @returns %TRUE on success
*/
t_set(type: MIKEYTSType | null, ts_value: Uint8Array | string): boolean;
}
/**
* A structure holding the KEMAC payload
*/
class MIKEYPayloadKEMAC {
static $gtype: GObject.GType<MIKEYPayloadKEMAC>;
// Fields
enc_alg: MIKEYEncAlg;
mac_alg: MIKEYMacAlg;
subpayloads: any[];
}
/**
* The Key data payload contains key material. It should be added as sub
* payload to the KEMAC.
*/
class MIKEYPayloadKeyData {
static $gtype: GObject.GType<MIKEYPayloadKeyData>;
// Fields
key_type: MIKEYKeyDataType;
key_len: number;
key_data: number;
salt_len: number;
salt_data: number;
kv_type: MIKEYKVType;
kv_len: Uint8Array;
kv_data: Uint8Array;
}
/**
* The Envelope data payload contains the encrypted envelope key that is
* used in the public-key transport to protect the data in the Key data
* transport payload. The encryption algorithm used is implicit from
* the certificate/public key used.
*/
class MIKEYPayloadPKE {
static $gtype: GObject.GType<MIKEYPayloadPKE>;
// Fields
C: MIKEYCacheType;
data_len: number;
data: number;
}
/**
* The RAND payload consists of a (pseudo-)random bit-string
*/
class MIKEYPayloadRAND {
static $gtype: GObject.GType<MIKEYPayloadRAND>;
// Fields
len: number;
rand: number;
}
/**
* The Security Policy payload defines a set of policies that apply to a
* specific security protocol
*/
class MIKEYPayloadSP {
static $gtype: GObject.GType<MIKEYPayloadSP>;
// Fields
policy: number;
proto: MIKEYSecProto;
params: any[];
}
/**
* A Type/Length/Value field for security parameters
*/
class MIKEYPayloadSPParam {
static $gtype: GObject.GType<MIKEYPayloadSPParam>;
// Fields
type: number;
len: number;
val: number;
// Constructors
constructor(
properties?: Partial<{
type: number;
len: number;
val: number;
}>,
);
}
/**
* The timestamp payload carries the timestamp information
*/
class MIKEYPayloadT {
static $gtype: GObject.GType<MIKEYPayloadT>;
// Fields
type: MIKEYTSType;
ts_value: number;
}
/**
* The contents of the SDP "a=" field which contains a key/value pair.
*/
class SDPAttribute {
static $gtype: GObject.GType<SDPAttribute>;
// Fields
key: string;
value: string;
// Constructors
constructor(
properties?: Partial<{
key: string;
value: string;
}>,
);
// Methods
/**
* Clear the attribute.
* @returns @GST_SDP_OK.
*/
clear(): SDPResult;
/**
* Set the attribute with `key` and `value`.
* @param key the key
* @param value the value
* @returns @GST_SDP_OK.
*/
set(key: string, value?: string | null): SDPResult;
}
/**
* The contents of the SDP "b=" field which specifies the proposed bandwidth to
* be used by the session or media.
*/
class SDPBandwidth {
static $gtype: GObject.GType<SDPBandwidth>;
// Fields
bwtype: string;
bandwidth: number;
// Constructors
constructor(
properties?: Partial<{
bwtype: string;
bandwidth: number;
}>,
);
// Methods
/**
* Reset the bandwidth information in `bw`.
* @returns a #GstSDPResult.
*/