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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
#![cfg_attr(rustfmt, rustfmt_skip)]
// This file is @generated by prost-build.
/// LicenseIdentification is propagated from LicenseRequest to License,
/// incrementing version with each iteration.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LicenseIdentification {
#[prost(bytes = "vec", optional, tag = "1")]
pub request_id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(bytes = "vec", optional, tag = "2")]
pub session_id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(bytes = "vec", optional, tag = "3")]
pub purchase_id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(enumeration = "LicenseType", optional, tag = "4")]
pub r#type: ::core::option::Option<i32>,
#[prost(int32, optional, tag = "5")]
pub version: ::core::option::Option<i32>,
#[prost(bytes = "vec", optional, tag = "6")]
pub provider_session_token: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct License {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<LicenseIdentification>,
#[prost(message, optional, tag = "2")]
pub policy: ::core::option::Option<license::Policy>,
#[prost(message, repeated, tag = "3")]
pub key: ::prost::alloc::vec::Vec<license::KeyContainer>,
/// Time of the request in seconds (UTC) as set in
/// LicenseRequest.request_time. If this time is not set in the request,
/// the local time at the license service is used in this field.
#[prost(int64, optional, tag = "4")]
pub license_start_time: ::core::option::Option<i64>,
#[prost(bool, optional, tag = "5", default = "false")]
pub remote_attestation_verified: ::core::option::Option<bool>,
/// Client token generated by the content provider. Optional.
#[prost(bytes = "vec", optional, tag = "6")]
pub provider_client_token: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// 4cc code specifying the CENC protection scheme as defined in the CENC 3.0
/// specification. Propagated from Widevine PSSH box. Optional.
#[prost(uint32, optional, tag = "7")]
pub protection_scheme: ::core::option::Option<u32>,
/// 8 byte verification field "HDCPDATA" followed by unsigned 32 bit minimum
/// HDCP SRM version (whether the version is for HDCP1 SRM or HDCP2 SRM
/// depends on client max_hdcp_version).
/// Additional details can be found in Widevine Modular DRM Security
/// Integration Guide for CENC.
#[prost(bytes = "vec", optional, tag = "8")]
pub srm_requirement: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// If present this contains a signed SRM file (either HDCP1 SRM or HDCP2 SRM
/// depending on client max_hdcp_version) that should be installed on the
/// client device.
#[prost(bytes = "vec", optional, tag = "9")]
pub srm_update: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Indicates the status of any type of platform verification performed by the
/// server.
#[prost(
enumeration = "PlatformVerificationStatus",
optional,
tag = "10",
default = "PlatformNoVerification"
)]
pub platform_verification_status: ::core::option::Option<i32>,
/// IDs of the groups for which keys are delivered in this license, if any.
#[prost(bytes = "vec", repeated, tag = "11")]
pub group_ids: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
/// Nested message and enum types in `License`.
pub mod license {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Policy {
/// Indicates that playback of the content is allowed.
#[prost(bool, optional, tag = "1", default = "false")]
pub can_play: ::core::option::Option<bool>,
/// Indicates that the license may be persisted to non-volatile
/// storage for offline use.
#[prost(bool, optional, tag = "2", default = "false")]
pub can_persist: ::core::option::Option<bool>,
/// Indicates that renewal of this license is allowed.
#[prost(bool, optional, tag = "3", default = "false")]
pub can_renew: ::core::option::Option<bool>,
/// Indicates the rental window.
#[prost(int64, optional, tag = "4", default = "0")]
pub rental_duration_seconds: ::core::option::Option<i64>,
/// Indicates the viewing window, once playback has begun.
#[prost(int64, optional, tag = "5", default = "0")]
pub playback_duration_seconds: ::core::option::Option<i64>,
/// Indicates the time window for this specific license.
#[prost(int64, optional, tag = "6", default = "0")]
pub license_duration_seconds: ::core::option::Option<i64>,
/// The window of time, in which playback is allowed to continue while
/// renewal is attempted, yet unsuccessful due to backend problems with
/// the license server.
#[prost(int64, optional, tag = "7", default = "0")]
pub renewal_recovery_duration_seconds: ::core::option::Option<i64>,
/// All renewal requests for this license shall be directed to the
/// specified URL.
#[prost(string, optional, tag = "8")]
pub renewal_server_url: ::core::option::Option<::prost::alloc::string::String>,
/// How many seconds after license_start_time, before renewal is first
/// attempted.
#[prost(int64, optional, tag = "9", default = "0")]
pub renewal_delay_seconds: ::core::option::Option<i64>,
/// Specifies the delay in seconds between subsequent license
/// renewal requests, in case of failure.
#[prost(int64, optional, tag = "10", default = "0")]
pub renewal_retry_interval_seconds: ::core::option::Option<i64>,
/// Indicates that the license shall be sent for renewal when usage is
/// started.
#[prost(bool, optional, tag = "11", default = "false")]
pub renew_with_usage: ::core::option::Option<bool>,
/// Indicates to client that license renewal and release requests ought to
/// include ClientIdentification (client_id).
#[prost(bool, optional, tag = "12", default = "false")]
pub always_include_client_id: ::core::option::Option<bool>,
/// Duration of grace period before playback_duration_seconds (short window)
/// goes into effect. Optional.
#[prost(int64, optional, tag = "13", default = "0")]
pub play_start_grace_period_seconds: ::core::option::Option<i64>,
/// Enables "soft enforcement" of playback_duration_seconds, letting the user
/// finish playback even if short window expires. Optional.
#[prost(bool, optional, tag = "14", default = "false")]
pub soft_enforce_playback_duration: ::core::option::Option<bool>,
/// Enables "soft enforcement" of rental_duration_seconds. Initial playback
/// must always start before rental duration expires. In order to allow
/// subsequent playbacks to start after the rental duration expires,
/// soft_enforce_playback_duration must be true. Otherwise, subsequent
/// playbacks will not be allowed once rental duration expires. Optional.
#[prost(bool, optional, tag = "15", default = "true")]
pub soft_enforce_rental_duration: ::core::option::Option<bool>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeyContainer {
#[prost(bytes = "vec", optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(bytes = "vec", optional, tag = "2")]
pub iv: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(bytes = "vec", optional, tag = "3")]
pub key: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(enumeration = "key_container::KeyType", optional, tag = "4")]
pub r#type: ::core::option::Option<i32>,
#[prost(
enumeration = "key_container::SecurityLevel",
optional,
tag = "5",
default = "SwSecureCrypto"
)]
pub level: ::core::option::Option<i32>,
#[prost(message, optional, tag = "6")]
pub required_protection: ::core::option::Option<key_container::OutputProtection>,
/// NOTE: Use of requested_protection is not recommended as it is only
/// supported on a small number of platforms.
#[prost(message, optional, tag = "7")]
pub requested_protection: ::core::option::Option<
key_container::OutputProtection,
>,
#[prost(message, optional, tag = "8")]
pub key_control: ::core::option::Option<key_container::KeyControl>,
#[prost(message, optional, tag = "9")]
pub operator_session_key_permissions: ::core::option::Option<
key_container::OperatorSessionKeyPermissions,
>,
/// Optional video resolution constraints. If the video resolution of the
/// content being decrypted/decoded falls within one of the specified ranges,
/// the optional required_protections may be applied. Otherwise an error will
/// be reported.
/// NOTE: Use of this feature is not recommended, as it is only supported on
/// a small number of platforms.
#[prost(message, repeated, tag = "10")]
pub video_resolution_constraints: ::prost::alloc::vec::Vec<
key_container::VideoResolutionConstraint,
>,
/// Optional flag to indicate the key must only be used if the client
/// supports anti rollback of the user table. Content provider can query the
/// client capabilities to determine if the client support this feature.
#[prost(bool, optional, tag = "11", default = "false")]
pub anti_rollback_usage_table: ::core::option::Option<bool>,
/// Optional not limited to commonly known track types such as SD, HD.
/// It can be some provider defined label to identify the track.
#[prost(string, optional, tag = "12")]
pub track_label: ::core::option::Option<::prost::alloc::string::String>,
}
/// Nested message and enum types in `KeyContainer`.
pub mod key_container {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct KeyControl {
/// |key_control| is documented in:
/// Widevine Modular DRM Security Integration Guide for CENC
/// If present, the key control must be communicated to the secure
/// environment prior to any usage. This message is automatically generated
/// by the Widevine License Server SDK.
#[prost(bytes = "vec", optional, tag = "1")]
pub key_control_block: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(bytes = "vec", optional, tag = "2")]
pub iv: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct OutputProtection {
#[prost(
enumeration = "output_protection::Hdcp",
optional,
tag = "1",
default = "None"
)]
pub hdcp: ::core::option::Option<i32>,
#[prost(
enumeration = "output_protection::Cgms",
optional,
tag = "2",
default = "None"
)]
pub cgms_flags: ::core::option::Option<i32>,
#[prost(
enumeration = "output_protection::HdcpSrmRule",
optional,
tag = "3",
default = "None"
)]
pub hdcp_srm_rule: ::core::option::Option<i32>,
/// Optional requirement to indicate analog output is not allowed.
#[prost(bool, optional, tag = "4", default = "false")]
pub disable_analog_output: ::core::option::Option<bool>,
/// Optional requirement to indicate digital output is not allowed.
#[prost(bool, optional, tag = "5", default = "false")]
pub disable_digital_output: ::core::option::Option<bool>,
}
/// Nested message and enum types in `OutputProtection`.
pub mod output_protection {
/// Indicates whether HDCP is required on digital outputs, and which
/// version should be used.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Hdcp {
None = 0,
V1 = 1,
V2 = 2,
V21 = 3,
V22 = 4,
V23 = 5,
NoDigitalOutput = 255,
}
impl Hdcp {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::None => "HDCP_NONE",
Self::V1 => "HDCP_V1",
Self::V2 => "HDCP_V2",
Self::V21 => "HDCP_V2_1",
Self::V22 => "HDCP_V2_2",
Self::V23 => "HDCP_V2_3",
Self::NoDigitalOutput => "HDCP_NO_DIGITAL_OUTPUT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"HDCP_NONE" => Some(Self::None),
"HDCP_V1" => Some(Self::V1),
"HDCP_V2" => Some(Self::V2),
"HDCP_V2_1" => Some(Self::V21),
"HDCP_V2_2" => Some(Self::V22),
"HDCP_V2_3" => Some(Self::V23),
"HDCP_NO_DIGITAL_OUTPUT" => Some(Self::NoDigitalOutput),
_ => None,
}
}
}
/// Indicate the CGMS setting to be inserted on analog output.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Cgms {
None = 42,
CopyFree = 0,
CopyOnce = 2,
CopyNever = 3,
}
impl Cgms {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::None => "CGMS_NONE",
Self::CopyFree => "COPY_FREE",
Self::CopyOnce => "COPY_ONCE",
Self::CopyNever => "COPY_NEVER",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CGMS_NONE" => Some(Self::None),
"COPY_FREE" => Some(Self::CopyFree),
"COPY_ONCE" => Some(Self::CopyOnce),
"COPY_NEVER" => Some(Self::CopyNever),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum HdcpSrmRule {
None = 0,
/// In 'required_protection', this means most current SRM is required.
/// Update the SRM on the device. If update cannot happen,
/// do not allow the key.
/// In 'requested_protection', this means most current SRM is requested.
/// Update the SRM on the device. If update cannot happen,
/// allow use of the key anyway.
CurrentSrm = 1,
}
impl HdcpSrmRule {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::None => "HDCP_SRM_RULE_NONE",
Self::CurrentSrm => "CURRENT_SRM",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"HDCP_SRM_RULE_NONE" => Some(Self::None),
"CURRENT_SRM" => Some(Self::CurrentSrm),
_ => None,
}
}
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct VideoResolutionConstraint {
/// Minimum and maximum video resolutions in the range (height x width).
#[prost(uint32, optional, tag = "1")]
pub min_resolution_pixels: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "2")]
pub max_resolution_pixels: ::core::option::Option<u32>,
/// Optional output protection requirements for this range. If not
/// specified, the OutputProtection in the KeyContainer applies.
#[prost(message, optional, tag = "3")]
pub required_protection: ::core::option::Option<OutputProtection>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct OperatorSessionKeyPermissions {
/// Permissions/key usage flags for operator service keys
/// (type = OPERATOR_SESSION).
#[prost(bool, optional, tag = "1", default = "false")]
pub allow_encrypt: ::core::option::Option<bool>,
#[prost(bool, optional, tag = "2", default = "false")]
pub allow_decrypt: ::core::option::Option<bool>,
#[prost(bool, optional, tag = "3", default = "false")]
pub allow_sign: ::core::option::Option<bool>,
#[prost(bool, optional, tag = "4", default = "false")]
pub allow_signature_verify: ::core::option::Option<bool>,
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum KeyType {
/// Exactly one key of this type must appear.
Signing = 1,
/// Content key.
Content = 2,
/// Key control block for license renewals. No key.
KeyControl = 3,
/// wrapped keys for auxiliary crypto operations.
OperatorSession = 4,
/// Entitlement keys.
Entitlement = 5,
/// Partner-specific content key.
OemContent = 6,
}
impl KeyType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Signing => "SIGNING",
Self::Content => "CONTENT",
Self::KeyControl => "KEY_CONTROL",
Self::OperatorSession => "OPERATOR_SESSION",
Self::Entitlement => "ENTITLEMENT",
Self::OemContent => "OEM_CONTENT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SIGNING" => Some(Self::Signing),
"CONTENT" => Some(Self::Content),
"KEY_CONTROL" => Some(Self::KeyControl),
"OPERATOR_SESSION" => Some(Self::OperatorSession),
"ENTITLEMENT" => Some(Self::Entitlement),
"OEM_CONTENT" => Some(Self::OemContent),
_ => None,
}
}
}
/// The SecurityLevel enumeration allows the server to communicate the level
/// of robustness required by the client, in order to use the key.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum SecurityLevel {
/// Software-based whitebox crypto is required.
SwSecureCrypto = 1,
/// Software crypto and an obfuscated decoder is required.
SwSecureDecode = 2,
/// The key material and crypto operations must be performed within a
/// hardware backed trusted execution environment.
HwSecureCrypto = 3,
/// The crypto and decoding of content must be performed within a hardware
/// backed trusted execution environment.
HwSecureDecode = 4,
/// The crypto, decoding and all handling of the media (compressed and
/// uncompressed) must be handled within a hardware backed trusted
/// execution environment.
HwSecureAll = 5,
}
impl SecurityLevel {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::SwSecureCrypto => "SW_SECURE_CRYPTO",
Self::SwSecureDecode => "SW_SECURE_DECODE",
Self::HwSecureCrypto => "HW_SECURE_CRYPTO",
Self::HwSecureDecode => "HW_SECURE_DECODE",
Self::HwSecureAll => "HW_SECURE_ALL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SW_SECURE_CRYPTO" => Some(Self::SwSecureCrypto),
"SW_SECURE_DECODE" => Some(Self::SwSecureDecode),
"HW_SECURE_CRYPTO" => Some(Self::HwSecureCrypto),
"HW_SECURE_DECODE" => Some(Self::HwSecureDecode),
"HW_SECURE_ALL" => Some(Self::HwSecureAll),
_ => None,
}
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LicenseRequest {
/// The client_id provides information authenticating the calling device. It
/// contains the Widevine keybox token that was installed on the device at the
/// factory. This field or encrypted_client_id below is required for a valid
/// license request, but both should never be present in the same request.
#[prost(message, optional, tag = "1")]
pub client_id: ::core::option::Option<ClientIdentification>,
#[prost(message, optional, tag = "2")]
pub content_id: ::core::option::Option<license_request::ContentIdentification>,
#[prost(enumeration = "license_request::RequestType", optional, tag = "3")]
pub r#type: ::core::option::Option<i32>,
/// Time of the request in seconds (UTC) as set by the client.
#[prost(int64, optional, tag = "4")]
pub request_time: ::core::option::Option<i64>,
/// Old-style decimal-encoded string key control nonce.
#[prost(bytes = "vec", optional, tag = "5")]
pub key_control_nonce_deprecated: ::core::option::Option<
::prost::alloc::vec::Vec<u8>,
>,
#[prost(enumeration = "ProtocolVersion", optional, tag = "6", default = "Version20")]
pub protocol_version: ::core::option::Option<i32>,
/// New-style uint32 key control nonce, please use instead of
/// key_control_nonce_deprecated.
#[prost(uint32, optional, tag = "7")]
pub key_control_nonce: ::core::option::Option<u32>,
/// Encrypted ClientIdentification message, used for privacy purposes.
#[prost(message, optional, tag = "8")]
pub encrypted_client_id: ::core::option::Option<EncryptedClientIdentification>,
}
/// Nested message and enum types in `LicenseRequest`.
pub mod license_request {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ContentIdentification {
#[prost(oneof = "content_identification::ContentIdVariant", tags = "1, 2, 3, 4")]
pub content_id_variant: ::core::option::Option<
content_identification::ContentIdVariant,
>,
}
/// Nested message and enum types in `ContentIdentification`.
pub mod content_identification {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WidevinePsshData {
#[prost(bytes = "vec", repeated, tag = "1")]
pub pssh_data: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
#[prost(enumeration = "super::super::LicenseType", optional, tag = "2")]
pub license_type: ::core::option::Option<i32>,
/// Opaque, client-specified.
#[prost(bytes = "vec", optional, tag = "3")]
pub request_id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WebmKeyId {
#[prost(bytes = "vec", optional, tag = "1")]
pub header: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(enumeration = "super::super::LicenseType", optional, tag = "2")]
pub license_type: ::core::option::Option<i32>,
/// Opaque, client-specified.
#[prost(bytes = "vec", optional, tag = "3")]
pub request_id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExistingLicense {
#[prost(message, optional, tag = "1")]
pub license_id: ::core::option::Option<super::super::LicenseIdentification>,
#[prost(int64, optional, tag = "2")]
pub seconds_since_started: ::core::option::Option<i64>,
#[prost(int64, optional, tag = "3")]
pub seconds_since_last_played: ::core::option::Option<i64>,
#[prost(bytes = "vec", optional, tag = "4")]
pub session_usage_table_entry: ::core::option::Option<
::prost::alloc::vec::Vec<u8>,
>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InitData {
#[prost(
enumeration = "init_data::InitDataType",
optional,
tag = "1",
default = "Cenc"
)]
pub init_data_type: ::core::option::Option<i32>,
#[prost(bytes = "vec", optional, tag = "2")]
pub init_data: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(enumeration = "super::super::LicenseType", optional, tag = "3")]
pub license_type: ::core::option::Option<i32>,
#[prost(bytes = "vec", optional, tag = "4")]
pub request_id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
/// Nested message and enum types in `InitData`.
pub mod init_data {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum InitDataType {
Cenc = 1,
Webm = 2,
}
impl InitDataType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Cenc => "CENC",
Self::Webm => "WEBM",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CENC" => Some(Self::Cenc),
"WEBM" => Some(Self::Webm),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum ContentIdVariant {
/// Exactly one of these must be present.
#[prost(message, tag = "1")]
WidevinePsshData(WidevinePsshData),
#[prost(message, tag = "2")]
WebmKeyId(WebmKeyId),
#[prost(message, tag = "3")]
ExistingLicense(ExistingLicense),
#[prost(message, tag = "4")]
InitData(InitData),
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum RequestType {
New = 1,
Renewal = 2,
Release = 3,
}
impl RequestType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::New => "NEW",
Self::Renewal => "RENEWAL",
Self::Release => "RELEASE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NEW" => Some(Self::New),
"RENEWAL" => Some(Self::Renewal),
"RELEASE" => Some(Self::Release),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetricData {
/// 'stage' that is currently processing the SignedMessage. Required.
#[prost(string, optional, tag = "1")]
pub stage_name: ::core::option::Option<::prost::alloc::string::String>,
/// metric and associated value.
#[prost(message, repeated, tag = "2")]
pub metric_data: ::prost::alloc::vec::Vec<metric_data::TypeValue>,
}
/// Nested message and enum types in `MetricData`.
pub mod metric_data {
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TypeValue {
#[prost(enumeration = "MetricType", optional, tag = "1")]
pub r#type: ::core::option::Option<i32>,
/// The value associated with 'type'. For example if type == LATENCY, the
/// value would be the time in microseconds spent in this 'stage'.
#[prost(int64, optional, tag = "2", default = "0")]
pub value: ::core::option::Option<i64>,
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum MetricType {
/// The time spent in the 'stage', specified in microseconds.
Latency = 1,
/// The UNIX epoch timestamp at which the 'stage' was first accessed in
/// microseconds.
Timestamp = 2,
}
impl MetricType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Latency => "LATENCY",
Self::Timestamp => "TIMESTAMP",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LATENCY" => Some(Self::Latency),
"TIMESTAMP" => Some(Self::Timestamp),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct VersionInfo {
/// License SDK version reported by the Widevine License SDK. This field
/// is populated automatically by the SDK.
#[prost(string, optional, tag = "1")]
pub license_sdk_version: ::core::option::Option<::prost::alloc::string::String>,
/// Version of the service hosting the license SDK. This field is optional.
/// It may be provided by the hosting service.
#[prost(string, optional, tag = "2")]
pub license_service_version: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SignedMessage {
#[prost(enumeration = "signed_message::MessageType", optional, tag = "1")]
pub r#type: ::core::option::Option<i32>,
#[prost(bytes = "vec", optional, tag = "2")]
pub msg: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Required field that contains the signature of the bytes of msg.
/// For license requests, the signing algorithm is determined by the
/// certificate contained in the request.
/// For license responses, the signing algorithm is HMAC with signing key based
/// on |session_key|.
#[prost(bytes = "vec", optional, tag = "3")]
pub signature: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// If populated, the contents of this field will be signaled by the
/// |session_key_type| type. If the |session_key_type| is WRAPPED_AES_KEY the
/// key is the bytes of an encrypted AES key. If the |session_key_type| is
/// EPHERMERAL_ECC_PUBLIC_KEY the field contains the bytes of an RFC5208 ASN1
/// serialized ECC public key.
#[prost(bytes = "vec", optional, tag = "4")]
pub session_key: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Remote attestation data which will be present in the initial license
/// request for ChromeOS client devices operating in verified mode. Remote
/// attestation challenge data is |msg| field above. Optional.
#[prost(bytes = "vec", optional, tag = "5")]
pub remote_attestation: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(message, repeated, tag = "6")]
pub metric_data: ::prost::alloc::vec::Vec<MetricData>,
/// Version information from the SDK and license service. This information is
/// provided in the license response.
#[prost(message, optional, tag = "7")]
pub service_version_info: ::core::option::Option<VersionInfo>,
/// Optional field that contains the algorithm type used to generate the
/// session_key and signature in a LICENSE message.
#[prost(
enumeration = "signed_message::SessionKeyType",
optional,
tag = "8",
default = "WrappedAesKey"
)]
pub session_key_type: ::core::option::Option<i32>,
/// The core message is the simple serialization of fields used by OEMCrypto.
/// This field was introduced in OEMCrypto API v16.
#[prost(bytes = "vec", optional, tag = "9")]
pub oemcrypto_core_message: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
/// Nested message and enum types in `SignedMessage`.
pub mod signed_message {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum MessageType {
LicenseRequest = 1,
License = 2,
ErrorResponse = 3,
ServiceCertificateRequest = 4,
ServiceCertificate = 5,
SubLicense = 6,
CasLicenseRequest = 7,
CasLicense = 8,
ExternalLicenseRequest = 9,
ExternalLicense = 10,
}
impl MessageType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::LicenseRequest => "LICENSE_REQUEST",
Self::License => "LICENSE",
Self::ErrorResponse => "ERROR_RESPONSE",
Self::ServiceCertificateRequest => "SERVICE_CERTIFICATE_REQUEST",
Self::ServiceCertificate => "SERVICE_CERTIFICATE",
Self::SubLicense => "SUB_LICENSE",
Self::CasLicenseRequest => "CAS_LICENSE_REQUEST",
Self::CasLicense => "CAS_LICENSE",
Self::ExternalLicenseRequest => "EXTERNAL_LICENSE_REQUEST",
Self::ExternalLicense => "EXTERNAL_LICENSE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LICENSE_REQUEST" => Some(Self::LicenseRequest),
"LICENSE" => Some(Self::License),
"ERROR_RESPONSE" => Some(Self::ErrorResponse),
"SERVICE_CERTIFICATE_REQUEST" => Some(Self::ServiceCertificateRequest),
"SERVICE_CERTIFICATE" => Some(Self::ServiceCertificate),
"SUB_LICENSE" => Some(Self::SubLicense),
"CAS_LICENSE_REQUEST" => Some(Self::CasLicenseRequest),
"CAS_LICENSE" => Some(Self::CasLicense),
"EXTERNAL_LICENSE_REQUEST" => Some(Self::ExternalLicenseRequest),
"EXTERNAL_LICENSE" => Some(Self::ExternalLicense),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum SessionKeyType {
Undefined = 0,
WrappedAesKey = 1,
EphermeralEccPublicKey = 2,
}
impl SessionKeyType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Undefined => "UNDEFINED",
Self::WrappedAesKey => "WRAPPED_AES_KEY",
Self::EphermeralEccPublicKey => "EPHERMERAL_ECC_PUBLIC_KEY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNDEFINED" => Some(Self::Undefined),
"WRAPPED_AES_KEY" => Some(Self::WrappedAesKey),
"EPHERMERAL_ECC_PUBLIC_KEY" => Some(Self::EphermeralEccPublicKey),
_ => None,
}
}
}
}
/// ClientIdentification message used to authenticate the client device.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientIdentification {
/// Type of factory-provisioned device root of trust. Optional.
#[prost(
enumeration = "client_identification::TokenType",
optional,
tag = "1",
default = "Keybox"
)]
pub r#type: ::core::option::Option<i32>,
/// Factory-provisioned device root of trust. Required.
#[prost(bytes = "vec", optional, tag = "2")]
pub token: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Optional client information name/value pairs.
#[prost(message, repeated, tag = "3")]
pub client_info: ::prost::alloc::vec::Vec<client_identification::NameValue>,
/// Client token generated by the content provider. Optional.
#[prost(bytes = "vec", optional, tag = "4")]
pub provider_client_token: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Number of licenses received by the client to which the token above belongs.
/// Only present if client_token is specified.
#[prost(uint32, optional, tag = "5")]
pub license_counter: ::core::option::Option<u32>,
/// List of non-baseline client capabilities.
#[prost(message, optional, tag = "6")]
pub client_capabilities: ::core::option::Option<
client_identification::ClientCapabilities,
>,
/// Serialized VmpData message. Optional.
#[prost(bytes = "vec", optional, tag = "7")]
pub vmp_data: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Optional field that may contain additional provisioning credentials.
#[prost(message, repeated, tag = "8")]
pub device_credentials: ::prost::alloc::vec::Vec<
client_identification::ClientCredentials,
>,
}
/// Nested message and enum types in `ClientIdentification`.
pub mod client_identification {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NameValue {
#[prost(string, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub value: ::core::option::Option<::prost::alloc::string::String>,
}
/// Capabilities which not all clients may support. Used for the license
/// exchange protocol only.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ClientCapabilities {
#[prost(bool, optional, tag = "1", default = "false")]
pub client_token: ::core::option::Option<bool>,
#[prost(bool, optional, tag = "2", default = "false")]
pub session_token: ::core::option::Option<bool>,
#[prost(bool, optional, tag = "3", default = "false")]
pub video_resolution_constraints: ::core::option::Option<bool>,
#[prost(
enumeration = "client_capabilities::HdcpVersion",
optional,
tag = "4",
default = "HdcpNone"
)]
pub max_hdcp_version: ::core::option::Option<i32>,
#[prost(uint32, optional, tag = "5")]
pub oem_crypto_api_version: ::core::option::Option<u32>,
/// Client has hardware support for protecting the usage table, such as
/// storing the generation number in secure memory. For Details, see:
/// Widevine Modular DRM Security Integration Guide for CENC
#[prost(bool, optional, tag = "6", default = "false")]
pub anti_rollback_usage_table: ::core::option::Option<bool>,
/// The client shall report |srm_version| if available.
#[prost(uint32, optional, tag = "7")]
pub srm_version: ::core::option::Option<u32>,
/// A device may have SRM data, and report a version, but may not be capable
/// of updating SRM data.
#[prost(bool, optional, tag = "8", default = "false")]
pub can_update_srm: ::core::option::Option<bool>,
#[prost(
enumeration = "client_capabilities::CertificateKeyType",
repeated,
packed = "false",
tag = "9"
)]
pub supported_certificate_key_type: ::prost::alloc::vec::Vec<i32>,
#[prost(
enumeration = "client_capabilities::AnalogOutputCapabilities",
optional,
tag = "10",
default = "AnalogOutputUnknown"
)]
pub analog_output_capabilities: ::core::option::Option<i32>,
#[prost(bool, optional, tag = "11", default = "false")]
pub can_disable_analog_output: ::core::option::Option<bool>,
/// Clients can indicate a performance level supported by OEMCrypto.
/// This will allow applications and providers to choose an appropriate
/// quality of content to serve. Currently defined tiers are
/// 1 (low), 2 (medium) and 3 (high). Any other value indicates that
/// the resource rating is unavailable or reporting erroneous values
/// for that device. For details see,
/// Widevine Modular DRM Security Integration Guide for CENC
#[prost(uint32, optional, tag = "12", default = "0")]
pub resource_rating_tier: ::core::option::Option<u32>,
}
/// Nested message and enum types in `ClientCapabilities`.
pub mod client_capabilities {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum HdcpVersion {
HdcpNone = 0,
HdcpV1 = 1,
HdcpV2 = 2,
HdcpV21 = 3,
HdcpV22 = 4,
HdcpV23 = 5,
HdcpNoDigitalOutput = 255,
}
impl HdcpVersion {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::HdcpNone => "HDCP_NONE",
Self::HdcpV1 => "HDCP_V1",
Self::HdcpV2 => "HDCP_V2",
Self::HdcpV21 => "HDCP_V2_1",
Self::HdcpV22 => "HDCP_V2_2",
Self::HdcpV23 => "HDCP_V2_3",
Self::HdcpNoDigitalOutput => "HDCP_NO_DIGITAL_OUTPUT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"HDCP_NONE" => Some(Self::HdcpNone),
"HDCP_V1" => Some(Self::HdcpV1),
"HDCP_V2" => Some(Self::HdcpV2),
"HDCP_V2_1" => Some(Self::HdcpV21),
"HDCP_V2_2" => Some(Self::HdcpV22),
"HDCP_V2_3" => Some(Self::HdcpV23),
"HDCP_NO_DIGITAL_OUTPUT" => Some(Self::HdcpNoDigitalOutput),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CertificateKeyType {
Rsa2048 = 0,
Rsa3072 = 1,
EccSecp256r1 = 2,
EccSecp384r1 = 3,
EccSecp521r1 = 4,
}
impl CertificateKeyType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Rsa2048 => "RSA_2048",
Self::Rsa3072 => "RSA_3072",
Self::EccSecp256r1 => "ECC_SECP256R1",
Self::EccSecp384r1 => "ECC_SECP384R1",
Self::EccSecp521r1 => "ECC_SECP521R1",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RSA_2048" => Some(Self::Rsa2048),
"RSA_3072" => Some(Self::Rsa3072),
"ECC_SECP256R1" => Some(Self::EccSecp256r1),
"ECC_SECP384R1" => Some(Self::EccSecp384r1),
"ECC_SECP521R1" => Some(Self::EccSecp521r1),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum AnalogOutputCapabilities {
AnalogOutputUnknown = 0,
AnalogOutputNone = 1,
AnalogOutputSupported = 2,
AnalogOutputSupportsCgmsA = 3,
}
impl AnalogOutputCapabilities {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::AnalogOutputUnknown => "ANALOG_OUTPUT_UNKNOWN",
Self::AnalogOutputNone => "ANALOG_OUTPUT_NONE",
Self::AnalogOutputSupported => "ANALOG_OUTPUT_SUPPORTED",
Self::AnalogOutputSupportsCgmsA => "ANALOG_OUTPUT_SUPPORTS_CGMS_A",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ANALOG_OUTPUT_UNKNOWN" => Some(Self::AnalogOutputUnknown),
"ANALOG_OUTPUT_NONE" => Some(Self::AnalogOutputNone),
"ANALOG_OUTPUT_SUPPORTED" => Some(Self::AnalogOutputSupported),
"ANALOG_OUTPUT_SUPPORTS_CGMS_A" => {
Some(Self::AnalogOutputSupportsCgmsA)
}
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ClientCredentials {
#[prost(enumeration = "TokenType", optional, tag = "1", default = "Keybox")]
pub r#type: ::core::option::Option<i32>,
#[prost(bytes = "vec", optional, tag = "2")]
pub token: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TokenType {
Keybox = 0,
DrmDeviceCertificate = 1,
RemoteAttestationCertificate = 2,
OemDeviceCertificate = 3,
}
impl TokenType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Keybox => "KEYBOX",
Self::DrmDeviceCertificate => "DRM_DEVICE_CERTIFICATE",
Self::RemoteAttestationCertificate => "REMOTE_ATTESTATION_CERTIFICATE",
Self::OemDeviceCertificate => "OEM_DEVICE_CERTIFICATE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"KEYBOX" => Some(Self::Keybox),
"DRM_DEVICE_CERTIFICATE" => Some(Self::DrmDeviceCertificate),
"REMOTE_ATTESTATION_CERTIFICATE" => {
Some(Self::RemoteAttestationCertificate)
}
"OEM_DEVICE_CERTIFICATE" => Some(Self::OemDeviceCertificate),
_ => None,
}
}
}
}
/// EncryptedClientIdentification message used to hold ClientIdentification
/// messages encrypted for privacy purposes.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EncryptedClientIdentification {
/// Provider ID for which the ClientIdentifcation is encrypted (owner of
/// service certificate).
#[prost(string, optional, tag = "1")]
pub provider_id: ::core::option::Option<::prost::alloc::string::String>,
/// Serial number for the service certificate for which ClientIdentification is
/// encrypted.
#[prost(bytes = "vec", optional, tag = "2")]
pub service_certificate_serial_number: ::core::option::Option<
::prost::alloc::vec::Vec<u8>,
>,
/// Serialized ClientIdentification message, encrypted with the privacy key
/// using AES-128-CBC with PKCS#5 padding.
#[prost(bytes = "vec", optional, tag = "3")]
pub encrypted_client_id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Initialization vector needed to decrypt encrypted_client_id.
#[prost(bytes = "vec", optional, tag = "4")]
pub encrypted_client_id_iv: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// AES-128 privacy key, encrypted with the service public key using RSA-OAEP.
#[prost(bytes = "vec", optional, tag = "5")]
pub encrypted_privacy_key: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
/// DRM certificate definition for user devices, intermediate, service, and root
/// certificates.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DrmCertificate {
/// Type of certificate. Required.
#[prost(enumeration = "drm_certificate::Type", optional, tag = "1")]
pub r#type: ::core::option::Option<i32>,
/// 128-bit globally unique serial number of certificate.
/// Value is 0 for root certificate. Required.
#[prost(bytes = "vec", optional, tag = "2")]
pub serial_number: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// POSIX time, in seconds, when the certificate was created. Required.
#[prost(uint32, optional, tag = "3")]
pub creation_time_seconds: ::core::option::Option<u32>,
/// POSIX time, in seconds, when the certificate should expire. Value of zero
/// denotes indefinite expiry time. For more information on limited lifespan
/// DRM certificates see (go/limited-lifespan-drm-certificates).
#[prost(uint32, optional, tag = "12")]
pub expiration_time_seconds: ::core::option::Option<u32>,
/// Device public key. PKCS#1 ASN.1 DER-encoded. Required.
#[prost(bytes = "vec", optional, tag = "4")]
pub public_key: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Widevine system ID for the device. Required for intermediate and
/// user device certificates.
#[prost(uint32, optional, tag = "5")]
pub system_id: ::core::option::Option<u32>,
/// Deprecated field, which used to indicate whether the device was a test
/// (non-production) device. The test_device field in ProvisionedDeviceInfo
/// below should be observed instead.
#[deprecated]
#[prost(bool, optional, tag = "6")]
pub test_device_deprecated: ::core::option::Option<bool>,
/// Service identifier (web origin) for the provider which owns the
/// certificate. Required for service and provisioner certificates.
#[prost(string, optional, tag = "7")]
pub provider_id: ::core::option::Option<::prost::alloc::string::String>,
/// This field is used only when type = SERVICE to specify which SDK uses
/// service certificate. This repeated field is treated as a set. A certificate
/// may be used for the specified service SDK if the appropriate ServiceType
/// is specified in this field.
#[prost(
enumeration = "drm_certificate::ServiceType",
repeated,
packed = "false",
tag = "8"
)]
pub service_types: ::prost::alloc::vec::Vec<i32>,
/// Required. The algorithm field contains the curve used to create the
/// |public_key| if algorithm is one of the ECC types.
/// The |algorithm| is used for both to determine the if the certificate is ECC
/// or RSA. The |algorithm| also specifies the parameters that were used to
/// create |public_key| and are used to create an ephemeral session key.
#[prost(
enumeration = "drm_certificate::Algorithm",
optional,
tag = "9",
default = "Rsa"
)]
pub algorithm: ::core::option::Option<i32>,
/// Optional. May be present in DEVICE certificate types. This is the root
/// of trust identifier that holds an encrypted value that identifies the
/// keybox or other root of trust that was used to provision a DEVICE drm
/// certificate.
#[prost(bytes = "vec", optional, tag = "10")]
pub rot_id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Optional. May be present in devices that explicitly support dual keys. When
/// present the |public_key| is used for verification of received license
/// request messages.
#[prost(message, optional, tag = "11")]
pub encryption_key: ::core::option::Option<drm_certificate::EncryptionKey>,
}
/// Nested message and enum types in `DrmCertificate`.
pub mod drm_certificate {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EncryptionKey {
/// Device public key. PKCS#1 ASN.1 DER-encoded. Required.
#[prost(bytes = "vec", optional, tag = "1")]
pub public_key: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Required. The algorithm field contains the curve used to create the
/// |public_key| if algorithm is one of the ECC types.
/// The |algorithm| is used for both to determine the if the certificate is
/// ECC or RSA. The |algorithm| also specifies the parameters that were used
/// to create |public_key| and are used to create an ephemeral session key.
#[prost(enumeration = "Algorithm", optional, tag = "2", default = "Rsa")]
pub algorithm: ::core::option::Option<i32>,
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
/// ProtoBestPractices: ignore.
Root = 0,
DeviceModel = 1,
Device = 2,
Service = 3,
Provisioner = 4,
}
impl Type {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Root => "ROOT",
Self::DeviceModel => "DEVICE_MODEL",
Self::Device => "DEVICE",
Self::Service => "SERVICE",
Self::Provisioner => "PROVISIONER",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ROOT" => Some(Self::Root),
"DEVICE_MODEL" => Some(Self::DeviceModel),
"DEVICE" => Some(Self::Device),
"SERVICE" => Some(Self::Service),
"PROVISIONER" => Some(Self::Provisioner),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ServiceType {
UnknownServiceType = 0,
LicenseServerSdk = 1,
LicenseServerProxySdk = 2,
ProvisioningSdk = 3,
CasProxySdk = 4,
}
impl ServiceType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::UnknownServiceType => "UNKNOWN_SERVICE_TYPE",
Self::LicenseServerSdk => "LICENSE_SERVER_SDK",
Self::LicenseServerProxySdk => "LICENSE_SERVER_PROXY_SDK",
Self::ProvisioningSdk => "PROVISIONING_SDK",
Self::CasProxySdk => "CAS_PROXY_SDK",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN_SERVICE_TYPE" => Some(Self::UnknownServiceType),
"LICENSE_SERVER_SDK" => Some(Self::LicenseServerSdk),
"LICENSE_SERVER_PROXY_SDK" => Some(Self::LicenseServerProxySdk),
"PROVISIONING_SDK" => Some(Self::ProvisioningSdk),
"CAS_PROXY_SDK" => Some(Self::CasProxySdk),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Algorithm {
UnknownAlgorithm = 0,
Rsa = 1,
EccSecp256r1 = 2,
EccSecp384r1 = 3,
EccSecp521r1 = 4,
}
impl Algorithm {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::UnknownAlgorithm => "UNKNOWN_ALGORITHM",
Self::Rsa => "RSA",
Self::EccSecp256r1 => "ECC_SECP256R1",
Self::EccSecp384r1 => "ECC_SECP384R1",
Self::EccSecp521r1 => "ECC_SECP521R1",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN_ALGORITHM" => Some(Self::UnknownAlgorithm),
"RSA" => Some(Self::Rsa),
"ECC_SECP256R1" => Some(Self::EccSecp256r1),
"ECC_SECP384R1" => Some(Self::EccSecp384r1),
"ECC_SECP521R1" => Some(Self::EccSecp521r1),
_ => None,
}
}
}
}
/// DrmCertificate signed by a higher (CA) DRM certificate.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SignedDrmCertificate {
/// Serialized certificate. Required.
#[prost(bytes = "vec", optional, tag = "1")]
pub drm_certificate: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Signature of certificate. Signed with root or intermediate
/// certificate specified below. Required.
#[prost(bytes = "vec", optional, tag = "2")]
pub signature: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// SignedDrmCertificate used to sign this certificate.
#[prost(message, optional, boxed, tag = "3")]
pub signer: ::core::option::Option<::prost::alloc::boxed::Box<SignedDrmCertificate>>,
/// Optional field that indicates the hash algorithm used in signature scheme.
#[prost(enumeration = "HashAlgorithmProto", optional, tag = "4")]
pub hash_algorithm: ::core::option::Option<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WidevinePsshData {
/// Entitlement or content key IDs. Can onnly present in SINGLE or ENTITLEMENT
/// PSSHs. May be repeated to facilitate delivery of multiple keys in a
/// single license. Cannot be used in conjunction with content_id or
/// group_ids, which are the preferred mechanism.
#[prost(bytes = "vec", repeated, tag = "2")]
pub key_ids: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
/// Content identifier which may map to multiple entitlement or content key
/// IDs to facilitate the delivery of multiple keys in a single license.
/// Cannot be present in conjunction with key_ids, but if used must be in all
/// PSSHs.
#[prost(bytes = "vec", optional, tag = "4")]
pub content_id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Crypto period index, for media using key rotation. Always corresponds to
/// The content key period. This means that if using entitlement licensing
/// the ENTITLED_KEY PSSHs will have sequential crypto_period_index's, whereas
/// the ENTITELEMENT PSSHs will have gaps in the sequence. Required if doing
/// key rotation.
#[prost(uint32, optional, tag = "7")]
pub crypto_period_index: ::core::option::Option<u32>,
/// Protection scheme identifying the encryption algorithm. The protection
/// scheme is represented as a uint32 value. The uint32 contains 4 bytes each
/// representing a single ascii character in one of the 4CC protection scheme
/// values. To be deprecated in favor of signaling from content.
/// 'cenc' (AES-CTR) protection_scheme = 0x63656E63,
/// 'cbc1' (AES-CBC) protection_scheme = 0x63626331,
/// 'cens' (AES-CTR pattern encryption) protection_scheme = 0x63656E73,
/// 'cbcs' (AES-CBC pattern encryption) protection_scheme = 0x63626373.
#[prost(uint32, optional, tag = "9")]
pub protection_scheme: ::core::option::Option<u32>,
/// Optional. For media using key rotation, this represents the duration
/// of each crypto period in seconds.
#[prost(uint32, optional, tag = "10")]
pub crypto_period_seconds: ::core::option::Option<u32>,
/// Type of PSSH. Required if not SINGLE.
#[prost(
enumeration = "widevine_pssh_data::Type",
optional,
tag = "11",
default = "Single"
)]
pub r#type: ::core::option::Option<i32>,
/// Key sequence for Widevine-managed keys. Optional.
#[prost(uint32, optional, tag = "12")]
pub key_sequence: ::core::option::Option<u32>,
/// Group identifiers for all groups to which the content belongs. This can
/// be used to deliver licenses to unlock multiple titles / channels.
/// Optional, and may only be present in ENTITLEMENT and ENTITLED_KEY PSSHs, and
/// not in conjunction with key_ids.
#[prost(bytes = "vec", repeated, tag = "13")]
pub group_ids: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
/// Copy/copies of the content key used to decrypt the media stream in which
/// the PSSH box is embedded, each wrapped with a different entitlement key.
/// May also contain sub-licenses to support devices with OEMCrypto 13 or
/// older. May be repeated if using group entitlement keys. Present only in
/// PSSHs of type ENTITLED_KEY.
#[prost(message, repeated, tag = "14")]
pub entitled_keys: ::prost::alloc::vec::Vec<widevine_pssh_data::EntitledKey>,
/// Video feature identifier, which is used in conjunction with |content_id|
/// to determine the set of keys to be returned in the license. Cannot be
/// present in conjunction with |key_ids|.
/// Current values are "HDR".
#[prost(string, optional, tag = "15")]
pub video_feature: ::core::option::Option<::prost::alloc::string::String>,
#[deprecated]
#[prost(enumeration = "widevine_pssh_data::Algorithm", optional, tag = "1")]
pub algorithm: ::core::option::Option<i32>,
/// Content provider name.
#[deprecated]
#[prost(string, optional, tag = "3")]
pub provider: ::core::option::Option<::prost::alloc::string::String>,
/// Track type. Acceptable values are SD, HD and AUDIO. Used to
/// differentiate content keys used by an asset.
#[deprecated]
#[prost(string, optional, tag = "5")]
pub track_type: ::core::option::Option<::prost::alloc::string::String>,
/// The name of a registered policy to be used for this asset.
#[deprecated]
#[prost(string, optional, tag = "6")]
pub policy: ::core::option::Option<::prost::alloc::string::String>,
/// Optional protected context for group content. The grouped_license is a
/// serialized SignedMessage.
#[deprecated]
#[prost(bytes = "vec", optional, tag = "8")]
pub grouped_license: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
/// Nested message and enum types in `WidevinePsshData`.
pub mod widevine_pssh_data {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EntitledKey {
/// ID of entitlement key used for wrapping |key|.
#[prost(bytes = "vec", optional, tag = "1")]
pub entitlement_key_id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// ID of the entitled key.
#[prost(bytes = "vec", optional, tag = "2")]
pub key_id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Wrapped key. Required.
#[prost(bytes = "vec", optional, tag = "3")]
pub key: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// IV used for wrapping |key|. Required.
#[prost(bytes = "vec", optional, tag = "4")]
pub iv: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Size of entitlement key used for wrapping |key|.
#[prost(uint32, optional, tag = "5", default = "32")]
pub entitlement_key_size_bytes: ::core::option::Option<u32>,
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
/// Single PSSH to be used to retrieve content keys.
Single = 0,
/// Primary PSSH used to retrieve entitlement keys.
Entitlement = 1,
/// Secondary PSSH containing entitled key(s).
EntitledKey = 2,
}
impl Type {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Single => "SINGLE",
Self::Entitlement => "ENTITLEMENT",
Self::EntitledKey => "ENTITLED_KEY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SINGLE" => Some(Self::Single),
"ENTITLEMENT" => Some(Self::Entitlement),
"ENTITLED_KEY" => Some(Self::EntitledKey),
_ => None,
}
}
}
/// ////////////////////////// Deprecated Fields ////////////////////////////
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Algorithm {
Unencrypted = 0,
Aesctr = 1,
}
impl Algorithm {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unencrypted => "UNENCRYPTED",
Self::Aesctr => "AESCTR",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNENCRYPTED" => Some(Self::Unencrypted),
"AESCTR" => Some(Self::Aesctr),
_ => None,
}
}
}
}
/// File Hashes for Verified Media Path (VMP) support.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileHashes {
#[prost(bytes = "vec", optional, tag = "1")]
pub signer: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(message, repeated, tag = "2")]
pub signatures: ::prost::alloc::vec::Vec<file_hashes::Signature>,
}
/// Nested message and enum types in `FileHashes`.
pub mod file_hashes {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Signature {
#[prost(string, optional, tag = "1")]
pub filename: ::core::option::Option<::prost::alloc::string::String>,
/// 0 - release, 1 - testing
#[prost(bool, optional, tag = "2")]
pub test_signing: ::core::option::Option<bool>,
#[prost(bytes = "vec", optional, tag = "3")]
pub sha512_hash: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// 0 for dlls, 1 for exe, this is field 3 in file
#[prost(bool, optional, tag = "4")]
pub main_exe: ::core::option::Option<bool>,
#[prost(bytes = "vec", optional, tag = "5")]
pub signature: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LicenseType {
Streaming = 1,
Offline = 2,
/// License type decision is left to provider.
Automatic = 3,
}
impl LicenseType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Streaming => "STREAMING",
Self::Offline => "OFFLINE",
Self::Automatic => "AUTOMATIC",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STREAMING" => Some(Self::Streaming),
"OFFLINE" => Some(Self::Offline),
"AUTOMATIC" => Some(Self::Automatic),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PlatformVerificationStatus {
/// The platform is not verified.
PlatformUnverified = 0,
/// Tampering detected on the platform.
PlatformTampered = 1,
/// The platform has been verified by means of software.
PlatformSoftwareVerified = 2,
/// The platform has been verified by means of hardware (e.g. secure boot).
PlatformHardwareVerified = 3,
/// Platform verification was not performed.
PlatformNoVerification = 4,
/// Platform and secure storage capability have been verified by means of
/// software.
PlatformSecureStorageSoftwareVerified = 5,
}
impl PlatformVerificationStatus {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::PlatformUnverified => "PLATFORM_UNVERIFIED",
Self::PlatformTampered => "PLATFORM_TAMPERED",
Self::PlatformSoftwareVerified => "PLATFORM_SOFTWARE_VERIFIED",
Self::PlatformHardwareVerified => "PLATFORM_HARDWARE_VERIFIED",
Self::PlatformNoVerification => "PLATFORM_NO_VERIFICATION",
Self::PlatformSecureStorageSoftwareVerified => {
"PLATFORM_SECURE_STORAGE_SOFTWARE_VERIFIED"
}
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PLATFORM_UNVERIFIED" => Some(Self::PlatformUnverified),
"PLATFORM_TAMPERED" => Some(Self::PlatformTampered),
"PLATFORM_SOFTWARE_VERIFIED" => Some(Self::PlatformSoftwareVerified),
"PLATFORM_HARDWARE_VERIFIED" => Some(Self::PlatformHardwareVerified),
"PLATFORM_NO_VERIFICATION" => Some(Self::PlatformNoVerification),
"PLATFORM_SECURE_STORAGE_SOFTWARE_VERIFIED" => {
Some(Self::PlatformSecureStorageSoftwareVerified)
}
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProtocolVersion {
Version20 = 20,
Version21 = 21,
Version22 = 22,
}
impl ProtocolVersion {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Version20 => "VERSION_2_0",
Self::Version21 => "VERSION_2_1",
Self::Version22 => "VERSION_2_2",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VERSION_2_0" => Some(Self::Version20),
"VERSION_2_1" => Some(Self::Version21),
"VERSION_2_2" => Some(Self::Version22),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum HashAlgorithmProto {
/// Unspecified hash algorithm: SHA_256 shall be used for ECC based algorithms
/// and SHA_1 shall be used otherwise.
HashAlgorithmUnspecified = 0,
HashAlgorithmSha1 = 1,
HashAlgorithmSha256 = 2,
HashAlgorithmSha384 = 3,
}
impl HashAlgorithmProto {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::HashAlgorithmUnspecified => "HASH_ALGORITHM_UNSPECIFIED",
Self::HashAlgorithmSha1 => "HASH_ALGORITHM_SHA_1",
Self::HashAlgorithmSha256 => "HASH_ALGORITHM_SHA_256",
Self::HashAlgorithmSha384 => "HASH_ALGORITHM_SHA_384",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"HASH_ALGORITHM_UNSPECIFIED" => Some(Self::HashAlgorithmUnspecified),
"HASH_ALGORITHM_SHA_1" => Some(Self::HashAlgorithmSha1),
"HASH_ALGORITHM_SHA_256" => Some(Self::HashAlgorithmSha256),
"HASH_ALGORITHM_SHA_384" => Some(Self::HashAlgorithmSha384),
_ => None,
}
}
}