44
55use AsyncAws \Core \Exception \InvalidArgument ;
66use AsyncAws \MediaConvert \Enum \CmfcAudioDuration ;
7+ use AsyncAws \MediaConvert \Enum \Mp4C2paManifest ;
78use AsyncAws \MediaConvert \Enum \Mp4CslgAtom ;
89use AsyncAws \MediaConvert \Enum \Mp4FreeSpaceBox ;
910use AsyncAws \MediaConvert \Enum \Mp4MoovPlacement ;
@@ -30,6 +31,25 @@ final class Mp4Settings
3031 */
3132 private $ audioDuration ;
3233
34+ /**
35+ * When enabled, a C2PA compliant manifest will be generated, signed and embeded in the output. For more information on
36+ * C2PA, see https://c2pa.org/specifications/specifications/2.1/index.html.
37+ *
38+ * @var Mp4C2paManifest::*|null
39+ */
40+ private $ c2paManifest ;
41+
42+ /**
43+ * Specify the name or ARN of the AWS Secrets Manager secret that contains your C2PA public certificate chain in PEM
44+ * format. Provide a valid secret name or ARN. Note that your MediaConvert service role must allow access to this
45+ * secret. The public certificate chain is added to the COSE header (x5chain) for signature validation. Include the
46+ * signer's certificate and all intermediate certificates. Do not include the root certificate. For details on COSE,
47+ * see: https://opensource.contentauthenticity.org/docs/manifest/signing-manifests.
48+ *
49+ * @var string|null
50+ */
51+ private $ certificateSecret ;
52+
3353 /**
3454 * When enabled, file composition times will start at zero, composition times in the 'ctts' (composition time to sample)
3555 * box for B-frames will be negative, and a 'cslg' (composition shift least greatest) box will be included per 14496-1
@@ -71,34 +91,51 @@ final class Mp4Settings
7191 */
7292 private $ mp4MajorBrand ;
7393
94+ /**
95+ * Specify the ID or ARN of the AWS KMS key used to sign the C2PA manifest in your MP4 output. Provide a valid KMS key
96+ * ARN. Note that your MediaConvert service role must allow access to this key.
97+ *
98+ * @var string|null
99+ */
100+ private $ signingKmsKey ;
101+
74102 /**
75103 * @param array{
76104 * AudioDuration?: null|CmfcAudioDuration::*,
105+ * C2paManifest?: null|Mp4C2paManifest::*,
106+ * CertificateSecret?: null|string,
77107 * CslgAtom?: null|Mp4CslgAtom::*,
78108 * CttsVersion?: null|int,
79109 * FreeSpaceBox?: null|Mp4FreeSpaceBox::*,
80110 * MoovPlacement?: null|Mp4MoovPlacement::*,
81111 * Mp4MajorBrand?: null|string,
112+ * SigningKmsKey?: null|string,
82113 * } $input
83114 */
84115 public function __construct (array $ input )
85116 {
86117 $ this ->audioDuration = $ input ['AudioDuration ' ] ?? null ;
118+ $ this ->c2paManifest = $ input ['C2paManifest ' ] ?? null ;
119+ $ this ->certificateSecret = $ input ['CertificateSecret ' ] ?? null ;
87120 $ this ->cslgAtom = $ input ['CslgAtom ' ] ?? null ;
88121 $ this ->cttsVersion = $ input ['CttsVersion ' ] ?? null ;
89122 $ this ->freeSpaceBox = $ input ['FreeSpaceBox ' ] ?? null ;
90123 $ this ->moovPlacement = $ input ['MoovPlacement ' ] ?? null ;
91124 $ this ->mp4MajorBrand = $ input ['Mp4MajorBrand ' ] ?? null ;
125+ $ this ->signingKmsKey = $ input ['SigningKmsKey ' ] ?? null ;
92126 }
93127
94128 /**
95129 * @param array{
96130 * AudioDuration?: null|CmfcAudioDuration::*,
131+ * C2paManifest?: null|Mp4C2paManifest::*,
132+ * CertificateSecret?: null|string,
97133 * CslgAtom?: null|Mp4CslgAtom::*,
98134 * CttsVersion?: null|int,
99135 * FreeSpaceBox?: null|Mp4FreeSpaceBox::*,
100136 * MoovPlacement?: null|Mp4MoovPlacement::*,
101137 * Mp4MajorBrand?: null|string,
138+ * SigningKmsKey?: null|string,
102139 * }|Mp4Settings $input
103140 */
104141 public static function create ($ input ): self
@@ -114,6 +151,19 @@ public function getAudioDuration(): ?string
114151 return $ this ->audioDuration ;
115152 }
116153
154+ /**
155+ * @return Mp4C2paManifest::*|null
156+ */
157+ public function getC2paManifest (): ?string
158+ {
159+ return $ this ->c2paManifest ;
160+ }
161+
162+ public function getCertificateSecret (): ?string
163+ {
164+ return $ this ->certificateSecret ;
165+ }
166+
117167 /**
118168 * @return Mp4CslgAtom::*|null
119169 */
@@ -148,6 +198,11 @@ public function getMp4MajorBrand(): ?string
148198 return $ this ->mp4MajorBrand ;
149199 }
150200
201+ public function getSigningKmsKey (): ?string
202+ {
203+ return $ this ->signingKmsKey ;
204+ }
205+
151206 /**
152207 * @internal
153208 */
@@ -160,6 +215,15 @@ public function requestBody(): array
160215 }
161216 $ payload ['audioDuration ' ] = $ v ;
162217 }
218+ if (null !== $ v = $ this ->c2paManifest ) {
219+ if (!Mp4C2paManifest::exists ($ v )) {
220+ throw new InvalidArgument (\sprintf ('Invalid parameter "c2paManifest" for "%s". The value "%s" is not a valid "Mp4C2paManifest". ' , __CLASS__ , $ v ));
221+ }
222+ $ payload ['c2paManifest ' ] = $ v ;
223+ }
224+ if (null !== $ v = $ this ->certificateSecret ) {
225+ $ payload ['certificateSecret ' ] = $ v ;
226+ }
163227 if (null !== $ v = $ this ->cslgAtom ) {
164228 if (!Mp4CslgAtom::exists ($ v )) {
165229 throw new InvalidArgument (\sprintf ('Invalid parameter "cslgAtom" for "%s". The value "%s" is not a valid "Mp4CslgAtom". ' , __CLASS__ , $ v ));
@@ -184,6 +248,9 @@ public function requestBody(): array
184248 if (null !== $ v = $ this ->mp4MajorBrand ) {
185249 $ payload ['mp4MajorBrand ' ] = $ v ;
186250 }
251+ if (null !== $ v = $ this ->signingKmsKey ) {
252+ $ payload ['signingKmsKey ' ] = $ v ;
253+ }
187254
188255 return $ payload ;
189256 }
0 commit comments